|
From: <kin...@us...> - 2023-07-07 21:32:10
|
Revision: 7043
http://sourceforge.net/p/teem/code/7043
Author: kindlmann
Date: 2023-07-07 21:32:07 +0000 (Fri, 07 Jul 2023)
Log Message:
-----------
Propagating AIR_STRLEN --> AIR_STRLEN+1 change, with these API CHANGEs
to these functions:
int gageStackBlurParmSprint(char str[AIR_STRLEN_LARGE + 1],
const gageStackBlurParm *sbp,
int extraFlag[256],
char *extraParm);
int gageStackBlurParmCompare(const gageStackBlurParm *sbpA,
const char *nameA,
const gageStackBlurParm *sbpB,
const char *nameB,
int *differ,
char explain[AIR_STRLEN_LARGE + 1]);
and to these struct members:
gageKind_t:
char name[AIR_STRLEN_SMALL + 1]; /* short identifying string for kind */
gageContext:
char errStr[AIR_STRLEN_LARGE + 1];
Modified Paths:
--------------
teem/trunk/src/gage/ctx.c
teem/trunk/src/gage/gage.h
teem/trunk/src/gage/kind.c
teem/trunk/src/gage/optimsig.c
teem/trunk/src/gage/stackBlur.c
Modified: teem/trunk/src/gage/ctx.c
===================================================================
--- teem/trunk/src/gage/ctx.c 2023-07-07 21:24:21 UTC (rev 7042)
+++ teem/trunk/src/gage/ctx.c 2023-07-07 21:32:07 UTC (rev 7043)
@@ -236,7 +236,7 @@
} else {
/* its a derivative, so integral must be near zero */
if (!(AIR_ABS(integral) <= ctx->parm.kernelIntegralNearZero)) {
- char str[AIR_STRLEN_LARGE] = "";
+ char str[AIR_STRLEN_LARGE + 1] = "";
nrrdKernelSprint(str, k, kparm);
biffAddf(GAGE,
"%s: derivative %s kernel (%s) integral %g not within "
Modified: teem/trunk/src/gage/gage.h
===================================================================
--- teem/trunk/src/gage/gage.h 2023-07-07 21:24:21 UTC (rev 7042)
+++ teem/trunk/src/gage/gage.h 2023-07-07 21:32:07 UTC (rev 7043)
@@ -774,7 +774,7 @@
something is actually sprintf'ed into errStr is controlled by
parm.generateErrStr.
NOTE: these variables used to be globals "gageErrStr" and "gageErrNum" */
- char errStr[AIR_STRLEN_LARGE];
+ char errStr[AIR_STRLEN_LARGE + 1];
int errNum; /* takes values from the gageErr enum */
/* what fraction of the values in the kernel support had to be invented
@@ -845,25 +845,25 @@
** and set everything in a single shot).
*/
typedef struct gageKind_t {
- int dynamicAlloc; /* non-zero if this kind struct was
- dynamically allocated */
- char name[AIR_STRLEN_SMALL]; /* short identifying string for kind */
- const airEnum *enm; /* such as gageScl. NB: the "unknown"
- value in the enum *must* be 0. */
- unsigned int baseDim, /* dimension that x,y,z axes start on
- (e.g. 0 for scalars, 1 for vectors) */
- valLen; /* number of scalars per data point,
- -or- 0 to represent "this value will
- be learned later at runtime" */
- int itemMax; /* such as GAGE_SCL_ITEM_MAX */
- gageItemEntry *table; /* array of gageItemEntry's, indexed
- by the item value,
- -or- NULL if the table cannot be
- statically allocated (not because it
- can come in different sizes, but
- because it needs to be a modified
- version of the compile-time table */
- void (*iv3Print)(FILE *, /* such as _gageSclIv3Print() */
+ int dynamicAlloc; /* non-zero if this kind struct was
+ dynamically allocated */
+ char name[AIR_STRLEN_SMALL + 1]; /* short identifying string for kind */
+ const airEnum *enm; /* such as gageScl. NB: the "unknown"
+ value in the enum *must* be 0. */
+ unsigned int baseDim, /* dimension that x,y,z axes start on
+ (e.g. 0 for scalars, 1 for vectors) */
+ valLen; /* number of scalars per data point,
+ -or- 0 to represent "this value will
+ be learned later at runtime" */
+ int itemMax; /* such as GAGE_SCL_ITEM_MAX */
+ gageItemEntry *table; /* array of gageItemEntry's, indexed
+ by the item value,
+ -or- NULL if the table cannot be
+ statically allocated (not because it
+ can come in different sizes, but
+ because it needs to be a modified
+ version of the compile-time table */
+ void (*iv3Print)(FILE *, /* such as _gageSclIv3Print() */
gageContext *,
gagePerVolume *),
(*filter)(gageContext *, /* such as _gageSclFilter() */
@@ -1208,7 +1208,7 @@
const gageStackBlurParm *sbpB,
const char *nameB,
int *differ,
- char explain[AIR_STRLEN_LARGE]);
+ char explain[AIR_STRLEN_LARGE + 1]);
GAGE_EXPORT int gageStackBlurParmScaleSet(gageStackBlurParm *sbp, unsigned int num,
double sigmaMin, double sigmaMax,
int uniformSigma, int optimalL2L2);
@@ -1235,7 +1235,7 @@
char **extraParmsP,
const char *str);
GAGE_EXPORT const hestCB *const gageHestStackBlurParm;
-GAGE_EXPORT int gageStackBlurParmSprint(char str[AIR_STRLEN_LARGE],
+GAGE_EXPORT int gageStackBlurParmSprint(char str[AIR_STRLEN_LARGE + 1],
const gageStackBlurParm *sbp,
int extraFlag[256],
char *extraParm);
Modified: teem/trunk/src/gage/kind.c
===================================================================
--- teem/trunk/src/gage/kind.c 2023-07-07 21:24:21 UTC (rev 7042)
+++ teem/trunk/src/gage/kind.c 2023-07-07 21:32:07 UTC (rev 7043)
@@ -237,7 +237,7 @@
return 1;
}
if (kind->baseDim) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
if (1 == kind->baseDim) {
if (kind->valLen != nrrd->axis[0].size) {
biffAddf(GAGE, "%s: %s kind needs %u axis 0 values, not %s", me, kind->name,
Modified: teem/trunk/src/gage/optimsig.c
===================================================================
--- teem/trunk/src/gage/optimsig.c 2023-07-07 21:24:21 UTC (rev 7042)
+++ teem/trunk/src/gage/optimsig.c 2023-07-07 21:32:07 UTC (rev 7043)
@@ -520,7 +520,7 @@
*/
/*
if (debugging) {
- char fname[AIR_STRLEN_SMALL];
+ char fname[AIR_STRLEN_SMALL+1];
sprintf(fname, "interp-%04u.nrrd", debugii);
nrrdSave(fname, ninterp, NULL);
}
@@ -625,7 +625,7 @@
}
/*
if (debugging) {
- char fname[AIR_STRLEN_SMALL];
+ char fname[AIR_STRLEN_SMALL+1];
sprintf(fname, "interp-%04u.nrrd", debugii);
nrrdSave(fname, oscx->ninterp, NULL);
}
@@ -674,7 +674,7 @@
oscx->trueImgNum, AIR_NAN, AIR_NAN);
/*
if (debugging) {
- char fname[AIR_STRLEN_SMALL];
+ char fname[AIR_STRLEN_SMALL+1];
unsigned int ni;
for (ni=0; ni<oscx->sampleNum; ni++) {
sprintf(fname, "sample-%04u.nrrd", ni);
@@ -684,7 +684,7 @@
*/
if (0) {
static unsigned int call = 0;
- char fname[AIR_STRLEN_SMALL];
+ char fname[AIR_STRLEN_SMALL + 1];
sprintf(fname, "err-%04u.nrrd", call);
nrrdSave(fname, oscx->nerr, NULL);
call++;
@@ -742,7 +742,7 @@
*retP = 1000 * oscx->sampleNum * (mmErr[1] - mmErr[0]) / (rr[1] - rr[0]);
if (0) {
static unsigned int call = 0;
- char fname[AIR_STRLEN_SMALL];
+ char fname[AIR_STRLEN_SMALL + 1];
sprintf(fname, "err-%04u.nrrd", call);
nrrdSave(fname, oscx->nerr, NULL);
call++;
@@ -794,7 +794,7 @@
}
static char *
-_timefmt(char tstr[AIR_STRLEN_MED], double deltim) {
+_timefmt(char tstr[AIR_STRLEN_MED + 1], double deltim) {
if (deltim < 60) {
sprintf(tstr, "%g secs", deltim);
@@ -823,7 +823,7 @@
static int /* Biff: 1 */
_optsigrun(gageOptimSigContext *oscx) {
static const char me[] = "_optsigrun";
- char tstr[AIR_STRLEN_MED];
+ char tstr[AIR_STRLEN_MED + 1];
unsigned int iter, pnt;
double lastErr, newErr, rhoeps, oppor, lastPos, backoff, decavg, time0;
int badStep;
@@ -965,7 +965,7 @@
static int /* Biff: 1 */
_optsigrunLinf(gageOptimSigContext *oscx) {
static const char me[] = "_optsigrunLinf";
- char tstr[AIR_STRLEN_MED];
+ char tstr[AIR_STRLEN_MED + 1];
double *srho, *stmp, time0, lastErr, newErr, decavg, step, oppor, backoff, ceps,
mmErr[2];
unsigned int iter, si, sn, mmIdx[2];
@@ -1165,7 +1165,7 @@
unsigned int sigmaNum, const NrrdKernelSpec *kssSpec,
int imgMeasr) {
static const char me[] = "gageOptimSigErrorPlot";
- char doneStr[AIR_STRLEN_SMALL];
+ char doneStr[AIR_STRLEN_SMALL + 1];
double *out;
unsigned int ii;
@@ -1231,7 +1231,7 @@
/*
if (0) {
static unsigned int call=0;
- char fname[AIR_STRLEN_SMALL];
+ char fname[AIR_STRLEN_SMALL+1];
unsigned int ni;
if (0) {
sprintf(fname, "err-%04u.nrrd", call);
@@ -1256,7 +1256,7 @@
unsigned int sampleNum, const NrrdKernelSpec *kssSpec,
int imgMeasr) {
static const char me[] = "gageOptimSigErrorPlotSliding";
- char doneStr[AIR_STRLEN_SMALL];
+ char doneStr[AIR_STRLEN_SMALL + 1];
unsigned int ii;
double *out;
char hackKeyStr[] = "TEEM_OPTSIG_RECONERR";
Modified: teem/trunk/src/gage/stackBlur.c
===================================================================
--- teem/trunk/src/gage/stackBlur.c 2023-07-07 21:24:21 UTC (rev 7042)
+++ teem/trunk/src/gage/stackBlur.c 2023-07-07 21:32:07 UTC (rev 7043)
@@ -124,11 +124,11 @@
int /* Biff: 1 */
gageStackBlurParmCompare(const gageStackBlurParm *aa, const char *_nameA,
const gageStackBlurParm *bb, const char *_nameB, int *differ,
- char explain[AIR_STRLEN_LARGE]) {
+ char explain[AIR_STRLEN_LARGE + 1]) {
static const char me[] = "gageStackBlurParmCompare", baseA[] = "A", baseB[] = "B";
const char *nameA, *nameB;
unsigned int si, warnLen = AIR_STRLEN_LARGE / 4;
- char stmp[2][AIR_STRLEN_LARGE], subexplain[AIR_STRLEN_LARGE];
+ char stmp[2][AIR_STRLEN_LARGE + 1], subexplain[AIR_STRLEN_LARGE + 1];
if (!(aa && bb && differ)) {
biffAddf(GAGE, "%s: got NULL pointer (%p %p %p)", me, AIR_CVOIDP(aa), AIR_CVOIDP(bb),
@@ -230,7 +230,7 @@
gageStackBlurParmCopy(gageStackBlurParm *dst, const gageStackBlurParm *src) {
static const char me[] = "gageStackBlurParmCopy";
int differ;
- char explain[AIR_STRLEN_LARGE];
+ char explain[AIR_STRLEN_LARGE + 1];
if (!(dst && src)) {
biffAddf(GAGE, "%s: got NULL pointer", me);
@@ -662,7 +662,7 @@
}
if (parmS) {
unsigned int parmIdx;
- char *pval, xeq[AIR_STRLEN_SMALL];
+ char *pval, xeq[AIR_STRLEN_SMALL + 1];
parmNum = airStrntok(parmS, "/");
for (parmIdx = 0; parmIdx < parmNum; parmIdx++) {
if (!parmIdx) {
@@ -801,12 +801,12 @@
}
int /* Biff: 1 */
-gageStackBlurParmSprint(char str[AIR_STRLEN_LARGE],
+gageStackBlurParmSprint(char str[AIR_STRLEN_LARGE + 1],
const gageStackBlurParm *sbp,
int extraFlag[256],
char *extraParm) {
static const char me[] = "gageStackBlurParmSprint";
- char *out, stmp[AIR_STRLEN_LARGE];
+ char *out, stmp[AIR_STRLEN_LARGE + 1];
int needFlags, hef;
unsigned int fi;
@@ -891,7 +891,7 @@
}
static int
-_gageHestStackBlurParmParse(void *ptr, const char *str, char err[AIR_STRLEN_HUGE]) {
+_gageHestStackBlurParmParse(void *ptr, const char *str, char err[AIR_STRLEN_HUGE + 1]) {
gageStackBlurParm **sbp;
static const char me[] = "_gageHestStackBlurParmParse";
char *nerr;
@@ -912,7 +912,7 @@
/* NOTE: no way to retrieve extraFlags or extraParms from hest */
if (gageStackBlurParmParse(*sbp, NULL, NULL, str)) {
nerr = biffGetDone(GAGE);
- airStrcpy(err, AIR_STRLEN_HUGE, nerr);
+ airStrcpy(err, AIR_STRLEN_HUGE + 1, nerr);
gageStackBlurParmNix(*sbp);
free(nerr);
return 1;
@@ -959,7 +959,7 @@
/* clang-format off */
static const char
-_blurKey[KVP_NUM][AIR_STRLEN_LARGE] = {/* 0 */ "gageStackBlur",
+_blurKey[KVP_NUM][AIR_STRLEN_LARGE+1] = {/* 0 */ "gageStackBlur",
/* 1 */ "cksum",
/* 2 */ "scale",
/* 3 */ "kernel",
@@ -974,7 +974,7 @@
/* clang-format on */
typedef struct {
- char val[KVP_NUM][AIR_STRLEN_LARGE];
+ char val[KVP_NUM][AIR_STRLEN_LARGE + 1];
} blurVal_t;
static blurVal_t * /* Biff: NULL */
@@ -1176,7 +1176,7 @@
}
/*
if (0) {
- char fname[AIR_STRLEN_SMALL];
+ char fname[AIR_STRLEN_SMALL+1];
sprintf(fname, "noutFT-%03u.nrrd", blIdx);
nrrdSave(fname, noutFT, NULL);
sprintf(fname, "noutCd-%03u.nrrd", blIdx);
@@ -1429,7 +1429,7 @@
}
} else {
if (sbp->verbose) {
- char kstr[AIR_STRLEN_LARGE], bstr[AIR_STRLEN_LARGE];
+ char kstr[AIR_STRLEN_LARGE + 1], bstr[AIR_STRLEN_LARGE + 1];
nrrdKernelSpecSprint(kstr, kssb);
nrrdBoundarySpecSprint(bstr, sbp->bspec);
fprintf(stderr,
@@ -1629,7 +1629,7 @@
int firstExists;
FILE *file;
/* do have info about files to load, but may fail in many ways */
- fname = AIR_CALLOC(strlen(format) + AIR_STRLEN_SMALL, char);
+ fname = AIR_CALLOC(strlen(format) + AIR_STRLEN_SMALL + 1, char);
if (!fname) {
biffAddf(GAGE, "%s: couldn't allocate fname", me);
airMopError(mop);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|