From: <kin...@us...> - 2008-06-06 14:44:36
|
Revision: 3849 http://teem.svn.sourceforge.net/teem/?rev=3849&view=rev Author: kindlmann Date: 2008-06-06 07:44:41 -0700 (Fri, 06 Jun 2008) Log Message: ----------- using long int instead of int for parsing things related to sample positions along axes Modified Paths: -------------- teem/trunk/src/unrrdu/crop.c teem/trunk/src/unrrdu/flotsam.c teem/trunk/src/unrrdu/inset.c teem/trunk/src/unrrdu/pad.c teem/trunk/src/unrrdu/slice.c teem/trunk/src/unrrdu/splice.c Modified: teem/trunk/src/unrrdu/crop.c =================================================================== --- teem/trunk/src/unrrdu/crop.c 2008-06-01 20:33:07 UTC (rev 3848) +++ teem/trunk/src/unrrdu/crop.c 2008-06-06 14:44:41 UTC (rev 3849) @@ -32,7 +32,8 @@ char *out, *err; Nrrd *nin, *nout; unsigned int ai; - int *minOff, minLen, *maxOff, maxLen, pret; + int minLen, maxLen, pret; + long int *minOff, *maxOff; size_t min[NRRD_DIM_MAX], max[NRRD_DIM_MAX]; airArray *mop; Modified: teem/trunk/src/unrrdu/flotsam.c =================================================================== --- teem/trunk/src/unrrdu/flotsam.c 2008-06-01 20:33:07 UTC (rev 3848) +++ teem/trunk/src/unrrdu/flotsam.c 2008-06-06 14:44:41 UTC (rev 3849) @@ -88,7 +88,7 @@ /* ******** unrrduHestPosCB ** -** For parsing position along an axis. Can be a simple integer, +** For parsing position along an axis. Can be a simple (long) integer, ** or M to signify last position along axis (#samples-1), or ** M+<int> or M-<int> to signify some position relative to the end. ** @@ -109,13 +109,13 @@ int unrrduParsePos(void *ptr, char *str, char err[AIR_STRLEN_HUGE]) { char me[]="unrrduParsePos"; - int *pos; + long int *pos; if (!(ptr && str)) { sprintf(err, "%s: got NULL pointer", me); return 1; } - pos = (int*)ptr; + pos = (long int*)ptr; if (!strcmp("M", str)) { pos[0] = 1; pos[1] = 0; @@ -127,7 +127,7 @@ return 1; } pos[0] = 1; - if (1 != sscanf(str+1, "%d", &(pos[1]))) { + if (1 != sscanf(str+1, "%ld", &(pos[1]))) { sprintf(err, "%s: can't parse \"%s\" as M+<int> or M-<int>", me, str); return 1; } @@ -139,12 +139,12 @@ return 1; } pos[0] = -1; - if (1 != sscanf(str+1, "%d", &(pos[1]))) { + if (1 != sscanf(str+1, "%ld", &(pos[1]))) { sprintf(err, "%s: can't parse \"%s\" as m+<int>", me, str); return 1; } if (pos[1] < 0 ) { - sprintf(err, "%s: int in m+<int> must be non-negative (not %d)", + sprintf(err, "%s: int in m+<int> must be non-negative (not %ld)", me, pos[1]); return 1; } @@ -152,7 +152,7 @@ } /* else its just a plain unadorned integer */ pos[0] = 0; - if (1 != sscanf(str, "%d", &(pos[1]))) { + if (1 != sscanf(str, "%ld", &(pos[1]))) { sprintf(err, "%s: can't parse \"%s\" as int", me, str); return 1; } @@ -160,7 +160,7 @@ } hestCB unrrduHestPosCB = { - 2*sizeof(int), + 2*sizeof(long int), "position", unrrduParsePos, NULL Modified: teem/trunk/src/unrrdu/inset.c =================================================================== --- teem/trunk/src/unrrdu/inset.c 2008-06-01 20:33:07 UTC (rev 3848) +++ teem/trunk/src/unrrdu/inset.c 2008-06-06 14:44:41 UTC (rev 3849) @@ -33,7 +33,8 @@ char *out, *err; Nrrd *nin, *nout, *nsub; unsigned int ai, minLen; - int *minOff, pret; + int pret; + long int *minOff; size_t min[NRRD_DIM_MAX]; airArray *mop; Modified: teem/trunk/src/unrrdu/pad.c =================================================================== --- teem/trunk/src/unrrdu/pad.c 2008-06-01 20:33:07 UTC (rev 3848) +++ teem/trunk/src/unrrdu/pad.c 2008-06-06 14:44:41 UTC (rev 3849) @@ -32,7 +32,8 @@ char *out, *err; Nrrd *nin, *nout; unsigned int ai; - int *minOff, minLen, *maxOff, maxLen, bb, pret; + int minLen, maxLen, bb, pret; + long int *minOff, *maxOff; ptrdiff_t min[NRRD_DIM_MAX], max[NRRD_DIM_MAX]; double padVal; airArray *mop; Modified: teem/trunk/src/unrrdu/slice.c =================================================================== --- teem/trunk/src/unrrdu/slice.c 2008-06-01 20:33:07 UTC (rev 3848) +++ teem/trunk/src/unrrdu/slice.c 2008-06-06 14:44:41 UTC (rev 3849) @@ -34,7 +34,9 @@ char *out, *err; Nrrd *nin, *nout; unsigned int axis; - int _pos[2], pos, pret; + int pret; + size_t pos; + int _pos[2]; airArray *mop; OPT_ADD_AXIS(axis, "axis to slice along"); Modified: teem/trunk/src/unrrdu/splice.c =================================================================== --- teem/trunk/src/unrrdu/splice.c 2008-06-01 20:33:07 UTC (rev 3848) +++ teem/trunk/src/unrrdu/splice.c 2008-06-06 14:44:41 UTC (rev 3849) @@ -33,7 +33,9 @@ char *out, *err; Nrrd *nin, *nout, *nslice; unsigned int axis; - int _pos[2], pos, pret; + int pret; + long int _pos[2]; + size_t pos; airArray *mop; OPT_ADD_AXIS(axis, "axis to splice along"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kin...@us...> - 2008-06-25 23:38:07
|
Revision: 3864 http://teem.svn.sourceforge.net/teem/?rev=3864&view=rev Author: kindlmann Date: 2008-06-25 16:38:11 -0700 (Wed, 25 Jun 2008) Log Message: ----------- tracking change from _nrrdContainsPercentDAndMore to _nrrdContainsPercentThisAndMore Modified Paths: -------------- teem/trunk/src/unrrdu/dice.c teem/trunk/src/unrrdu/make.c Modified: teem/trunk/src/unrrdu/dice.c =================================================================== --- teem/trunk/src/unrrdu/dice.c 2008-06-25 23:36:45 UTC (rev 3863) +++ teem/trunk/src/unrrdu/dice.c 2008-06-25 23:38:11 UTC (rev 3864) @@ -77,11 +77,15 @@ airMopError(mop); return 1; } - + + /* HEY: this should use nrrdSaveMulti(), and if there's additional + smarts here, they should be moved into nrrdSaveMulti() */ if (airStrlen(ftmpl)) { - if (!_nrrdContainsPercentDAndMore(ftmpl)) { + if (!( _nrrdContainsPercentThisAndMore(ftmpl, 'd') + || _nrrdContainsPercentThisAndMore(ftmpl, 'u') )) { fprintf(stderr, "%s: given filename format \"%s\" doesn't seem to " - "have the format sequence to print an integer\n", me, ftmpl); + "have the converstion specification to print an integer\n", + me, ftmpl); airMopError(mop); return 1; } Modified: teem/trunk/src/unrrdu/make.c =================================================================== --- teem/trunk/src/unrrdu/make.c 2008-06-25 23:36:45 UTC (rev 3863) +++ teem/trunk/src/unrrdu/make.c 2008-06-25 23:38:11 UTC (rev 3864) @@ -311,7 +311,7 @@ /* have to simulate having parsed this line for error checking in _nrrdDataFNCheck() to not cause problems */ nio->seen[nrrdField_sizes] = AIR_TRUE; - if (_nrrdContainsPercentDAndMore(dataFileNames[0])) { + if (_nrrdContainsPercentThisAndMore(dataFileNames[0], 'd')) { /* trying to do a formatted filename list */ if (nameLen < 4 || nameLen > 5) { fprintf(stderr, "%s: formatted list of filenames needs between " This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |