/*
** 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
/* requires: ctype_createAbstract (u) is never called more than once for any u. */
/* [ tested by cttable_addFullSafe, not really required ] */
- return (cttable_addFullSafe (ctentry_makeNew (CTK_PLAIN, ctbase_createAbstract (u))));
+ return (cttable_addFullSafe
+ (ctentry_makeNew (CTK_PLAIN, ctbase_createAbstract (u))));
+}
+
+ctype
+ctype_createNumAbstract (typeId u)
+{
+ /* requires: ctype_createAbstract (u) is never called more than once for any u. */
+ /* [ tested by cttable_addFullSafe, not really required ] */
+
+ return (cttable_addFullSafe
+ (ctentry_makeNew (CTK_PLAIN, ctbase_createNumAbstract (u))));
}
int
|| ctype_isAbstract (ctype_getConjB (c))))));
}
+bool
+ctype_isNumAbstract (ctype c)
+{
+ return (!ctype_isUnknown (c)
+ && ((ctype_isPlain (c) && ctbase_isNumAbstract (ctype_getCtbaseSafe (c))) ||
+ (ctype_isConj (c) &&
+ (ctype_isNumAbstract (ctype_getConjA (c))
+ || ctype_isNumAbstract (ctype_getConjB (c))))));
+}
+
bool
ctype_isImmutableAbstract (ctype t)
{
ctype_isRealAbstract (ctype_getConjB (c)))));
}
+bool
+ctype_isRealNumAbstract (ctype c)
+{
+ return (ctype_isNumAbstract (ctype_realType (c)) ||
+ (ctype_isConj (c) &&
+ (ctype_isRealNumAbstract (ctype_getConjA (c)) ||
+ ctype_isRealNumAbstract (ctype_getConjB (c)))));
+}
+
/*
** primitive creators
*/
{
ctype cbr = ctype_getConjA (*c);
- /*drl bee: si*/ if ((*pred) (cbr))
+ if ((*pred) (cbr))
{
if ((*pred) (ctype_getConjB (*c)))
{
case CT_ENUMLIST:
case CT_BOOL:
case CT_ABST:
+ case CT_NUMABST:
case CT_FCN:
case CT_STRUCT:
case CT_UNION:
return size;
}
+ctype ctype_biggerType (ctype c1, ctype c2)
+{
+ if (ctbase_isBigger (ctype_getCtbaseSafe (c2), ctype_getCtbaseSafe (c1)) )
+ {
+ return c2;
+ }
+ else
+ {
+ return c1;
+ }
+}