*/
assert(strlen(pline) < sLINEMAX);
term = strchr(pline, '\0');
- assert(term != NULL);
+ assert(!!term);
chrcat(pline, PREPROC_TERM); /* the "DEL" code (see SC.H) */
result = constexpr(val, tag); /* get value (or 0 on error) */
*term = '\0'; /* erase the token (if still present) */
static char *
getstring(char *dest, int max, char *line)
{
- assert(dest != NULL && line != NULL);
+ assert(!!dest && !!line);
*dest = '\0';
while (*line <= ' ' && *line != '\0')
line++; /* skip whitespace */
if (skiplevel == 0)
{
check_empty(lptr);
- assert(inpf != NULL);
+ assert(!!inpf);
if (inpf != inpf_org)
sc_closesrc(inpf);
inpf = NULL;
if (clreol)
{
lptr = strchr(pline, '\0');
- assert(lptr != NULL);
+ assert(!!lptr);
} /* if */
}
/* free all sub-symbol allocated memory blocks, depending on the
* kind of the symbol
*/
- assert(sym != NULL);
+ assert(!!sym);
if (sym->ident == iFUNCTN)
{
/* run through the argument list; "default array" arguments
* must be freed explicitly; the tag list must also be freed */
- assert(sym->dim.arglist != NULL);
+ assert(!!sym->dim.arglist);
for (arg = sym->dim.arglist; arg->ident != 0; arg++)
{
if (arg->ident == iREFARRAY && arg->hasdefault)
&& ((arg->hasdefault & uSIZEOF) != 0
|| (arg->hasdefault & uTAGOF) != 0))
free(arg->defvalue.size.symname);
- assert(arg->tags != NULL);
+ assert(!!arg->tags);
free(arg->tags);
} /* for */
free(sym->dim.arglist);
} /* if */
- assert(sym->refer != NULL);
+ assert(!!sym->refer);
free(sym->refer);
free(sym);
}
while (root->next != sym)
{
root = root->next;
- assert(root != NULL);
+ assert(!!root);
} /* while */
/* unlink it, then free it */
{
int count;
- assert(bywhom != NULL); /* it makes no sense to add a "void" referrer */
- assert(entry != NULL);
- assert(entry->refer != NULL);
+ assert(!!bywhom); /* it makes no sense to add a "void" referrer */
+ assert(!!entry);
+ assert(!!entry->refer);
/* see if it is already there */
for (count = 0; count < entry->numrefers && entry->refer[count] != bywhom;
} /* if */
/* add the referrer */
- assert(entry->refer[count] == NULL);
+ assert(!entry->refer[count]);
entry->refer[count] = bywhom;
return TRUE;
}
sym = find_symbol(&glbtab, name, fcurrent);
if (!sym || sym->ident != iCONSTEXPR)
return NULL;
- assert(sym->parent == NULL); /* constants have no hierarchy */
+ assert(!sym->parent); /* constants have no hierarchy */
return sym;
}
/* global variables/constants/functions may only be defined once */
assert(!(ident == iFUNCTN || ident == iCONSTEXPR) || vclass != sGLOBAL
- || findglb(name) == NULL);
+ || !findglb(name));
/* labels may only be defined once */
- assert(ident != iLABEL || findloc(name) == NULL);
+ assert(ident != iLABEL || !findloc(name));
/* create an empty referrer list */
if (!(refer = (symbol **)malloc(sizeof(symbol *))))
int level;
/* global variables may only be defined once */
- assert(vclass != sGLOBAL || (sym = findglb(name)) == NULL
+ assert(vclass != sGLOBAL || !(sym = findglb(name))
|| (sym->usage & uDEFINE) == 0);
if (ident == iARRAY || ident == iREFARRAY)