/*
** 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
** 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
*/
/*
}
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)
if (!functionClauseList_isDefined (s))
{
- /*@i32@*/ return functionClauseList_single (el);
+ return functionClauseList_single (el);
}
if (s->nspace <= 0)
s->elements[i] = s->elements [i - 1];
}
- /*@i32@*/ s->elements[0] = el;
+ s->elements[0] = el;
s->nelements++;
-
- /*@i32@*/ return s;
+
+ return s;
}
cstring
}
}
+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;
+}