|
From: <kin...@us...> - 2023-07-13 23:05:23
|
Revision: 7097
http://sourceforge.net/p/teem/code/7097
Author: kindlmann
Date: 2023-07-13 23:05:20 +0000 (Thu, 13 Jul 2023)
Log Message:
-----------
make some more things unsigned that should always have been so
Modified Paths:
--------------
teem/trunk/src/alan/alan.h
teem/trunk/src/alan/coreAlan.c
teem/trunk/src/alan/methodsAlan.c
Modified: teem/trunk/src/alan/alan.h
===================================================================
--- teem/trunk/src/alan/alan.h 2023-07-13 23:04:28 UTC (rev 7096)
+++ teem/trunk/src/alan/alan.h 2023-07-13 23:05:20 UTC (rev 7097)
@@ -108,15 +108,15 @@
typedef struct alanContext_t {
/* INPUT ----------------------------- */
unsigned int dim, /* either 2 or 3 */
- size[3]; /* number of texels in X, Y, (Z) */
+ size[3], /* number of texels in X, Y, (Z) */
+ numThreads, /* # of threads, if airThreadCapable */
+ frameInterval, /* # of iterations between which to an image */
+ saveInterval, /* # of iterations between which to save all state */
+ maxIteration; /* cap on # of iterations, or 0 if there is no limit */
int verbose, wrap, /* do toroidal boundary wrapping */
textureType, /* what kind are we (from alanTextureType* enum) */
oversample, /* oversampling of tensors to texels */
homogAniso, /* homogenous anisotropy approximation */
- numThreads, /* # of threads, if airThreadCapable */
- frameInterval, /* # of iterations between which to an image */
- saveInterval, /* # of iterations between which to save all state */
- maxIteration, /* cap on # of iterations, or 0 if there is no limit */
constFilename; /* always use the same filename when saving frames */
alan_t K, F, /* simulation variables */
deltaX, /* size of spatial grid discretization */
@@ -137,13 +137,13 @@
int (*perIteration)(struct alanContext_t *, int iter);
/* INTERNAL -------------------------- */
- int iter; /* current iteration */
- Nrrd *_nlev[2], /* levels of morphogens, alternating buffers */
- *nlev; /* pointer to last iterations output */
- Nrrd *nparm; /* alpha, beta values for all texels */
- alan_t averageChange; /* average amount of "change" in last iteration */
- int changeCount; /* # of contributions to averageChange */
- /* to control update of averageChange and changeCount */
+ int iter; /* current iteration */
+ Nrrd *_nlev[2], /* levels of morphogens, alternating buffers */
+ *nlev; /* pointer to last iterations output */
+ Nrrd *nparm; /* alpha, beta values for all texels */
+ alan_t averageChange; /* average amount of "change" in last iteration */
+ unsigned int changeCount; /* # of contributions to averageChange
+ to control update of averageChange and changeCount */
airThreadMutex *changeMutex;
/* to synchronize separate iterations of simulation */
airThreadBarrier *iterBarrier;
Modified: teem/trunk/src/alan/coreAlan.c
===================================================================
--- teem/trunk/src/alan/coreAlan.c 2023-07-13 23:04:28 UTC (rev 7096)
+++ teem/trunk/src/alan/coreAlan.c 2023-07-13 23:05:20 UTC (rev 7097)
@@ -223,8 +223,9 @@
*tpx, *tmx, *tpy, *tmy, /* *tpz, *tmz, */
*lev0, *lev1, *parm, deltaT, alpha, beta, A, B, *v[27], lapA, lapB, corrA, corrB,
deltaA, deltaB, diffA, diffB, change;
- int dim, iter, stop, startW, endW, idx, px, mx, py, my, pz, mz, startY, endY, startZ,
- endZ, sx, sy, sz, x, y, z;
+ int dim, stop, startW, endW, idx, px, mx, py, my, pz, mz, startY, endY, startZ, endZ,
+ sx, sy, sz, x, y, z;
+ unsigned int iter;
alanTask *task;
task = (alanTask *)_task;
@@ -455,7 +456,8 @@
int /* Biff: 1 */
alanRun(alanContext *actx) {
static const char me[] = "alanRun";
- int tid, hack = AIR_FALSE;
+ int hack = AIR_FALSE;
+ unsigned int tid;
alanTask task[ALAN_THREAD_MAX];
if (_alanCheck(actx)) {
Modified: teem/trunk/src/alan/methodsAlan.c
===================================================================
--- teem/trunk/src/alan/methodsAlan.c 2023-07-13 23:04:28 UTC (rev 7096)
+++ teem/trunk/src/alan/methodsAlan.c 2023-07-13 23:05:20 UTC (rev 7097)
@@ -208,6 +208,7 @@
alanParmSet(alanContext *actx, int whichParm, double parm) {
static const char me[] = "alanParmSet";
int parmI;
+ unsigned int parmUI;
GOT_NULL;
DIM_SET;
@@ -239,15 +240,15 @@
actx->textureType = parmI;
break;
case alanParmNumThreads:
- parmI = !!parm;
+ parmUI = AIR_UINT(parm);
if (!airThreadCapable) {
fprintf(stderr,
"%s: WARNING: no multi-threading available, so 1 thread "
- "will be used, not %d\n",
- me, parmI);
- parmI = 1;
+ "will be used, not %u\n",
+ me, parmUI);
+ parmUI = 1;
}
- actx->numThreads = parmI;
+ actx->numThreads = parmUI;
break;
case alanParmHomogAniso:
parmI = !!parm;
@@ -254,16 +255,16 @@
actx->homogAniso = parmI;
break;
case alanParmSaveInterval:
- parmI = !!parm;
- actx->saveInterval = parmI;
+ parmUI = AIR_UINT(parm);
+ actx->saveInterval = parmUI;
break;
case alanParmFrameInterval:
- parmI = !!parm;
- actx->frameInterval = parmI;
+ parmUI = AIR_UINT(parm);
+ actx->frameInterval = parmUI;
break;
case alanParmMaxIteration:
- parmI = !!parm;
- actx->maxIteration = parmI;
+ parmUI = AIR_UINT(parm);
+ actx->maxIteration = parmUI;
break;
case alanParmConstantFilename:
parmI = !!parm;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|