]> andersk Git - splint.git/blobdiff - src/flagMarker.c
Pushed back constraintResolve.c to the previous version.
[splint.git] / src / flagMarker.c
index c8ab819930ef633bd78e49b899276129eae142bf..b51269b01088f4949e754521a596b4efde505880 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ** Splint - annotation-assisted static program checker
-** Copyright (C) 1994-2001 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
 ** 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 information on splint: info@splint.org
+** To report a bug: splint-bug@splint.org
 ** For more information: http://www.splint.org
 */
 /*
 ** flagMarker.c
 */
 
-# include "lclintMacros.nf"
+# include "splintMacros.nf"
 # include "basic.h"
 
 flagMarker flagMarker_createLocalSet (flagcode code, ynm set, fileloc loc)
@@ -107,6 +107,35 @@ int flagMarker_getCount (flagMarker f)
   return f->info.nerrors;
 }
 
+bool flagMarker_equal (flagMarker f1, flagMarker f2)
+{
+  if (f1->kind != f2->kind)
+    {
+      return FALSE;
+    }
+
+  if (!fileloc_equal (f1->loc, f2->loc))
+    {
+      return FALSE;
+    }
+
+  switch (f1->kind)
+    {
+    case FMK_LOCALSET:
+      return (f1->info.set == f2->info.set
+             && flagcode_equal (f1->code, f2->code));
+    case FMK_IGNORECOUNT:
+      return (f1->info.nerrors == f2->info.nerrors);
+    case FMK_IGNOREON:
+    case FMK_IGNOREOFF:
+      return TRUE;
+    case FMK_SUPPRESS:
+      return (flagcode_equal (f1->code, f2->code));
+    }
+
+  BADBRANCHRET (FALSE);
+}
+
 cstring flagMarker_unparse (flagMarker c)
 {
   switch (c->kind)
This page took 0.721373 seconds and 4 git commands to generate.