/*
-** 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
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)
{
void
uentryList_free (uentryList s)
{
-
if (!uentryList_isUndefined (s))
{
int i;
}
}
+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)
{
if (cl != NULL && cl->nelements == 1)
{
- return (ctype_isVoid (uentry_getType (cl->elements[0])));
+ return (ctype_isVoid (ctype_realType (uentry_getType (cl->elements[0]))));
}
+
return FALSE;
}
{
if (uentryList_isUndefined (s)) return 0;
- if (s->nelements == 1 && ctype_isVoid (uentry_getType (s->elements[0])))
+ if (uentryList_isVoid (s))
return 0;
return s->nelements;
}
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;
}
}
/*@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);
cp1 = p1->elements[index];
cp2 = p2->elements[index];
- /*@i32
- **
+ /*
** Should compare uentry's --- need to fix report errors too.
*/