]> andersk Git - splint.git/blobdiff - src/qtype.c
noexpand always false.
[splint.git] / src / qtype.c
index 854114b6703e83f250af82f5b68cf9515d283de0..beef293460b4cf7affac452e729f2af70c9bdc78 100644 (file)
@@ -1,6 +1,6 @@
 /*
-** LCLint - annotation-assisted static program checker
-** Copyright (C) 1994-2000 University of Virginia,
+** Splint - annotation-assisted static program checker
+** Copyright (C) 1994-2003 University of Virginia,
 **         Massachusetts Institute of Technology
 **
 ** This program is free software; you can redistribute it and/or modify it
@@ -17,9 +17,9 @@
 ** the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
 ** MA 02111-1307, USA.
 **
-** For information on lclint: lclint-request@cs.virginia.edu
-** To report a bug: lclint-bug@cs.virginia.edu
-** For more information: http://lclint.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
 */
 /*
 ** qtype.c
@@ -28,7 +28,7 @@
 ** qtypes are mutable
 */
 
-# include "lclintMacros.nf"
+# include "splintMacros.nf"
 # include "basic.h"
 
 /*@notnull@*/ qtype qtype_create (ctype c)
@@ -56,15 +56,17 @@ qtype qtype_unknown ()
 
 qtype qtype_addQual (qtype qt, qual q)
 {
+  DPRINTF (("Add qual: %s / %s", qtype_unparse (qt), qual_unparse (q)));
+
   if (qtype_isDefined (qt))
     {
       qt->quals = qualList_add (qt->quals, q);
     }
 
+  DPRINTF (("==> %s", qtype_unparse (qt)));
   return qt;
 }
 
-# ifndef NOLCL
 qtype qtype_addQualList (/*@returned@*/ qtype qt, qualList ql)
 {
   if (qtype_isDefined (qt))
@@ -74,7 +76,6 @@ qtype qtype_addQualList (/*@returned@*/ qtype qt, qualList ql)
 
   return qt;
 }
-# endif
 
 static void checkAltQuals (qtype q)
 {
@@ -102,7 +103,6 @@ static void checkAltQuals (qtype q)
     }
 }
 
-# ifndef NOLCL
 qtype qtype_mergeImplicitAlt (/*@returned@*/ qtype q1, /*@only@*/ qtype q2)
 {
   if (qtype_isDefined (q1) && qtype_isDefined (q2))
@@ -118,10 +118,11 @@ qtype qtype_mergeImplicitAlt (/*@returned@*/ qtype q1, /*@only@*/ qtype q2)
   qtype_free (q2);
   return q1;
 }
-# endif
 
 qtype qtype_mergeAlt (/*@returned@*/ qtype q1, /*@only@*/ qtype q2)
 {
+  DPRINTF (("Merge alt: %s + %s", qtype_unparse (q1), qtype_unparse (q2)));
+
   if (qtype_isDefined (q1) && qtype_isDefined (q2))
     {
       if (context_getFlag (FLG_IMPCONJ))
@@ -132,7 +133,6 @@ qtype qtype_mergeAlt (/*@returned@*/ qtype q1, /*@only@*/ qtype q2)
        {
          q1->type = ctype_makeExplicitConj (q1->type, q2->type);
        }
-
       
       if (!qualList_isEmpty (q2->quals))
        {
@@ -146,12 +146,14 @@ qtype qtype_mergeAlt (/*@returned@*/ qtype q1, /*@only@*/ qtype q2)
 
 qtype qtype_combine (/*@returned@*/ qtype q1, ctype ct)
 {
+  DPRINTF (("Combine: %s %s", qtype_unparse (q1), ctype_unparse (ct)));
   if (qtype_isDefined (q1))
     {
       /* ct is modifier (or q1->type is unknown) */
       q1->type = ctype_combine (q1->type, ct); 
     }
 
+  DPRINTF (("Combine: %s %s", qtype_unparse (q1), ctype_unparse (ct)));
   return q1;
 }
 
@@ -159,7 +161,9 @@ qtype qtype_resolve (/*@returned@*/ qtype q)
 {
   if (qtype_isDefined (q))
     {
+      DPRINTF (("Resolving: %s", qtype_unparse (q)));
       q->type = ctype_resolve (q->type);
+      DPRINTF (("Resolving: %s", qtype_unparse (q)));
     }
 
   return q;
@@ -182,7 +186,9 @@ qtype qtype_newBase (/*@returned@*/ qtype q, ctype ct)
 {
   if (qtype_isDefined (q))
     {
+      DPRINTF (("new base: %s -> %s", qtype_unparse (q), ctype_unparse (ct)));
       q->type = ctype_newBase (ct, q->type);
+      DPRINTF (("new base: %s -> %s", qtype_unparse (q), ctype_unparse (ct)));
     }
 
   return q;
@@ -196,18 +202,21 @@ qtype qtype_newQbase (qtype q1, qtype q2)
       q1->quals = qualList_appendList (q1->quals, q2->quals);
     }
 
+  DPRINTF (("new base: %s -> %s", qtype_unparse (q1), qtype_unparse (q1)));
   return q1;
 }
 
-void qtype_adjustPointers (int n, qtype q)
+void qtype_adjustPointers (pointers n, qtype q)
 {
   if (qtype_isDefined (q))
     {
+      DPRINTF (("Pointers: %s %s", pointers_unparse (n), qtype_unparse (q)));
       q->type = ctype_adjustPointers (n, q->type);
     }
+
+  pointers_free (n);
 }
 
-# ifndef NOLCL
 qtype qtype_copy (qtype q)
 {
   if (qtype_isDefined (q))
@@ -223,4 +232,3 @@ qtype qtype_copy (qtype q)
       return qtype_undefined;
     }
 }
-# endif
This page took 0.036893 seconds and 4 git commands to generate.