]> andersk Git - splint.git/blobdiff - src/checking.c
Fixed all /*@i...@*/ tags (except 1).
[splint.git] / src / checking.c
index cdc1e5d89716cbf9ee5825d2bfebcd7f93f8637c..c574aeef7a6aa27ec94a416b495d957ead3121dd 100644 (file)
@@ -1,6 +1,6 @@
 /*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
+** Splint - annotation-assisted static program checker
+** Copyright (C) 1994-2003 University of Virginia,
 **         Massachusetts Institute of Technology
 **
 ** This program is free software; you can redistribute it and/or modify it
@@ -17,9 +17,9 @@
 ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 ** MA 02111-1307, USA.
 **
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.cs.virginia.edu
+** For information on splint: info@splint.org
+** To report a bug: splint-bug@splint.org
+** For more information: http://www.splint.org
 */
 /* 
 ** checking.c
@@ -31,8 +31,8 @@
 **         Massachusetts Institute of Technology
 */
 
-# include "lclintMacros.nf"
-# include "llbasic.h"
+# include "splintMacros.nf"
+# include "basic.h"
 # include "llgrammar.h"
 # include "checking.h"
 # include "lclscan.h"
@@ -41,7 +41,7 @@
 
 static /*@only@*/ cstring printBadArgs (sortSetList p_args);
 static /*@only@*/ sortSet 
-  standardOperators (/*@null@*/ nameNode p_n, sortSetList p_argSorts, sort p_qual);
+  standardOperators (/*@null@*/ nameNode p_n, sortSetList p_argSorts, sort p_q);
 static bool isStandardOperator (/*@null@*/ nameNode p_n);
 static void assignSorts (termNode p_t, sort p_s);
 
@@ -120,7 +120,7 @@ computePossibleSorts (/*@returned@*/ /*@null@*/ termNode t)
                unsigned int arity = termNodeList_size (t->args);
                errtok = nameNode_errorToken (t->name);
                
