]> andersk Git - splint.git/blobdiff - src/ctype.c
Removed /*bee:...*/ comments.
[splint.git] / src / ctype.c
index 81cc6aacaff560a05acec9369a135fbe1051425a..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
@@ -236,7 +247,8 @@ ctype_realishType (ctype c)
 bool
 ctype_isUA (ctype c)
 {
-  return (!ctype_isUnknown (c) && ctbase_isUA (ctype_getCtbase (c)));
+  return (!ctype_isUnknown (c) 
+         && ctbase_isUA (ctype_getCtbase (c)));
 }
 
 bool
@@ -255,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)
 {
@@ -270,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
 */
@@ -1061,7 +1092,7 @@ static bool
     {
       ctype cbr = ctype_getConjA (*c);
 
-     /*drl bee: si*/   if ((*pred) (cbr))
+       if ((*pred) (cbr))
        {
          if ((*pred) (ctype_getConjB (*c)))
            {
@@ -1969,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:
@@ -1997,13 +2029,14 @@ ctype_getBaseType (ctype c)
 }
 
 ctype
-ctype_adjustPointers (int np, ctype c)
+ctype_adjustPointers (pointers p, ctype c)
 {
-  
+  int np = pointers_depth (p);
+
   if (ctype_isFunction (c))
     {
       c = ctype_makeParamsFunction
-        (ctype_adjustPointers (np, ctype_getReturnType (c)),
+        (ctype_adjustPointers (p, ctype_getReturnType (c)),
         uentryList_copy (ctype_argsFunction (c)));
     }
   else
@@ -2211,6 +2244,16 @@ ctype_createForwardUnion (cstring n)
   return (ct);
 }
 
+ctype
+ctype_createForwardEnum (cstring n)
+{
+  uentry ue  = uentry_makeEnumTag (n, ctype_unknown, fileloc_undefined);
+  ctype ct = usymtab_supForwardTypeEntry (ue);
+
+  cstring_free (n);
+  return (ct);
+}
+
 ctype
 ctype_removePointers (ctype c)
 {
@@ -2784,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.502127 seconds and 4 git commands to generate.