]> andersk Git - splint.git/blobdiff - src/functionClauseList.c
Fixed all /*@i...@*/ tags (except 1).
[splint.git] / src / functionClauseList.c
index abf3dd0c43165ed0ec13bb5c4214bdb1eebbbb30..a78acf37de1cac264055a9b3c688227a14d99f33 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ** Splint - annotation-assisted static program checker
-** Copyright (C) 1994-2002 University of Virginia,
+** 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,8 +17,8 @@
 ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 ** MA 02111-1307, USA.
 **
-** For information on splint: splint@cs.virginia.edu
-** To report a bug: splint-bug@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
 */
 /*
@@ -94,10 +94,10 @@ functionClauseList functionClauseList_add (functionClauseList s, /*@keep@*/ func
     }
   
   s->nspace--;
-  /*@i32@*/ s->elements[s->nelements] = el;
+  s->elements[s->nelements] = el;
   s->nelements++;
 
-  /*@i32@*/ return s;
+  return s;
 }
 
 functionClauseList functionClauseList_prepend (functionClauseList s, /*@keep@*/ functionClause el)
@@ -106,7 +106,7 @@ functionClauseList functionClauseList_prepend (functionClauseList s, /*@keep@*/
 
   if (!functionClauseList_isDefined (s))
     {
-      /*@i32@*/ return functionClauseList_single (el);
+      return functionClauseList_single (el);
     }
 
   if (s->nspace <= 0)
@@ -121,10 +121,10 @@ functionClauseList functionClauseList_prepend (functionClauseList s, /*@keep@*/
       s->elements[i] = s->elements [i - 1];
     }
 
-  /*@i32@*/ s->elements[0] = el;
+  s->elements[0] = el;
   s->nelements++;
-
-  /*@i32@*/ return s;
+  
+  return s;
 }
 
 cstring
@@ -172,3 +172,70 @@ functionClauseList_free (functionClauseList s)
     }
 }
 
+functionClauseList 
+functionClauseList_setImplictConstraints (/*@returned@*/ functionClauseList s)
+{
+  bool addedConstraints;
+
+  constraintList c;
+  
+  DPRINTF ((message ("functionClauseList_setImplictConstraints called ") ));
+  
+  addedConstraints = FALSE;
+
+
+  c = getImplicitFcnConstraints ();
+  
+  if (constraintList_isEmpty(c) )
+    {
+      return s;
+    }
+  
+  functionClauseList_elements(s, el)
+    {
+      if (functionClause_isRequires(el))
+       {
+         functionConstraint con = functionClause_getRequires(el);
+         
+         if (functionConstraint_hasBufferConstraint(con))
+           {
+             if (functionConstraint_isBufferConstraint (con))
+               {
+                 constraintList implCons = getImplicitFcnConstraints ();
+                 
+                 DPRINTF ((message ("functionClauseList_ImplictConstraints adding the implict constraints: %s to %s",
+                                    constraintList_print(implCons), constraintList_print (con->constraint.buffer))));
+                 
+                 functionConstraint_addBufferConstraints (con, constraintList_copy (implCons) );
+
+                 addedConstraints = TRUE;
+                 
+                 DPRINTF ((message ("functionClauseList_ImplictConstraints the new constraint is %s",
+                                    functionConstraint_unparse (con))));
+
+               }
+             else
+               {
+                 llassert (FALSE);
+               }
+           }
+       }
+    }
+  
+  end_functionClauseList_elements;
+
+  if (!addedConstraints)
+    {
+      functionConstraint fCon;
+      functionClause fClause;
+      
+      constraintList implCons = getImplicitFcnConstraints ();
+      
+      fCon = functionConstraint_createBufferConstraint(constraintList_copy (implCons) );
+      fClause = functionClause_createRequires(fCon);
+      s = functionClauseList_add(s, fClause);
+
+       
+    }
+  return s;    
+}
This page took 0.037354 seconds and 4 git commands to generate.