void
sc_closesrc(void *handle)
{
- assert(!!handle);
+ assert(handle != NULL);
fclose((FILE *) handle);
}
void
sc_resetsrc(void *handle, void *position)
{
- assert(!!handle);
+ assert(handle != NULL);
fsetpos((FILE *) handle, (fpos_t *) position);
}
/* write the binary file (the file is already open) */
if (errnum == 0 && jmpcode == 0)
{
- assert(!!binf);
+ assert(binf != NULL);
sc_resetasm(outf); /* flush and loop back, for reading */
assemble(binf, outf); /* assembler file is now input */
} /* if */
free(litq);
phopt_cleanup();
stgbuffer_cleanup();
- assert(jmpcode != 0 || !loctab.next); /* on normal flow,
+ assert(jmpcode != 0 || loctab.next == NULL); /* on normal flow,
* local symbols
* should already have been deleted */
delete_symbols(&loctab, 0, TRUE, TRUE); /* delete local variables
case tSTATIC:
/* This can be a static function or a static global variable;
* we know which of the two as soon as we have parsed up to the
- * point where an opening paranthesis of a function would be
+ * point where an opening parenthesis of a function would be
* expected. To back out after deciding it was a declaration of
* a static variable after all, we have to store the symbol name
* and tag.
char *str;
cell val;
- assert(!!name);
+ assert(name != NULL);
/* check the operator */
opertok = lex(&val, &str);
static int
check_operatortag(int opertok, int resulttag, char *opername)
{
- assert(!!opername && opername[0] != '\0');
+ assert(opername != NULL && opername[0] != '\0');
switch (opertok)
{
case '!':
unary = parse_funcname(funcname, &tags[0], &tags[1], opname);
tagsym[1] = find_constval_byval(&tagname_tab, tags[1]);
- assert(!!tagsym[1]);
+ assert(tagsym[1] != NULL);
if (unary)
{
sprintf(dest, "operator%s(%s:)", opname, tagsym[1]->name);
* and labels */
delete_symbols(&loctab, 0, TRUE, TRUE); /* clear local variables
* queue */
- assert(!loctab.next);
+ assert(loctab.next == NULL);
curfunc = NULL;
if (sc_status == statSKIP)
{
needtoken(')');
} /* if */
/* resolve any "sizeof" arguments (now that all arguments are known) */
- assert(!!sym->dim.arglist);
+ assert(sym->dim.arglist != NULL);
arglist = sym->dim.arglist;
for (idx = 0; idx < argcnt && arglist[idx].ident != 0; idx++)
{
arg->hasdefault = TRUE; /* argument has default value */
arg->defvalue.array.size = litidx;
arg->defvalue.array.addr = -1;
- /* calulate size to reserve on the heap */
+ /* calculate size to reserve on the heap */
arg->defvalue.array.arraysize = 1;
for (i = 0; i < arg->numdim; i++)
arg->defvalue.array.arraysize *= arg->dim[i];
{
if (ref->parent)
continue; /* hierarchical data type */
- assert(!!ref->refer);
+ assert(ref->refer != NULL);
for (i = 0; i < ref->numrefers && ref->refer[i] != sym;
i++)
/* nothing */ ;
{
cell length;
- assert(!!sym);
+ assert(sym != NULL);
assert(sym->ident == iARRAY || sym->ident == iREFARRAY);
length = sym->dim.array.length;
if (sym->dim.array.level > 0)
operator_symname(symbolname, "~", sym->tag, 0, 1, 0);
if ((opsym = findglb(symbolname)))
{
- /* save PRI, in case of a return statment */
+ /* save PRI, in case of a return statement */
if (!savepri)
{
push1(); /* right-hand operand is in PRI */
* "continue" must ignore these fields.
*/
ptr = readwhile();
- assert(!!ptr);
+ assert(ptr != NULL);
ptr[wqBRK] = (int)declared;
ptr[wqCONT] = (int)declared;
jumplabel(skiplab); /* skip expression 3 1st time */
while (tok != '}');
#if !defined NDEBUG
- /* verify that the case table is sorted (unfortunatly, duplicates can
+ /* verify that the case table is sorted (unfortunately, duplicates can
* occur; there really shouldn't be duplicate cases, but the compiler
* may not crash or drop into an assertion for a user error). */
for (cse = caselist.next; cse && cse->next; cse = cse->next)
needtoken(tTERM);
rettype |= uRETVALUE; /* function returns a value */
/* check tagname with function tagname */
- assert(!!curfunc);
+ assert(curfunc != NULL);
if (!matchtag(curfunc->tag, tag, TRUE))
error(213); /* tagname mismatch */
}
{
char symname[2 * sNAMEMAX + 16]; /* allow space for user
* defined operators */
- assert(!!curfunc);
+ assert(curfunc != NULL);
funcdisplayname(symname, curfunc->name);
error(209, symname); /* function should return a value */
} /* if */