]> andersk Git - splint.git/blobdiff - src/ctype.c
Removed /*bee:...*/ comments.
[splint.git] / src / ctype.c
index 7fc16c481bef2841d0c72adcb6db297c3b9fac9f..1ea98e0e6b58334f51e95599b99ed456355e8c4e 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
@@ -157,7 +157,18 @@ ctype_createAbstract (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_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
@@ -256,6 +267,16 @@ ctype_isAbstract (ctype c)
                || 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)
 {
@@ -271,6 +292,15 @@ ctype_isRealAbstract (ctype c)
            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
 */
@@ -1062,7 +1092,7 @@ static bool
     {
       ctype cbr = ctype_getConjA (*c);
 
-     /*drl bee: si*/   if ((*pred) (cbr))
+       if ((*pred) (cbr))
        {
          if ((*pred) (ctype_getConjB (*c)))
            {
@@ -1970,6 +2000,7 @@ ctype_getBaseType (ctype c)
              case CT_ENUMLIST:
              case CT_BOOL:
              case CT_ABST:
+             case CT_NUMABST:
              case CT_FCN:
              case CT_STRUCT:
              case CT_UNION:
@@ -2796,3 +2827,14 @@ size_t ctype_getArraySize (ctype c)
   return size;
 }
 
+ctype ctype_biggerType (ctype c1, ctype c2)
+{
+  if (ctbase_isBigger (ctype_getCtbaseSafe (c2), ctype_getCtbaseSafe (c1)) )
+    {
+      return c2;
+    }
+  else
+    {
+      return c1;
+    }
+}
This page took 0.035954 seconds and 4 git commands to generate.