|
From: <kin...@us...> - 2024-07-17 18:04:01
|
Revision: 7220
http://sourceforge.net/p/teem/code/7220
Author: kindlmann
Date: 2024-07-17 18:03:54 +0000 (Wed, 17 Jul 2024)
Log Message:
-----------
fixing uses of AIR_STRLEN_x plus clang-format
Modified Paths:
--------------
teem/trunk/src/bin/CMakeLists.txt
teem/trunk/src/bin/airSanity.c
teem/trunk/src/bin/gprobe.c
teem/trunk/src/bin/ilk.c
teem/trunk/src/bin/miter.c
teem/trunk/src/bin/nrrdSanity.c
teem/trunk/src/bin/pprobe.c
teem/trunk/src/bin/puller-with-Deft.c
teem/trunk/src/bin/qbert.c
teem/trunk/src/bin/talkweb.c
teem/trunk/src/bin/tend.c
teem/trunk/src/bin/unu.c
teem/trunk/src/bin/vprobe.c
Modified: teem/trunk/src/bin/CMakeLists.txt
===================================================================
--- teem/trunk/src/bin/CMakeLists.txt 2024-07-17 17:58:04 UTC (rev 7219)
+++ teem/trunk/src/bin/CMakeLists.txt 2024-07-17 18:03:54 UTC (rev 7220)
@@ -43,24 +43,27 @@
CREATE_EXEC(puller puller.c)
CREATE_EXEC(tend tend.c)
-# For Teem v2 many of these were removed from compilation: they have no compelling
-# general purpose, for reasons indicated with further comments. No reason
-# to delete the sources though.
-# NOTE: The BUILD_EXPERIMENTAL_LIBS-dependent inclusion of binaries has to be
-# done with knowledge of how BUILD_EXPERIMENTAL_LIBS behaves in the top-level
-# CMakeLists.txt file
-if(BUILD_EXPERIMENTAL_APPS)
+### For Teem v2, these were removed from compilation: they have no compelling
+### general purpose, for reasons indicated with further comments. No reason
+### to delete the sources though; they can still be compiled by other means.
+##
+## NOTE: The BUILD_EXPERIMENTAL_LIBS-dependent inclusion of binaries has to be
+## done with knowledge of how BUILD_EXPERIMENTAL_LIBS behaves in the top-level
+## CMakeLists.txt file
+# if(BUILD_EXPERIMENTAL_APPS)
# CREATE_EXEC(airSanity airSanity.c) # tests included in nrrdSanity
# CREATE_EXEC(cubic cubic.c) # just calls ell_cubic; more easily done via Python wrappers
# CREATE_EXEC(qbert qbert.c) # created for volume rendering on GPUs from 20 years ago
# CREATE_EXEC(ilk ilk.c) # now part of unu: "unu ilk"
- CREATE_EXEC(emap emap.c) # (functionality not currently handled elsewhere)
+# CREATE_EXEC(emap emap.c) # functionality not currently handled elsewhere,
+# but nor is it is really needed for anything
# CREATE_EXEC(talkweb talkweb.c) # the web has changed in 20 years
# CREATE_EXEC(pprobe pprobe.c) # gprobe can do this
# CREATE_EXEC(ungantry ungantry.c) # gprobe can do this
- CREATE_EXEC(deconv deconv.c) # (functionality not currently handled elsewhere)
+# CREATE_EXEC(deconv deconv.c) # functionality not currently handled elsewhere,
+# but nor is it is really needed for anything
# if(BUILD_EXPERIMENTAL_LIBS)
# CREATE_EXEC(gkms gkms.c) # hasn't been tested in a long time
# CREATE_EXEC(spots spots.c) # hasn't been tested in a long time
# endif()
-endif()
+# endif()
Modified: teem/trunk/src/bin/airSanity.c
===================================================================
--- teem/trunk/src/bin/airSanity.c 2024-07-17 17:58:04 UTC (rev 7219)
+++ teem/trunk/src/bin/airSanity.c 2024-07-17 18:03:54 UTC (rev 7220)
@@ -30,7 +30,7 @@
me = argv[0];
aret = airSanity();
if (airInsane_not == aret) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
fprintf(stderr, "%s: air sanity check passed.\n", me);
fprintf(stderr, "\n");
fprintf(stderr, "airMyEndian() == %d\n", airMyEndian());
Modified: teem/trunk/src/bin/gprobe.c
===================================================================
--- teem/trunk/src/bin/gprobe.c 2024-07-17 17:58:04 UTC (rev 7219)
+++ teem/trunk/src/bin/gprobe.c 2024-07-17 18:03:54 UTC (rev 7220)
@@ -53,7 +53,7 @@
unsigned int ansLen, dim, aidx, baseDim, gridDim;
size_t sizeOut[NRRD_DIM_MAX], coordOut[NRRD_DIM_MAX], II, NN;
double (*ins)(void *v, size_t I, double d);
- char stmp[2][AIR_STRLEN_SMALL];
+ char stmp[2][AIR_STRLEN_SMALL + 1];
if (!(ctx && pvl && nout && _ngrid)) {
biffAddf(GAGE, "%s: got NULL pointer", me);
@@ -239,7 +239,7 @@
unsigned int ansLen, *skip, skipNum, pntPosNum, nonSbpOpi[NON_SBP_OPT_NUM], nsi;
gageStackBlurParm *sbpIN, *sbpCL, *sbp;
int otype, clamp, scaleIsTau;
- char stmp[4][AIR_STRLEN_SMALL];
+ char stmp[4][AIR_STRLEN_SMALL + 1];
me = argv[0];
/* parse environment variables first, in case they break nrrdDefault*
Modified: teem/trunk/src/bin/ilk.c
===================================================================
--- teem/trunk/src/bin/ilk.c 2024-07-17 17:58:04 UTC (rev 7219)
+++ teem/trunk/src/bin/ilk.c 2024-07-17 18:03:54 UTC (rev 7220)
@@ -144,7 +144,7 @@
ELL_2V_COPY(msp->verbPixel, debug);
if (nrrdBoundaryPad == bound) {
if (_bkgLen != MOSS_CHAN_NUM(nin)) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
fprintf(stderr, "%s: got length %u background, image has %s channels\n", me,
_bkgLen, airSprintSize_t(stmp, MOSS_CHAN_NUM(nin)));
airMopError(mop);
Modified: teem/trunk/src/bin/miter.c
===================================================================
--- teem/trunk/src/bin/miter.c 2024-07-17 17:58:04 UTC (rev 7219)
+++ teem/trunk/src/bin/miter.c 2024-07-17 18:03:54 UTC (rev 7220)
@@ -36,7 +36,7 @@
hestParm *hparm = NULL;
miteUser *muu;
const char *me;
- char *errS, *outS, *shadeStr, *normalStr, debugStr[AIR_STRLEN_MED];
+ char *errS, *outS, *shadeStr, *normalStr, debugStr[AIR_STRLEN_MED + 1];
int renorm, baseDim, verbPix[2], offfr;
int E, Ecode, Ethread;
float ads[3], isScale;
@@ -206,8 +206,8 @@
fprintf(stderr, " N = {%g,%g,%g}\n",
muu->hctx->cam->N[0], muu->hctx->cam->N[1], muu->hctx->cam->N[2]);
*/
- airStrcpy(muu->shadeStr, AIR_STRLEN_MED, shadeStr);
- airStrcpy(muu->normalStr, AIR_STRLEN_MED, normalStr);
+ airStrcpy(muu->shadeStr, AIR_STRLEN_MED + 1, shadeStr);
+ airStrcpy(muu->normalStr, AIR_STRLEN_MED + 1, normalStr);
if (0) {
muu->hctx->volSize[0] = nin->axis[baseDim + 0].size;
muu->hctx->volSize[1] = nin->axis[baseDim + 1].size;
Modified: teem/trunk/src/bin/nrrdSanity.c
===================================================================
--- teem/trunk/src/bin/nrrdSanity.c 2024-07-17 17:58:04 UTC (rev 7219)
+++ teem/trunk/src/bin/nrrdSanity.c 2024-07-17 18:03:54 UTC (rev 7220)
@@ -30,7 +30,7 @@
me = argv[0];
if (2 == argc) {
if (!strcmp(argv[1], "--version")) {
- char vbuff[AIR_STRLEN_LARGE];
+ char vbuff[AIR_STRLEN_LARGE + 1];
airTeemVersionSprint(vbuff);
printf("%s\n", vbuff);
exit(0);
Modified: teem/trunk/src/bin/pprobe.c
===================================================================
--- teem/trunk/src/bin/pprobe.c 2024-07-17 17:58:04 UTC (rev 7219)
+++ teem/trunk/src/bin/pprobe.c 2024-07-17 18:03:54 UTC (rev 7220)
@@ -230,7 +230,7 @@
return 1;
}
if (airStrlen(stackSavePath)) {
- char fnform[AIR_STRLEN_LARGE];
+ char fnform[AIR_STRLEN_LARGE + 1];
sprintf(fnform, "%s/blur-%%02u.nrrd", stackSavePath);
fprintf(stderr, "%s: |%s|\n", me, fnform);
if (nrrdSaveMulti(fnform, AIR_CAST(const Nrrd *const *, ninSS), numSS, 0, NULL)) {
Modified: teem/trunk/src/bin/puller-with-Deft.c
===================================================================
--- teem/trunk/src/bin/puller-with-Deft.c 2024-07-17 17:58:04 UTC (rev 7219)
+++ teem/trunk/src/bin/puller-with-Deft.c 2024-07-17 18:03:54 UTC (rev 7220)
@@ -1619,7 +1619,7 @@
nrrdSave(outS, nPosOut, NULL);
if (airStrlen(extraOutBaseS)) {
Nrrd *nstrn, *nstab, *nintern;
- char fname[3][AIR_STRLEN_MED];
+ char fname[3][AIR_STRLEN_MED + 1];
nstrn = nrrdNew();
nstab = nrrdNew();
nintern = nrrdNew();
Modified: teem/trunk/src/bin/qbert.c
===================================================================
--- teem/trunk/src/bin/qbert.c 2024-07-17 17:58:04 UTC (rev 7219)
+++ teem/trunk/src/bin/qbert.c 2024-07-17 18:03:54 UTC (rev 7220)
@@ -87,7 +87,7 @@
}
} else {
for (i = 0; i <= 2; i++) {
- char stmp[AIR_STRLEN_SMALL];
+ char stmp[AIR_STRLEN_SMALL + 1];
anyneed |= !!(need = AIR_INT(sz[i]) - AIR_INT(nin->axis[i].size));
fprintf(stderr, "%s: sz[%d] = %s -> need = %d --> ", me, i,
airSprintSize_t(stmp, nin->axis[i].size), need);
@@ -143,7 +143,7 @@
need = 0;
for (i = 0; i <= 2; i++) {
if (nin->axis[i].size > sz[i]) {
- char stmp1[AIR_STRLEN_SMALL], stmp2[AIR_STRLEN_SMALL];
+ char stmp1[AIR_STRLEN_SMALL + 1], stmp2[AIR_STRLEN_SMALL + 1];
need = 1;
rsi->kernel[i] = dk->kernel;
memcpy(rsi->parm[i], dk->parm, dk->kernel->numParm * sizeof(double));
@@ -196,7 +196,7 @@
qbertProbe(Nrrd *nout, Nrrd *nin, NrrdKernelSpec *k00, NrrdKernelSpec *k11,
NrrdKernelSpec *k22, int doH, unsigned int *sz) {
static const char me[] = "qbertProbe";
- char prog[AIR_STRLEN_SMALL];
+ char prog[AIR_STRLEN_SMALL + 1];
gageContext *ctx;
gagePerVolume *pvl;
const double *val, *gmag, *scnd;
@@ -390,7 +390,7 @@
qbertMakeVgh(Nrrd *nvgh, Nrrd *nvhist, Nrrd *nghist, Nrrd *nhhist, unsigned int *sz,
float *perc, Nrrd *nvghF) {
static const char me[] = "qbertMakeVgh";
- char cmt[AIR_STRLEN_SMALL];
+ char cmt[AIR_STRLEN_SMALL + 1];
double minv, maxv, ming, maxg, minh = 0, maxh = 0;
int lose, *vhist, *ghist, *hhist = NULL, vi, gi, hi, doH;
unsigned int i, nval, bins;
Modified: teem/trunk/src/bin/talkweb.c
===================================================================
--- teem/trunk/src/bin/talkweb.c 2024-07-17 17:58:04 UTC (rev 7219)
+++ teem/trunk/src/bin/talkweb.c 2024-07-17 18:03:54 UTC (rev 7220)
@@ -93,7 +93,7 @@
int
tkwbReadFileToString(char **strP, int *hitEOF, FILE *file, char *stop) {
- char **all, line[AIR_STRLEN_HUGE];
+ char **all, line[AIR_STRLEN_HUGE + 1];
airArray *allArr;
unsigned int allLen;
unsigned int lineLen, lineIdx, totalLen;
@@ -102,7 +102,7 @@
uu.pc = &all;
allArr = airArrayNew(uu.v, &allLen, sizeof(char *), tkwbArrayIncr);
airArrayPointerCB(allArr, airNull, airFree);
- lineLen = airOneLine(file, line, AIR_STRLEN_HUGE);
+ lineLen = airOneLine(file, line, AIR_STRLEN_HUGE + 1);
totalLen = 0;
while (lineLen && (!(airStrlen(stop) && !strcmp(line, stop)))) {
lineIdx = airArrayLenIncr(allArr, 1); /* HEY error checking */
@@ -109,7 +109,7 @@
all[lineIdx] = (char *)calloc(strlen(line) + strlen("\n") + 1, sizeof(char));
sprintf(all[lineIdx], "%s\n", line);
totalLen += strlen(line) + 1;
- lineLen = airOneLine(file, line, AIR_STRLEN_HUGE);
+ lineLen = airOneLine(file, line, AIR_STRLEN_HUGE + 1);
}
if (hitEOF) {
*hitEOF = !lineLen;
@@ -155,7 +155,7 @@
FILE *file;
airArray *mop, *slideArr;
tkwbSlide **slide = NULL;
- char *title, *image, *text, stop[AIR_STRLEN_HUGE], line[AIR_STRLEN_HUGE];
+ char *title, *image, *text, stop[AIR_STRLEN_HUGE + 1], line[AIR_STRLEN_HUGE + 1];
int slideIdx = 0, hitEOF, notReally;
unsigned int len;
_tkwbU uu;
@@ -168,7 +168,7 @@
}
airMopAdd(mop, file, (airMopper)airFclose, airMopAlways);
- len = airOneLine(file, stop, AIR_STRLEN_HUGE);
+ len = airOneLine(file, stop, AIR_STRLEN_HUGE + 1);
if (!(len > 1)) {
biffAddf(TKWB, "%s: didn't get a stop delimiter from %s", me, filename);
airMopError(mop);
@@ -181,7 +181,7 @@
hitEOF = notReally = AIR_FALSE;
while (!hitEOF) {
slideIdx = airArrayLenIncr(slideArr, 1); /* HEY error checking */
- len = airOneLine(file, line, AIR_STRLEN_HUGE);
+ len = airOneLine(file, line, AIR_STRLEN_HUGE + 1);
if (!len) {
/* got EOF after a division marker, that's okay */
notReally = AIR_TRUE;
@@ -188,7 +188,7 @@
break;
}
title = airStrdup(line);
- len = airOneLine(file, line, AIR_STRLEN_HUGE);
+ len = airOneLine(file, line, AIR_STRLEN_HUGE + 1);
if (!len) {
break;
}
@@ -322,7 +322,7 @@
int
tkwbWriteIndex(char *_indx, tkwbSlide **slide, char *tag[TKWB_TAG_MAX + 1]) {
static const char me[] = "tkwbWriteIndex";
- char *repl, *indx, tmp[AIR_STRLEN_MED];
+ char *repl, *indx, tmp[AIR_STRLEN_MED + 1];
int replLen, si;
airArray *mop;
@@ -366,8 +366,8 @@
tkwbWriteSlides(tkwbSlide **slide, int numSlides, char *tmpl,
char *tag[TKWB_TAG_MAX + 1], char *link[4]) {
static const char me[] = "tkwbWriteSlides";
- char *text, name[AIR_STRLEN_MED], frst[AIR_STRLEN_MED], prev[AIR_STRLEN_MED],
- next[AIR_STRLEN_MED], last[AIR_STRLEN_MED];
+ char *text, name[AIR_STRLEN_MED + 1], frst[AIR_STRLEN_MED + 1],
+ prev[AIR_STRLEN_MED + 1], next[AIR_STRLEN_MED + 1], last[AIR_STRLEN_MED + 1];
int si;
airArray *mop;
@@ -460,8 +460,8 @@
int
main(int argc, const char *argv[]) {
const char *me;
- char *err, *indxS, *tmplS, *scriptS, *pretag[TKWB_TAG_MAX + 1], *tag[AIR_STRLEN_MED],
- *frstLink, *prevLink, *nextLink, *lastLink, *link[4];
+ char *err, *indxS, *tmplS, *scriptS, *pretag[TKWB_TAG_MAX + 1],
+ *tag[AIR_STRLEN_MED + 1], *frstLink, *prevLink, *nextLink, *lastLink, *link[4];
hestOpt *hopt = NULL;
airArray *mop;
int ti;
Modified: teem/trunk/src/bin/tend.c
===================================================================
--- teem/trunk/src/bin/tend.c 2024-07-17 17:58:04 UTC (rev 7219)
+++ teem/trunk/src/bin/tend.c 2024-07-17 18:03:54 UTC (rev 7220)
@@ -65,7 +65,7 @@
}
/* else, we see if its --version */
if (!strcmp("--version", argv[1])) {
- char vbuff[AIR_STRLEN_LARGE];
+ char vbuff[AIR_STRLEN_LARGE + 1];
airTeemVersionSprint(vbuff);
printf("%s\n", vbuff);
exit(0);
Modified: teem/trunk/src/bin/unu.c
===================================================================
--- teem/trunk/src/bin/unu.c 2024-07-17 17:58:04 UTC (rev 7219)
+++ teem/trunk/src/bin/unu.c 2024-07-17 18:03:54 UTC (rev 7220)
@@ -84,7 +84,7 @@
}
/* else, we see if its unu --version */
if (!strcmp("--version", argv[1])) {
- char vbuff[AIR_STRLEN_LARGE];
+ char vbuff[AIR_STRLEN_LARGE + 1];
airTeemVersionSprint(vbuff);
printf("%s\n", vbuff);
exit(0);
Modified: teem/trunk/src/bin/vprobe.c
===================================================================
--- teem/trunk/src/bin/vprobe.c 2024-07-17 17:58:04 UTC (rev 7219)
+++ teem/trunk/src/bin/vprobe.c 2024-07-17 18:03:54 UTC (rev 7220)
@@ -61,7 +61,7 @@
char hackKeyStr[] = "TEEM_VPROBE_HACK_ZI", *hackValStr;
int otype, hackSet;
- char stmp[4][AIR_STRLEN_SMALL];
+ char stmp[4][AIR_STRLEN_SMALL + 1];
me = argv[0];
/* parse environment variables first, in case they break nrrdDefault*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|