| 763 | } |
| 764 | |
| 765 | char * sleftv::String(void *d, BOOLEAN typed, int dim) |
| 766 | { |
| 767 | #ifdef SIQ |
| 768 | if (rtyp==COMMAND) |
| 769 | { |
| 770 | ::Print("##command %d\n",((command)data)->op); |
| 771 | if (((command)data)->arg1.rtyp!=0) |
| 772 | ((command)data)->arg1.Print(NULL,2); |
| 773 | if (((command)data)->arg2.rtyp!=0) |
| 774 | ((command)data)->arg2.Print(NULL,2); |
| 775 | if (((command)data)->arg3.rtyp==0) |
| 776 | ((command)data)->arg3.Print(NULL,2); |
| 777 | PrintS("##end\n"); |
| 778 | return omStrDup(""); |
| 779 | } |
| 780 | #endif |
| 781 | if (d==NULL) d=Data(); |
| 782 | if (!errorreported) |
| 783 | { |
| 784 | char *s; |
| 785 | int t=Typ(); |
| 786 | switch (t /*Typ()*/) |
| 787 | { |
| 788 | case INT_CMD: |
| 789 | if (typed) |
| 790 | { |
| 791 | #if SIZEOF_LONG==8 |
| 792 | const size_t len=MAX_INT_LEN+17; |
| 793 | #else |
| 794 | const size_t len=MAX_INT_LEN+7; |
| 795 | #endif |
| 796 | s=(char*)omAlloc(len); |
| 797 | snprintf(s,len,"int(%ld)",(long)d); |
| 798 | } |
| 799 | else |
| 800 | { |
| 801 | #if SIZEOF_LONG==8 |
| 802 | const size_t len=MAX_INT_LEN+12; |
| 803 | #else |
| 804 | const size_t len=MAX_INT_LEN+2; |
| 805 | #endif |
| 806 | s=(char*)omAlloc(len); |
| 807 | snprintf(s,len,"%ld",(long)d); |
| 808 | } |
| 809 | return s; |
| 810 | |
| 811 | case STRING_CMD: |
| 812 | if (d == NULL) |
| 813 | { |
| 814 | if (typed) return omStrDup("\"\""); |
| 815 | return omStrDup(""); |
| 816 | } |
| 817 | if (typed) |
| 818 | { |
| 819 | size_t len=strlen((char*) d) + 3; |
| 820 | s = (char*) omAlloc(len); |
| 821 | snprintf(s,len,"\"%s\"", (char*) d); |
| 822 | return s; |
nothing calls this directly
no test coverage detected