]> andersk Git - splint.git/blobdiff - src/stateInfo.c
noexpand always false.
[splint.git] / src / stateInfo.c
index b2fad5cfff22c82f40d92100a8b3fe6b2f6a98e3..cf5246a9099d96fb0c7482076b841cfece9bfcc7 100644 (file)
 # include "splintMacros.nf"
 # include "basic.h"
 
+# ifdef WIN32
+/*
+** Make Microsoft VC++ happy: its control checking produces too
+** many spurious warnings.
+*/
+
+# pragma warning (disable:4715) 
+# endif
+
 static /*@observer@*/ cstring stateAction_unparse (stateAction p_sa) /*@*/ ;
 
 void stateInfo_free (/*@only@*/ stateInfo a)
@@ -78,32 +87,32 @@ void stateInfo_free (/*@only@*/ stateInfo a)
     }
 }
 
-static /*@observer@*/ stateInfo stateInfo_sort (/*@temp@*/ stateInfo sinfo)
+static /*@observer@*/ stateInfo stateInfo_sort (/*@temp@*/ stateInfo stinfo)
      /* Sorts in reverse location order */
 {
-  DPRINTF (("Sorting: %s", stateInfo_unparse (sinfo)));
+  DPRINTF (("Sorting: %s", stateInfo_unparse (stinfo)));
 
-  if (sinfo == NULL || sinfo->previous == NULL) 
+  if (stinfo == NULL || stinfo->previous == NULL) 
     {
-      return sinfo;
+      return stinfo;
     }
   else
     {
-      stateInfo snext = stateInfo_sort (sinfo->previous);
+      stateInfo snext = stateInfo_sort (stinfo->previous);
       stateInfo sfirst = snext;
 
-      DPRINTF (("sinfo/sext: %s // %s", stateInfo_unparse (sinfo), stateInfo_unparse (snext)));
+      DPRINTF (("stinfo/sext: %s // %s", stateInfo_unparse (stinfo), stateInfo_unparse (snext)));
       llassert (snext != NULL);
 
-      if (!fileloc_lessthan (sinfo->loc, snext->loc))
+      if (!fileloc_lessthan (stinfo->loc, snext->loc))
        {
-         /*@i888@*/ sinfo->previous = sfirst;
-         DPRINTF (("Sorted ==> %s", stateInfo_unparse (sinfo)));
-         /*@i888@*/ return sinfo;
+         /*@i2@*/ stinfo->previous = sfirst; /* spurious? */
+         DPRINTF (("Sorted ==> %s", stateInfo_unparse (stinfo)));
+         /*@i2@*/ return stinfo; /* spurious? */
        }
       else
        {
-         while (snext != NULL && fileloc_lessthan (sinfo->loc, snext->loc))
+         while (snext != NULL && fileloc_lessthan (stinfo->loc, snext->loc))
            {
              /*
              ** swap the order
@@ -112,22 +121,28 @@ static /*@observer@*/ stateInfo stateInfo_sort (/*@temp@*/ stateInfo sinfo)
              stateAction taction = snext->action;
              sRef tref = snext->ref;
              
-             DPRINTF (("in while: sinfo/sext: %s // %s", stateInfo_unparse (sinfo), stateInfo_unparse (snext)));
+             DPRINTF (("in while: stinfo/sext: %s // %s", stateInfo_unparse (stinfo), stateInfo_unparse (snext)));
       
-             snext->loc = sinfo->loc;
-             snext->action = sinfo->action;
-             /*@i888@*/ snext->ref = sinfo->ref;
+             snext->loc = stinfo->loc;
+             snext->action = stinfo->action;
+             /*@-modobserver@*/
+             snext->ref = stinfo->ref; /* Doesn't actually modifie sfirst */ 
+             /*@=modobserver@*/
              
-             sinfo->loc = tloc;
-             sinfo->action = taction;
-             sinfo->ref = tref;
-             /*@i888@*/ sinfo->previous = snext->previous;
+             stinfo->loc = tloc;
+             stinfo->action = taction;
+             stinfo->ref = tref;
+             /*@-mustfreeonly@*/
+             stinfo->previous = snext->previous;
+             /*@=mustfreeonly@*/
              snext = snext->previous;
-             DPRINTF (("in while: sinfo/sext: %s // %s", stateInfo_unparse (sinfo), stateInfo_unparse (snext)));
+             DPRINTF (("in while: stinfo/sext: %s // %s", stateInfo_unparse (stinfo), stateInfo_unparse (snext)));
            }
          
          DPRINTF (("Sorted ==> %s", stateInfo_unparse (sfirst)));
-         /*@i888@*/ return sfirst;
+         /*@-compmempass@*/
+         return sfirst;
+         /*@=compmempass@*/
        }
     }
 }
This page took 0.053301 seconds and 4 git commands to generate.