-               /* errorShowPoint (tsource_thisLine (lclsource), ltoken_getCol (errtok)); */
+               /* errorShowPoint (inputStream_thisLine (lclsource), ltoken_getCol (errtok)); */
                
                if (isStandardOperator (t->name))
                  {
@@ -268,7 +268,7 @@ static void
     case TRM_LITERAL:
       sortSet_elements (t->possibleSorts, s2)
       {
-       if (sort_equal (&s2, &s))
+       if (sort_equal (s2, s))
          {
            sortSet_free (t->possibleSorts);
            t->possibleSorts = sortSet_new ();
@@ -294,7 +294,7 @@ static void
          {
            sort rsort = sigNode_rangeSort (sig->signature);
 
-           if (sort_equal (&s, &rsort))
+           if (sort_equal (s, rsort))
              {
                lslOp iop;
                
@@ -335,7 +335,7 @@ static void
              }
            else
              {
-               /* errorShowPoint (tsource_thisLine (lclsource), ltoken_getCol (errtok)); */
+               /* errorShowPoint (inputStream_thisLine (lclsource), ltoken_getCol (errtok)); */
                t->error_reported = TRUE;
                
                lclerror (errtok, message ("Operator not found: %q", 
@@ -365,7 +365,7 @@ static void
            else
              {
                errtok = nameNode_errorToken (name);
-               /* errorShowPoint (tsource_thisLine (lclsource), ltoken_getCol (errtok)); */
+               /* errorShowPoint (inputStream_thisLine (lclsource), ltoken_getCol (errtok)); */
                t->error_reported = TRUE;
                
                lclerror (errtok, message ("No matching operator: %q",
@@ -398,7 +398,7 @@ checkLclPredicate (ltoken t, lclPredicateNode n)
     {
      /* check that the sort of n is boolean */
       theSort = n->predicate->sort;
-      if (!sort_compatible (theSort, sort_capBool))
+      if (!sort_compatible (theSort, g_sortCapBool))
        {
          if (sort_isNoSort (theSort))
            {
@@ -543,7 +543,7 @@ static bool isStandardOperator (/*@null@*/ nameNode n)
 }
 
 static /*@only@*/ sortSet
-standardOperators (/*@null@*/ nameNode n, sortSetList argSorts, /*@unused@*/ sort qual)
+standardOperators (/*@null@*/ nameNode n, sortSetList argSorts, /*@unused@*/ sort q)
 {
   sortSet argSet;
   sortSet ret = sortSet_new ();
@@ -566,9 +566,9 @@ standardOperators (/*@null@*/ nameNode n, sortSetList argSorts, /*@unused@*/ sor
 
              sn = sort_quietLookup (current);
 
-             while (sn.kind == SRT_SYN)
+             while (sn->kind == SRT_SYN)
                {
-                 sn = sort_quietLookup (sn.baseSort);
+                 sn = sort_quietLookup (sn->baseSort);
                }
              
              /*@-loopswitchbreak@*/
@@ -580,16 +580,16 @@ standardOperators (/*@null@*/ nameNode n, sortSetList argSorts, /*@unused@*/ sor
                    
                    if (cstring_equalLit (text, "trashed")) /* GACK! */
                      {
-                       if (sn.kind == SRT_OBJ ||
-                           sn.kind == SRT_ARRAY)
-                       (void) sortSet_insert (ret, sort_bool);   
+                       if (sn->kind == SRT_OBJ ||
+                           sn->kind == SRT_ARRAY)
+                       (void) sortSet_insert (ret, g_sortBool);          
                      }
                    
                    if (cstring_equalLit (text, "maxIndex") || 
                        cstring_equalLit (text, "minIndex"))
                      {
-                       if (sn.kind == SRT_ARRAY || sn.kind == SRT_PTR)
-                         (void) sortSet_insert (ret, sort_int);          
+                       if (sn->kind == SRT_ARRAY || sn->kind == SRT_PTR)
+                         (void) sortSet_insert (ret, g_sortInt);         
                        
                        /*                if (lsymbol_fromChars ("maxIndex") */
                      }
@@ -598,17 +598,17 @@ standardOperators (/*@null@*/ nameNode n, sortSetList argSorts, /*@unused@*/ sor
                case LLT_MODIFIES:
                case LLT_FRESH:
                case LLT_UNCHANGED:
-                 if (sn.kind == SRT_OBJ ||
-                     sn.kind == SRT_ARRAY)
+                 if (sn->kind == SRT_OBJ ||
+                     sn->kind == SRT_ARRAY)
                    {
-                     (void) sortSet_insert (ret, sort_bool);     
+                     (void) sortSet_insert (ret, g_sortBool);    
                    }
                  break;
                case LLT_SIZEOF:
-                 if (sn.kind == SRT_OBJ ||
-                     sn.kind == SRT_ARRAY ||
-                     sn.kind == SRT_VECTOR)
-                 (void) sortSet_insert (ret, sort_int);
+                 if (sn->kind == SRT_OBJ ||
+                     sn->kind == SRT_ARRAY ||
+                     sn->kind == SRT_VECTOR)
+                 (void) sortSet_insert (ret, g_sortInt);
                  break;
                default:
                  break;
@@ -634,7 +634,7 @@ standardOperators (/*@null@*/ nameNode n, sortSetList argSorts, /*@unused@*/ sor
            {
              argSet = sortSetList_head (argSorts);
              
-             if (sortSet_member (argSet, sort_bool))
+             if (sortSet_member (argSet, g_sortBool))
                {
                  sortSetList_reset (argSorts);
                  sortSetList_advance (argSorts);
@@ -652,7 +652,7 @@ standardOperators (/*@null@*/ nameNode n, sortSetList argSorts, /*@unused@*/ sor
                      clause2 = sortSet_choose (argSet);
                      
                      if (sortSet_size (argSet) == 1 &&
-                         sort_equal (&clause, &clause2))
+                         sort_equal (clause, clause2))
                        {
                          (void) sortSet_insert (ret, clause);
                        }
@@ -678,15 +678,15 @@ standardOperators (/*@null@*/ nameNode n, sortSetList argSorts, /*@unused@*/ sor
 
                        sn = sort_quietLookup (current);
 
-                       while (sn.kind == SRT_SYN)
+                       while (sn->kind == SRT_SYN)
                          {
-                           sn = sort_quietLookup (sn.baseSort);
+                           sn = sort_quietLookup (sn->baseSort);
                          }
                        
-                       switch (sn.kind)
+                       switch (sn->kind)
                          {
                          case SRT_OBJ:
-                           (void) sortSet_insert (ret, sn.baseSort);
+                           (void) sortSet_insert (ret, sn->baseSort);
                            break;
                          case SRT_ARRAY:
                            (void) sortSet_insert (ret, 
@@ -738,14 +738,14 @@ standardOperators (/*@null@*/ nameNode n, sortSetList argSorts, /*@unused@*/ sor
 
                        sn = sort_quietLookup (current);
                        
-                       while (sn.kind == SRT_SYN)
+                       while (sn->kind == SRT_SYN)
                          {
-                           sn = sort_quietLookup (sn.baseSort);
+                           sn = sort_quietLookup (sn->baseSort);
                          }
                        
-                       if (sn.kind == SRT_PTR)
+                       if (sn->kind == SRT_PTR)
                          {
-                           (void) sortSet_insert (ret, sn.baseSort);           
+                           (void) sortSet_insert (ret, sn->baseSort);          
                          }
                      } end_sortSet_elements; 
                  }
@@ -776,9 +776,9 @@ standardOperators (/*@null@*/ nameNode n, sortSetList argSorts, /*@unused@*/ sor
                          {
                            sortSet_elements (argSet2, cl2)
                              {
-                               if (sort_equal (&cl, &cl2))
+                               if (sort_equal (cl, cl2))
                                  {
-                                   (void) sortSet_insert (ret, sort_bool);
+                                   (void) sortSet_insert (ret, g_sortBool);
                                  }
                              } end_sortSet_elements;
                          } end_sortSet_elements; 
This page took 0.046583 seconds and 4 git commands to generate.