]> andersk Git - splint.git/blobdiff - src/uentryList.c
Fixed all /*@i...@*/ tags (except 1).
[splint.git] / src / uentryList.c
index 25fc641c8695d78b2e6f244d98b0dd723e300556..eca84f0b7f097b570b9935d1da3b9191c8e4cc97 100644 (file)
@@ -1,6 +1,6 @@
 /*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2001 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
 ** 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
 */
 /*
 ** uentryList.c (from slist_template.c)
 */
 
-# include "lclintMacros.nf"
+# include "splintMacros.nf"
 # include "basic.h"
 
 /*@only@*/ /*@notnull@*/ uentryList
@@ -229,7 +229,7 @@ uentryList_unparseAbbrev (uentryList p)
   if (uentryList_size (p) == 0)
     return cstring_makeLiteral ("void");
 
-  for (i = 0; i < p->nelements && i < PRINTBREADTH; i++)
+  for (i = 0; i < p->nelements && i < uentryList_abbrevBreadth; i++)
     {
       if (first)
        {
@@ -327,7 +327,6 @@ uentryList uentryList_copy (uentryList s)
 void
 uentryList_free (uentryList s)
 {
-  
   if (!uentryList_isUndefined (s)) 
     {
       int i;
@@ -342,6 +341,18 @@ uentryList_free (uentryList s)
     }
 }
 
+void
+uentryList_freeShallow (uentryList s)
+{
+  if (!uentryList_isUndefined (s)) 
+    {
+      /*@-mustfree@*/ /* free shallow does not free the element */ 
+      sfree (s->elements);
+      /*@=mustfree@*/
+      sfree (s);
+    }
+}
+
 bool
 uentryList_isVoid (uentryList cl)
 {
@@ -702,6 +713,26 @@ uentryList_lookupField (uentryList f, cstring name)
     }
   else
     {
+      uentryList_elements (f, el)
+       {
+         if (uentry_isUnnamedVariable (el))
+           {
+             ctype ct = uentry_getType (el);
+
+             if (ctype_isStruct (ct) || ctype_isUnion (ct))
+               {
+                 uentryList fields = ctype_getFields (ct);
+                 uentry ue = uentryList_lookupField (fields, name);
+
+                 if (uentry_isValid (ue))
+                   {
+                     return ue;
+                   }
+               }
+           }
+       }
+      end_uentryList_elements ;
+
       return uentry_undefined;
     }
 }
@@ -709,6 +740,8 @@ uentryList_lookupField (uentryList f, cstring name)
 /*@only@*/ uentryList
   uentryList_mergeFields (/*@only@*/ uentryList f1, /*@only@*/ uentryList f2)
 {
+  DPRINTF (("Merge: %s + %s", uentryList_unparse (f1), uentryList_unparse (f2)));
+
   if (uentryList_isUndefined (f1))
     {
       return  (f2);
@@ -851,8 +884,7 @@ uentryList_matchFields (uentryList p1, uentryList p2)
       cp1 = p1->elements[index];
       cp2 = p2->elements[index];
 
-      /*@i32
-      **
+      /*
       ** Should compare uentry's --- need to fix report errors too.
       */
 
This page took 0.079017 seconds and 4 git commands to generate.