warnings--
[framework/uifw/embryo.git] / src / bin / embryo_cc_sc1.c
index 7e0b6a2..d7e8659 100644 (file)
@@ -179,14 +179,14 @@ sc_opensrc(char *filename)
 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);
 }
 
@@ -427,7 +427,7 @@ sc_compile(int argc, char *argv[])
    /* 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 */
@@ -442,7 +442,7 @@ sc_compile(int argc, char *argv[])
       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
@@ -828,7 +828,7 @@ parse(void)
          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.
@@ -1784,7 +1784,7 @@ operatorname(char *name)
    char               *str;
    cell                val;
 
-   assert(!!name);
+   assert(name != NULL);
 
    /* check the operator */
    opertok = lex(&val, &str);
@@ -1937,7 +1937,7 @@ operatoradjust(int opertok, symbol * sym, char *opername, int resulttag)
 static int
 check_operatortag(int opertok, int resulttag, char *opername)
 {
-   assert(!!opername && opername[0] != '\0');
+   assert(opername != NULL && opername[0] != '\0');
    switch (opertok)
      {
      case '!':
@@ -2043,7 +2043,7 @@ funcdisplayname(char *dest, char *funcname)
 
    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);
@@ -2343,7 +2343,7 @@ newfunc(char *firstname, int firsttag, int fpublic, int fstatic, int stock)
                                         * 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)
      {
@@ -2587,7 +2587,7 @@ declargs(symbol * sym)
        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++)
      {
@@ -2705,7 +2705,7 @@ doarg(char *name, int ident, int offset, int tags[], int numtags,
                  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];
@@ -2845,7 +2845,7 @@ reduce_referrers(symbol * root)
                    {
                       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 */ ;
@@ -2948,7 +2948,7 @@ calc_array_datasize(symbol * sym, cell * offset)
 {
    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)
@@ -2989,7 +2989,7 @@ destructsymbols(symbol * root, int level)
             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 */
@@ -3606,7 +3606,7 @@ dofor(void)
     * "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 */
@@ -3797,7 +3797,7 @@ doswitch(void)
    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)
@@ -3951,7 +3951,7 @@ doreturn(void)
        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 */
      }
@@ -3963,7 +3963,7 @@ doreturn(void)
          {
             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 */