bugmessage: move struct to header file
authorBrian Norris <banorris@uci.edu>
Mon, 15 Apr 2013 22:41:31 +0000 (15:41 -0700)
committerBrian Norris <banorris@uci.edu>
Tue, 16 Apr 2013 00:00:19 +0000 (17:00 -0700)
bugmessage.h [new file with mode: 0644]
model.cc

diff --git a/bugmessage.h b/bugmessage.h
new file mode 100644 (file)
index 0000000..bd7d0b6
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef __BUGMESSAGE_H__
+#define __BUGMESSAGE_H__
+
+#include "common.h"
+#include "mymemory.h"
+
+struct bug_message {
+       bug_message(const char *str) {
+               const char *fmt = "  [BUG] %s\n";
+               msg = (char *)snapshot_malloc(strlen(fmt) + strlen(str));
+               sprintf(msg, fmt, str);
+       }
+       ~bug_message() { if (msg) snapshot_free(msg); }
+
+       char *msg;
+       void print() { model_print("%s", msg); }
+
+       SNAPSHOTALLOC
+};
+
+#endif /* __BUGMESSAGE_H__ */
index eed548cc0c906b0d50b6c78f89e51e15aa4b4e1b..826497945556055254e7ef8a0a32507fc7bc4716 100644 (file)
--- a/model.cc
+++ b/model.cc
 #include "threads-model.h"
 #include "output.h"
 #include "traceanalysis.h"
 #include "threads-model.h"
 #include "output.h"
 #include "traceanalysis.h"
+#include "bugmessage.h"
 
 #define INITIAL_THREAD_ID      0
 
 ModelChecker *model;
 
 
 #define INITIAL_THREAD_ID      0
 
 ModelChecker *model;
 
-struct bug_message {
-       bug_message(const char *str) {
-               const char *fmt = "  [BUG] %s\n";
-               msg = (char *)snapshot_malloc(strlen(fmt) + strlen(str));
-               sprintf(msg, fmt, str);
-       }
-       ~bug_message() { if (msg) snapshot_free(msg); }
-
-       char *msg;
-       void print() { model_print("%s", msg); }
-
-       SNAPSHOTALLOC
-};
-
 /**
  * Structure for holding small ModelChecker members that should be snapshotted
  */
 /**
  * Structure for holding small ModelChecker members that should be snapshotted
  */