diff --git a/func.c b/func.c index 9c3db66..64e5e44 100644 --- a/func.c +++ b/func.c @@ -161,11 +161,16 @@ STATIC HALF _nineval_[] = { 9 }; STATIC HALF _twentyfourval_[] = { 24 }; STATIC HALF _threesixtyval_[] = { 360 }; STATIC HALF _fourhundredval_[] = { 400 }; -STATIC NUMBER _qtendivnine_ = { { _tenval_, 1, 0 }, { _nineval_, 1, 0 }, 1, NULL }; -STATIC NUMBER _qninedivten_ = { { _nineval_, 1, 0 }, { _tenval_, 1, 0 }, 1, NULL }; -STATIC NUMBER _qtwentyfour = { { _twentyfourval_, 1, 0 }, { _oneval_, 1, 0 }, 1, NULL }; -STATIC NUMBER _qthreesixty = { { _threesixtyval_, 1, 0 }, { _oneval_, 1, 0 }, 1, NULL }; -STATIC NUMBER _qfourhundred = { { _fourhundredval_, 1, 0 }, { _oneval_, 1, 0 }, 1, NULL }; +STATIC NUMBER _qtendivnine_ = { { _tenval_, 1, 0 }, + { _nineval_, 1, 0 }, 1, NULL }; +STATIC NUMBER _qninedivten_ = { { _nineval_, 1, 0 }, + { _tenval_, 1, 0 }, 1, NULL }; +STATIC NUMBER _qtwentyfour = { { _twentyfourval_, 1, 0 }, + { _oneval_, 1, 0 }, 1, NULL }; +STATIC NUMBER _qthreesixty = { { _threesixtyval_, 1, 0 }, + { _oneval_, 1, 0 }, 1, NULL }; +STATIC NUMBER _qfourhundred = { { _fourhundredval_, 1, 0 }, + { _oneval_, 1, 0 }, 1, NULL }; /* diff --git a/str.c b/str.c index 9d25028..8b3bb81 100644 --- a/str.c +++ b/str.c @@ -43,7 +43,7 @@ #define STR_TABLECHUNK 100 /* how often to reallocate string table */ #define STR_CHUNK (1<<11) /* size of string storage allocation */ -#define OCTET_VALUES 256 /* number of different values an OCTET can have */ +#define OCTET_VALUES 256 /* number of different values in a OCTET */ #define STR_UNIQUE (1<<7) /* size of string to allocate separately */ STRING _nullstring_ = {"", 0, 1, NULL}; @@ -285,8 +285,8 @@ addliteral(char *str) count = literals.l_maxcount + STR_TABLECHUNK; if (literals.l_maxcount) { /* alloc + 1 guard paranoia */ - table = (char **) realloc(literals.l_table, (count + 1) * - sizeof(char *)); + table = (char **) realloc(literals.l_table, + (count + 1) * sizeof(char *)); table[count] = NULL; /* guard paranoia */ } else { /* alloc + 1 guard paranoia */ @@ -1130,7 +1130,8 @@ stralloc(void) math_error("Unable to allocate memory for stralloc"); /*NOTREACHED*/ } - memset(freeStr+STRALLOC, 0, sizeof(STRING)); /* guard paranoia */ + /* guard paranoia */ + memset(freeStr+STRALLOC, 0, sizeof(STRING)); freeStr[STRALLOC - 1].s_next = NULL; freeStr[STRALLOC - 1].s_links = 0; @@ -1153,12 +1154,14 @@ stralloc(void) blockcount++; if (firstStrs == NULL) { /* alloc + 1 guard paranoia */ - newfn = (STRING **) malloc((blockcount + 1) * sizeof(STRING *)); + newfn = (STRING **) + malloc((blockcount + 1) * sizeof(STRING *)); newfn[blockcount] = NULL; /* guard paranoia */ } else { /* alloc + 1 guard paranoia */ newfn = (STRING **) - realloc(firstStrs, (blockcount + 1) * sizeof(STRING *)); + realloc(firstStrs, + (blockcount + 1) * sizeof(STRING *)); newfn[blockcount] = NULL; /* guard paranoia */ } if (newfn == NULL) { @@ -1299,7 +1302,8 @@ void initstrings(void) { /* alloc + 1 guard paranoia */ - stringconsttable = (STRING **) malloc(sizeof(STRING *) * (STRCONSTALLOC + 1)); + stringconsttable = (STRING **) + malloc(sizeof(STRING *) * (STRCONSTALLOC + 1)); if (stringconsttable == NULL) { math_error("Unable to allocate constant table"); /*NOTREACHED*/ @@ -1332,14 +1336,17 @@ addstring(char *str, size_t len) initstrings(); } else { /* alloc + 1 guard paranoia */ - sp = (STRING **) realloc((char *) stringconsttable, - sizeof(STRING *) * (stringconstcount + STRCONSTALLOC + 1)); + sp = (STRING **) + realloc((char *) stringconsttable, + sizeof(STRING *) * + (stringconstcount + STRCONSTALLOC + 1)); if (sp == NULL) { math_error("Unable to reallocate string " "const table"); /*NOTREACHED*/ } - sp[stringconstcount + STRCONSTALLOC] = NULL; /* guard paranoia */ + /* guard paranoia */ + sp[stringconstcount + STRCONSTALLOC] = NULL; stringconsttable = sp; stringconstavail = STRCONSTALLOC; } diff --git a/symbol.c b/symbol.c index 8508ab8..211bdfb 100644 --- a/symbol.c +++ b/symbol.c @@ -110,7 +110,8 @@ addglobal(char *name, BOOL isstatic) return NULL; hp = &globalhash[HASHSYM(name, len)]; for (sp = *hp; sp; sp = sp->g_next) { - if ((sp->g_len == len) && (strncmp(sp->g_name, name, len+1) == 0) + if ((sp->g_len == len) && + (strncmp(sp->g_name, name, len+1) == 0) && (sp->g_filescope == newfilescope) && (sp->g_funcscope == newfuncscope)) return sp; @@ -146,7 +147,8 @@ findglobal(char *name) bestsp = NULL; len = strlen(name); for (sp = globalhash[HASHSYM(name, len)]; sp != NULL; sp = sp->g_next) { - if ((sp->g_len == len) && (strncmp(sp->g_name, name, len+1) == 0)) { + if ((sp->g_len == len) && + (strncmp(sp->g_name, name, len+1) == 0)) { if ((bestsp == NULL) || (sp->g_filescope > bestsp->g_filescope) || (sp->g_funcscope > bestsp->g_funcscope)) diff --git a/zmath.h b/zmath.h index 9ce205c..eab734d 100644 --- a/zmath.h +++ b/zmath.h @@ -579,7 +579,12 @@ E_FUNC void zredcpower(REDC *rp, ZVALUE z1, ZVALUE z2, ZVALUE *res); #define zcopyval(z1,z2) memcpy((z2).v, (z1).v, (z1).len * sizeof(HALF)) #define zquicktrim(z) {if (((z).len > 1) && ((z).v[(z).len-1] == 0)) \ (z).len--;} -#define zfree(z) {if ((z).len != 0 && (z).v != NULL) { freeh((z).v); (z).v = NULL; (z).len = 0; (z).sign = 0; } } +#define zfree(z) {if ((z).len != 0 && (z).v != NULL) { \ + freeh((z).v); \ + (z).v = NULL; \ + (z).len = 0; \ + (z).sign = 0; } \ + } /*