Changeset 34342
- Timestamp:
- Aug 23, 2012, 10:04:31 AM (14 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 7 edited
- 1 copied
-
. (modified) (1 prop)
-
cmd.astro (modified) (1 prop)
-
cmd.astro/Makefile (modified) (1 diff)
-
cmd.astro/csystem.c (modified) (4 diffs)
-
cmd.astro/getcoords.c (copied) (copied from branches/eam_branches/ipp-20120805/Ohana/src/opihi/cmd.astro/getcoords.c )
-
cmd.astro/init.c (modified) (2 diffs)
-
cmd.basic/fprintf.c (modified) (2 diffs)
-
lib.shell/stack_math.c (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi
- Property svn:mergeinfo set to
-
trunk/Ohana/src/opihi/cmd.astro
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20120805/Ohana/src/opihi/cmd.astro (added) merged: 34339,34341
- Property svn:mergeinfo changed
-
trunk/Ohana/src/opihi/cmd.astro/Makefile
r33963 r34342 43 43 $(SRC)/galsectors.$(ARCH).o \ 44 44 $(SRC)/galprofiles.$(ARCH).o \ 45 $(SRC)/getcoords.$(ARCH).o \ 45 46 $(SRC)/elliprofile.$(ARCH).o \ 46 47 $(SRC)/ringflux.$(ARCH).o \ -
trunk/Ohana/src/opihi/cmd.astro/csystem.c
r20936 r34342 11 11 CoordTransform *transform; 12 12 13 if (argc != 5) { 14 gprint (GP_ERR, "USAGE: csystems [C/G/E/H] [C/G/E/H] X Y\n"); 15 return (FALSE); 16 } 13 if (argc != 5) goto syntax; 17 14 18 15 switch (argv[1][0]) { … … 20 17 case 'G': input = COORD_GALACTIC; break; 21 18 case 'E': input = COORD_ECLIPTIC; break; 22 default: abort();19 default: goto syntax; 23 20 } 24 21 … … 27 24 case 'G': output = COORD_GALACTIC; break; 28 25 case 'E': output = COORD_ECLIPTIC; break; 29 default: abort();26 default: goto syntax; 30 27 } 31 28 … … 66 63 return (TRUE); 67 64 65 syntax: 66 gprint (GP_ERR, "USAGE: csystems [C/G/E/H] [C/G/E/H] X Y\n"); 67 return (FALSE); 68 68 } -
trunk/Ohana/src/opihi/cmd.astro/init.c
r33963 r34342 29 29 int galradius PROTO((int, char **)); 30 30 int galradbins PROTO((int, char **)); 31 int getcoords PROTO((int, char **)); 31 32 int elliprofile PROTO((int, char **)); 32 33 int ringflux PROTO((int, char **)); … … 86 87 {1, "galradius", galradius, "generate radial vectors with interpolation along paths"}, 87 88 {1, "galradbins", galradbins, "generate radial vectors with interpolation along paths"}, 89 {1, "getcoords", getcoords, "generate images containing the RA,DEC coord for each pixel"}, 88 90 {1, "elliprofile", elliprofile, "generate radial vectors with interpolation along paths"}, 89 91 {1, "ringflux", ringflux, "mean flux in a ring"}, -
trunk/Ohana/src/opihi/cmd.basic/fprintf.c
r29540 r34342 45 45 case 'F': 46 46 case 'G': 47 sprintf (tmp, fmt, atof(argv[i]));47 sprintf (tmp, fmt, strtod (argv[i], NULL)); 48 48 break; 49 49 case 's': … … 57 57 case 'x': 58 58 case 'X': 59 sprintf (tmp, fmt, atoi(argv[i]));59 sprintf (tmp, fmt, strtol(argv[i], NULL, 0)); 60 60 break; 61 61 default: -
trunk/Ohana/src/opihi/lib.shell/stack_math.c
r30614 r34342 86 86 case '*': VV_FUNC('s', *M1 * *M2); 87 87 case '/': VV_FUNC('S', *M1 / (opihi_flt) *M2); 88 case '%': VV_FUNC('s', ( int)*M1 % (int)*M2);88 case '%': VV_FUNC('s', (long long)*M1 % (long long)*M2); 89 89 case '^': VV_FUNC('S', pow (*M1, *M2)); 90 90 case '@': VV_FUNC('S', DEG_RAD*atan2 (*M1, *M2)); … … 93 93 case '<': VV_FUNC('s', (*M1 < *M2) ? 1 : 0); 94 94 case '>': VV_FUNC('s', (*M1 > *M2) ? 1 : 0); 95 case '&': VV_FUNC('s', (( int)*M1 & (int)*M2));96 case '|': VV_FUNC('s', (( int)*M1 | (int)*M2));95 case '&': VV_FUNC('s', ((long long)*M1 & (long long)*M2)); 96 case '|': VV_FUNC('s', ((long long)*M1 | (long long)*M2)); 97 97 case 'E': VV_FUNC('s', (*M1 == *M2) ? 1 : 0); 98 98 case 'N': VV_FUNC('s', (*M1 != *M2) ? 1 : 0); … … 196 196 case '*': SV_FUNC('s', M1 * *M2); 197 197 case '/': SV_FUNC('S', M1 / (opihi_flt) *M2); 198 case '%': SV_FUNC('s', ( int) M1 % (int) *M2);198 case '%': SV_FUNC('s', (long long) M1 % (long long) *M2); 199 199 case '^': SV_FUNC('S', pow (M1, *M2)); 200 200 case '@': SV_FUNC('S', DEG_RAD*atan2 (M1, *M2)); … … 203 203 case '<': SV_FUNC('s', (M1 < *M2) ? 1 : 0); 204 204 case '>': SV_FUNC('s', (M1 > *M2) ? 1 : 0); 205 case '&': SV_FUNC('s', (( int)M1 & (int)*M2));206 case '|': SV_FUNC('s', (( int)M1 | (int)*M2));205 case '&': SV_FUNC('s', ((long long)M1 & (long long)*M2)); 206 case '|': SV_FUNC('s', ((long long)M1 | (long long)*M2)); 207 207 case 'E': SV_FUNC('s', (M1 == *M2) ? 1 : 0); 208 208 case 'N': SV_FUNC('s', (M1 != *M2) ? 1 : 0); … … 302 302 case '*': VS_FUNC('s', *M1 * M2); 303 303 case '/': VS_FUNC('S', *M1 / (opihi_flt) M2); 304 case '%': VS_FUNC('s', ( int) *M1 % (int) M2);304 case '%': VS_FUNC('s', (long long) *M1 % (long long) M2); 305 305 case '^': VS_FUNC('S', pow (*M1, M2)); 306 306 case '@': VS_FUNC('S', DEG_RAD*atan2 (*M1, M2)); … … 309 309 case '<': VS_FUNC('s', (*M1 < M2) ? 1 : 0); 310 310 case '>': VS_FUNC('s', (*M1 > M2) ? 1 : 0); 311 case '&': VS_FUNC('s', (( int)*M1 & (int)M2));312 case '|': VS_FUNC('s', (( int)*M1 | (int)M2));311 case '&': VS_FUNC('s', ((long long)*M1 & (long long)M2)); 312 case '|': VS_FUNC('s', ((long long)*M1 | (long long)M2)); 313 313 case 'E': VS_FUNC('s', (*M1 == M2) ? 1 : 0); 314 314 case 'N': VS_FUNC('s', (*M1 != M2) ? 1 : 0); … … 392 392 case '*': MV_FUNC(*M1 * *M2); 393 393 case '/': MV_FUNC(*M1 / (opihi_flt) *M2); 394 case '%': MV_FUNC(( int) *M1 % (int) *M2);394 case '%': MV_FUNC((long long) *M1 % (long long) *M2); 395 395 case '^': MV_FUNC(pow (*M1, *M2)); 396 396 case '@': MV_FUNC(DEG_RAD*atan2 (*M1, *M2)); … … 399 399 case '<': MV_FUNC((*M1 < *M2) ? 1 : 0); 400 400 case '>': MV_FUNC((*M1 > *M2) ? 1 : 0); 401 case '&': MV_FUNC((( int)*M1 & (int)*M2));402 case '|': MV_FUNC((( int)*M1 | (int)*M2));401 case '&': MV_FUNC(((long long)*M1 & (long long)*M2)); 402 case '|': MV_FUNC(((long long)*M1 | (long long)*M2)); 403 403 case 'E': MV_FUNC((*M1 == *M2) ? 1 : 0); 404 404 case 'N': MV_FUNC((*M1 != *M2) ? 1 : 0); … … 484 484 case '*': VM_FUNC(*M1 * *M2); 485 485 case '/': VM_FUNC(*M1 / (opihi_flt) *M2); 486 case '%': VM_FUNC(( int) *M1 % (int) *M2);486 case '%': VM_FUNC((long long) *M1 % (long long) *M2); 487 487 case '^': VM_FUNC(pow (*M1, *M2)); 488 488 case '@': VM_FUNC(DEG_RAD*atan2 (*M1, *M2)); … … 491 491 case '<': VM_FUNC((*M1 < *M2) ? 1 : 0); 492 492 case '>': VM_FUNC((*M1 > *M2) ? 1 : 0); 493 case '&': VM_FUNC((( int)*M1 & (int)*M2));494 case '|': VM_FUNC((( int)*M1 | (int)*M2));493 case '&': VM_FUNC(((long long)*M1 & (long long)*M2)); 494 case '|': VM_FUNC(((long long)*M1 | (long long)*M2)); 495 495 case 'E': VM_FUNC((*M1 == *M2) ? 1 : 0); 496 496 case 'N': VM_FUNC((*M1 != *M2) ? 1 : 0); … … 564 564 case '*': MM_FUNC(*M1 * *M2); 565 565 case '/': MM_FUNC(*M1 / (float) *M2); 566 case '%': MM_FUNC(( int) *M1 % (int) *M2);566 case '%': MM_FUNC((long long) *M1 % (long long) *M2); 567 567 case '^': MM_FUNC(pow (*M1, *M2)); 568 568 case '@': MM_FUNC(DEG_RAD*atan2 (*M1, *M2)); … … 571 571 case '<': MM_FUNC((*M1 < *M2) ? 1 : 0); 572 572 case '>': MM_FUNC((*M1 > *M2) ? 1 : 0); 573 case '&': MM_FUNC((( int)*M1 & (int)*M2));574 case '|': MM_FUNC((( int)*M1 | (int)*M2));573 case '&': MM_FUNC(((long long)*M1 & (long long)*M2)); 574 case '|': MM_FUNC(((long long)*M1 | (long long)*M2)); 575 575 case 'E': MM_FUNC((*M1 == *M2) ? 1 : 0); 576 576 case 'N': MM_FUNC((*M1 != *M2) ? 1 : 0); … … 649 649 case '*': MS_FUNC(*M1 * M2); 650 650 case '/': MS_FUNC(*M1 / (float) M2); 651 case '%': MS_FUNC(( int) *M1 % (int) M2);651 case '%': MS_FUNC((long long) *M1 % (long long) M2); 652 652 case '^': MS_FUNC(pow (*M1, M2)); 653 653 case '@': MS_FUNC(DEG_RAD*atan2 (*M1, M2)); … … 656 656 case '<': MS_FUNC((*M1 < M2) ? 1 : 0); 657 657 case '>': MS_FUNC((*M1 > M2) ? 1 : 0); 658 case '&': MS_FUNC((( int)*M1 & (int)M2));659 case '|': MS_FUNC((( int)*M1 | (int)M2));658 case '&': MS_FUNC(((long long)*M1 & (long long)M2)); 659 case '|': MS_FUNC(((long long)*M1 | (long long)M2)); 660 660 case 'E': MS_FUNC((*M1 == M2) ? 1 : 0); 661 661 case 'N': MS_FUNC((*M1 != M2) ? 1 : 0); … … 725 725 case '*': SM_FUNC(M1 * *M2); 726 726 case '/': SM_FUNC(M1 / (float) *M2); 727 case '%': SM_FUNC(( int) M1 % (int) *M2);727 case '%': SM_FUNC((long long) M1 % (long long) *M2); 728 728 case '^': SM_FUNC(pow (M1, *M2)); 729 729 case '@': SM_FUNC(DEG_RAD*atan2 (M1, *M2)); … … 732 732 case '<': SM_FUNC((M1 < *M2) ? 1 : 0); 733 733 case '>': SM_FUNC((M1 > *M2) ? 1 : 0); 734 case '&': SM_FUNC((( int)M1 & (int)*M2));735 case '|': SM_FUNC((( int)M1 | (int)*M2));734 case '&': SM_FUNC(((long long)M1 & (long long)*M2)); 735 case '|': SM_FUNC(((long long)M1 | (long long)*M2)); 736 736 case 'E': SM_FUNC((M1 == *M2) ? 1 : 0); 737 737 case 'N': SM_FUNC((M1 != *M2) ? 1 : 0); … … 806 806 case '*': SS_FUNC('s', M1 * M2); 807 807 case '/': SS_FUNC('S', M1 / (opihi_flt) M2); 808 case '%': SS_FUNC('s', ( int) M1 % (int) M2);808 case '%': SS_FUNC('s', (long long) M1 % (long long) M2); 809 809 case '^': SS_FUNC('S', pow (M1, M2)); 810 810 case '@': SS_FUNC('S', DEG_RAD*atan2 (M1, M2)); … … 813 813 case '<': SS_FUNC('s', (M1 < M2) ? 1 : 0); 814 814 case '>': SS_FUNC('s', (M1 > M2) ? 1 : 0); 815 case '&': SS_FUNC('s', (( int)M1 & (int)M2));816 case '|': SS_FUNC('s', (( int)M1 | (int)M2));815 case '&': SS_FUNC('s', ((long long)M1 & (long long)M2)); 816 case '|': SS_FUNC('s', ((long long)M1 | (long long)M2)); 817 817 case 'E': SS_FUNC('s', (M1 == M2) ? 1 : 0); 818 818 case 'N': SS_FUNC('s', (M1 != M2) ? 1 : 0); … … 916 916 if (!strcmp (op, "=")) S_FUNC(M1, 's'); 917 917 if (!strcmp (op, "abs")) S_FUNC(fabs(M1), 's'); 918 if (!strcmp (op, "int")) S_FUNC(( int)(M1), 's');918 if (!strcmp (op, "int")) S_FUNC((long long)(M1), 's'); 919 919 if (!strcmp (op, "exp")) S_FUNC(exp (M1), 'S'); 920 920 if (!strcmp (op, "ten")) S_FUNC(pow (10.0,M1), 'S'); … … 995 995 if (!strcmp (op, "=")) V_FUNC(*M1, 's'); 996 996 if (!strcmp (op, "abs")) V_FUNC(fabs(*M1), 's'); 997 if (!strcmp (op, "int")) V_FUNC(( int)(*M1), 's');997 if (!strcmp (op, "int")) V_FUNC((long long)(*M1), 's'); 998 998 if (!strcmp (op, "exp")) V_FUNC(exp(*M1), 'S'); 999 999 if (!strcmp (op, "ten")) V_FUNC(pow(10.0,*M1), 'S'); … … 1066 1066 if (!strcmp (op, "=")) { } 1067 1067 if (!strcmp (op, "abs")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = fabs(*M1); }} 1068 if (!strcmp (op, "int")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = (opihi_flt)( int)(*M1); }}1068 if (!strcmp (op, "int")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = (opihi_flt)(long long)(*M1); }} 1069 1069 if (!strcmp (op, "exp")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = exp(*M1); }} 1070 1070 if (!strcmp (op, "ten")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = pow(10.0,*M1); }}
Note:
See TracChangeset
for help on using the changeset viewer.
