|
From: <kin...@us...> - 2024-07-17 17:55:37
|
Revision: 7218
http://sourceforge.net/p/teem/code/7218
Author: kindlmann
Date: 2024-07-17 17:55:33 +0000 (Wed, 17 Jul 2024)
Log Message:
-----------
fixing uses of AIR_STRLEN_x plus clang-format
Modified Paths:
--------------
teem/trunk/Testing/ten/glyphBqd.c
Modified: teem/trunk/Testing/ten/glyphBqd.c
===================================================================
--- teem/trunk/Testing/ten/glyphBqd.c 2024-07-17 17:54:47 UTC (rev 7217)
+++ teem/trunk/Testing/ten/glyphBqd.c 2024-07-17 17:55:33 UTC (rev 7218)
@@ -36,7 +36,7 @@
double *abc;
unsigned int sz, ui, vi, bi, betaMaxNum;
double uv[2], betaMax[2] = {2.5555555555, 3.888888888888};
- char *err, *refname, explain[AIR_STRLEN_LARGE];
+ char *err, *refname, explain[AIR_STRLEN_LARGE + 1];
int differ, ret;
mop = airMopNew();
@@ -43,23 +43,22 @@
nabc = nrrdNew();
airMopAdd(mop, nabc, (airMopper)nrrdNuke, airMopAlways);
sz = 100;
- betaMaxNum = AIR_CAST(unsigned int, sizeof(betaMax)/sizeof(double));
- if (nrrdMaybeAlloc_va(nabc, nrrdTypeDouble, 3,
- AIR_CAST(size_t, 3),
- AIR_CAST(size_t, sz),
- AIR_CAST(size_t, sz*betaMaxNum))) {
+ betaMaxNum = AIR_CAST(unsigned int, sizeof(betaMax) / sizeof(double));
+ if (nrrdMaybeAlloc_va(nabc, nrrdTypeDouble, 3, AIR_CAST(size_t, 3),
+ AIR_CAST(size_t, sz), AIR_CAST(size_t, sz * betaMaxNum))) {
airMopAdd(mop, err = biffGetDone(NRRD), airFree, airMopAlways);
fprintf(stderr, "trouble allocating:\n%s", err);
- airMopError(mop); return 1;
+ airMopError(mop);
+ return 1;
}
abc = AIR_CAST(double *, nabc->data);
- for (bi=0; bi<betaMaxNum; bi++) {
- for (vi=0; vi<sz; vi++) {
+ for (bi = 0; bi < betaMaxNum; bi++) {
+ for (vi = 0; vi < sz; vi++) {
uv[1] = NRRD_CELL_POS(0.0, 1.0, sz, vi);
- for (ui=0; ui<sz; ui++) {
+ for (ui = 0; ui < sz; ui++) {
uv[0] = NRRD_CELL_POS(0.0, 1.0, sz, ui);
- tenGlyphBqdAbcUv(abc + 3*(ui + sz*(vi + sz*bi)), uv, betaMax[bi]);
+ tenGlyphBqdAbcUv(abc + 3 * (ui + sz * (vi + sz * bi)), uv, betaMax[bi]);
}
}
}
@@ -69,11 +68,12 @@
nref = nrrdNew();
airMopAdd(mop, nref, (airMopper)nrrdNuke, airMopAlways);
if (nrrdLoad(nref, refname, NULL)
- || nrrdCompare(nref, nabc, AIR_FALSE /* onlyData */,
- 5e-15 /* epsilon */, &differ, explain)) {
+ || nrrdCompare(nref, nabc, AIR_FALSE /* onlyData */, 5e-15 /* epsilon */, &differ,
+ explain)) {
airMopAdd(mop, err = biffGetDone(NRRD), airFree, airMopAlways);
fprintf(stderr, "trouble loading or comparing with ref:\n%s", err);
- airMopError(mop); return 1;
+ airMopError(mop);
+ return 1;
}
if (differ) {
@@ -83,8 +83,7 @@
airMopAdd(mop, err = biffGetDone(NRRD), airFree, airMopAlways);
fprintf(stderr, "oops, can't save generated array:\n%s", err);
} else {
- printf("%s: saved generated (and different) array as %s\n",
- argv[0], argv[1]);
+ printf("%s: saved generated (and different) array as %s\n", argv[0], argv[1]);
}
}
ret = 1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|