]> andersk Git - splint.git/blobdiff - src/ctbase.i
Fixed creation of temp files.
[splint.git] / src / ctbase.i
index 2d9c42f6661be2423bab4df0bfbab0d1c63fdef2..5e3d374b02999ce27059f533e00114b21462706c 100644 (file)
@@ -70,6 +70,7 @@ static ctype cttable_addDerived (ctkind p_ctk, /*@keep@*/ ctbase p_cnew, ctype p
 static ctype cttable_addFull (/*@keep@*/ ctentry p_cnew);
 static bool ctentry_isInteresting (ctentry p_c) /*@*/;
 static /*@notnull@*/ /*@only@*/ ctbase ctbase_makeFixedArray (ctype p_b, size_t p_size) /*@*/ ;
+static bool ctbase_isAnytype (/*@notnull@*/ ctbase p_b) /*@*/ ;
 
 /* 
 ** These are file-static macros (used in ctype.c).  No way to
@@ -538,7 +539,11 @@ ctbase_unparse (ctbase c)
                           enumNameList_unparseBrief (c->contents.cenum->members)));
        }
     case CT_CONJ:
-      if (c->contents.conj->isExplicit || context_getFlag (FLG_SHOWALLCONJS))
+      if (ctbase_isAnytype (c))
+       {
+         return (cstring_makeLiteral ("<any>"));
+       }
+      else if (c->contents.conj->isExplicit || context_getFlag (FLG_SHOWALLCONJS))
        {
          if (!ctype_isSimple (c->contents.conj->a) ||
              !ctype_isSimple (c->contents.conj->b))
@@ -609,7 +614,14 @@ static /*@only@*/ cstring
     case CT_UNION:
       return (message ("union %s { ... }", c->contents.su->name));
     case CT_CONJ:
-      return (message ("%t", c->contents.conj->a));
+      if (ctbase_isAnytype (c))
+       {
+         return (cstring_makeLiteral ("<any>"));
+       }
+      else
+       {
+         return (message ("%t", c->contents.conj->a));
+       }
     BADDEFAULT;
     }
   BADEXIT;
@@ -657,9 +669,16 @@ ctbase_unparseNotypes (ctbase c)
     case CT_ENUMLIST:
       return (message ("[enumlist]"));
     case CT_CONJ:
-      return (message ("%q/%q", 
-                      ctbase_unparseNotypes (ctype_getCtbase (c->contents.conj->a)),
-                      ctbase_unparseNotypes (ctype_getCtbase (c->contents.conj->b))));
+      if (ctbase_isAnytype (c))
+       {
+         return (cstring_makeLiteral ("<any>"));
+       }
+      else
+       {
+         return (message ("%q/%q", 
+                          ctbase_unparseNotypes (ctype_getCtbase (c->contents.conj->a)),
+                          ctbase_unparseNotypes (ctype_getCtbase (c->contents.conj->b))));
+       }
     BADDEFAULT;
     }
   BADEXIT;
@@ -754,8 +773,12 @@ ctbase_unparseDeclaration (ctbase c, /*@only@*/ cstring name) /*@*/
                           enumNameList_unparseBrief (c->contents.cenum->members),
                           name));
        }
-    case CT_CONJ:      
-      if (c->contents.conj->isExplicit || context_getFlag (FLG_SHOWALLCONJS))
+    case CT_CONJ:
+      if (ctbase_isAnytype (c))
+       {
+         return (message ("<any> %q", name));
+       }
+      else if (c->contents.conj->isExplicit || context_getFlag (FLG_SHOWALLCONJS))
        {
          if (!ctype_isSimple (c->contents.conj->a) ||
              !ctype_isSimple (c->contents.conj->b))
@@ -1839,6 +1862,23 @@ static /*@only@*/ ctbase
   return (c);
 }
 
+static bool ctbase_isAnytype (/*@notnull@*/ ctbase b)
+{
+  /*
+  ** A unknown|dne conj is a special representation for an anytype.
+  */
+
+  if (b->type == CT_CONJ)
+    {
+      /*@access ctype@*/
+      return (b->contents.conj->a == ctype_unknown
+             && b->contents.conj->b == ctype_dne);
+      /*@noaccess ctype@*/ 
+    }
+  
+  return FALSE;
+}
+
 static ctype
 ctbase_getConjA (/*@notnull@*/ ctbase c)
 {
This page took 0.050563 seconds and 4 git commands to generate.