From 53a04a6ac7cbbf37880effe033704143bd6aaaaf Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Mon, 15 Apr 2013 15:41:31 -0700 Subject: [PATCH] bugmessage: move struct to header file --- bugmessage.h | 21 +++++++++++++++++++++ model.cc | 15 +-------------- 2 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 bugmessage.h diff --git a/bugmessage.h b/bugmessage.h new file mode 100644 index 0000000..bd7d0b6 --- /dev/null +++ b/bugmessage.h @@ -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__ */ diff --git a/model.cc b/model.cc index eed548c..8264979 100644 --- a/model.cc +++ b/model.cc @@ -17,25 +17,12 @@ #include "threads-model.h" #include "output.h" #include "traceanalysis.h" +#include "bugmessage.h" #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 */ -- 2.34.1