|
From: <kin...@us...> - 2023-07-12 12:13:00
|
Revision: 7079
http://sourceforge.net/p/teem/code/7079
Author: kindlmann
Date: 2023-07-12 12:12:58 +0000 (Wed, 12 Jul 2023)
Log Message:
-----------
tweaks to comments
Modified Paths:
--------------
teem/trunk/src/hest/adders.c
Modified: teem/trunk/src/hest/adders.c
===================================================================
--- teem/trunk/src/hest/adders.c 2023-07-11 23:58:18 UTC (rev 7078)
+++ teem/trunk/src/hest/adders.c 2023-07-12 12:12:58 UTC (rev 7079)
@@ -32,7 +32,7 @@
concatenation, and ended up passing total garbage to hestOptAdd for
the airEnum pointer, causing him to think that the tenGlyphType airEnum
was malformed, when it was in fact fine ...
-This motivated the r7026 2023-07-06 addition of hestOptAdd_nva, which
+This motivated the r7026 2023-07-06 addition of non-var-args hestOptAdd_nva, which
would have caught the above error.
The underlying issue there, though, is the total lack of type-checking associated with
@@ -45,17 +45,17 @@
generated here for completeness (an option for 4 floats or 4 doubles is great for
R,G,B,A values).
-However with airTypeOther, when the caller passes a hestCB struct of callbacks to parse
-arbitrary things from the command-line, there is still unfortunately a type-checking
-black hole void* involved. And, there is no away around that: either valueP is an array
-of structs (when hestCB->destroy is NULL) or an array of pointers to structs
-(hestCB->destroy is non-NULL), for which the most specific type for valueP would be
-either void* or void**, respectively. But void** is not a generic pointer to pointer type
-(like void* is the generic pointer type), and, we're not doing compile-time checks on the
-non-NULL-ity of hestCB->destroy. So it all devolves back to plain void*. Still, the
-hestOptAdd_*_Other function are generated here to slightly simplify the hestOptAdd call,
-since there is no more NULL and NULL for sawP and enum. Actually, there is a way around
-a type-checking black hole: extreme attentiveness!
+However for airTypeOther (i.e. when the caller passes a hestCB struct of callbacks to
+parse arbitrary things from the command-line) there is still unfortunately a
+type-checking black hole void* involved. And, there is no away around that: either
+valueP is an array of structs (when hestCB->destroy is NULL) or an array of pointers to
+structs (hestCB->destroy is non-NULL), for which the most specific type for valueP would
+be either void* or void**, respectively. But void** is not a generic pointer to pointer
+type (like void* is the generic pointer type), and, we're not doing compile-time checks
+on the non-NULL-ity of hestCB->destroy. So it all devolves back to plain void*. Still,
+the hestOptAdd_*_Other function are generated here to slightly simplify the hestOptAdd
+call, since there is no more NULL and NULL for sawP and enum. Actually, there is a way
+around a type-checking black hole: extreme attentiveness!
*/
/* --------------------------------------------------------------- 1 == kind */
@@ -283,7 +283,7 @@
MAC(M, String, char *)
/* MAP(BSN, X, M) takes a macro basename BSN (like DEF) and
-expands it to the _T, _E, and _O cases for _X. E.g. "MAP(DEF, 1, 0)" expands to:
+expands it to the _T_, _E_, and _O_ cases for _X. E.g. "MAP(DEF, 1, 0)" expands to:
MAP_T(DEF_T_1, 0)
DEF_E_1(0)
DEF_O_1(0)
@@ -290,8 +290,8 @@
*/
#define MAP(BSN, X, M) MAP_T(CONC3(BSN, T, X), M) CONC3(BSN, E, X)(M) CONC3(BSN, O, X)(M)
-/* DOIT does expansion over all possibilities of BSN */
-#define DOIT(BSN) \
+/* This does expansion over all possibilities of BSN */
+#define LETS_GET_THIS_PARTY_STARTED(BSN) \
MAP(BSN, 1, 0) \
MAP(BSN, 1, 1) \
MAP(BSN, M, 2) \
@@ -301,7 +301,7 @@
MAP(BSN, V, _)
/* !!! HERE IS THE ACTUAL CODE FOR ALL THE hestOptAdd_*_* CASES !!! */
-DOIT(DEF)
+LETS_GET_THIS_PARTY_STARTED(DEF)
/* Macro for making a string out of whatever something has been #define'd to
https://gcc.gnu.org/onlinedocs/cpp/Stringizing.html */
@@ -327,7 +327,7 @@
#define PRINT_E_V(_) fprintf(ff, "HEST_EXPORT " _STR(DCL_E_V(_)) ";\n");
#define PRINT_O_V(_) fprintf(ff, "HEST_EXPORT " _STR(DCL_O_V(_)) ";\n");
-/* prints declarations for everything defined by macro magic above */
+/* prints declarations (for hest.h) for everything defined by macros above */
void
hestOptAddDeclsPrint(FILE *ff) {
/* the flag is the one case not handled by macro expansion */
@@ -334,5 +334,5 @@
fprintf(ff, "HEST_EXPORT unsigned int hestOptAdd_Flag(hestOpt **optP, "
"const char *flag, int *valueP, const char *info);\n");
/* declarations for all other cases */
- DOIT(PRINT)
+ LETS_GET_THIS_PARTY_STARTED(PRINT)
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|