Guart statistics by option.
authorDale Weiler <killfieldengine@gmail.com>
Sun, 2 Jun 2013 00:07:54 +0000 (00:07 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Sun, 2 Jun 2013 00:07:54 +0000 (00:07 +0000)
main.c
opts.def
util.c

diff --git a/main.c b/main.c
index 840a6a730fe83065b663ef92875cdb1948ba8fc9..4eb5eb31f29a556b09c788c183141e1577707af2 100644 (file)
--- a/main.c
+++ b/main.c
@@ -173,6 +173,7 @@ static bool options_parse(int argc, char **argv) {
 
 
                     OPTS_OPTION_U32(OPTION_STANDARD) = COMPILER_GMQCC;
+                    OPTS_OPTION_BOOL(OPTION_STATISTICS) = true;
 
                 } else if (!strcmp(argarg, "qcc")) {
 
index 520f9b95cb6f0d33872cd756f865d3a805e15168..77a4094115b3535e2090f5f62bf028a2288fe834 100644 (file)
--- a/opts.def
+++ b/opts.def
     GMQCC_DEFINE_FLAG(MAX_ARRAY_SIZE)
     GMQCC_DEFINE_FLAG(ADD_INFO)
     GMQCC_DEFINE_FLAG(CORRECTION)
+    GMQCC_DEFINE_FLAG(STATISTICS)
 #endif
 
 /* some cleanup so we don't have to */
diff --git a/util.c b/util.c
index 891082bf598e97ba5f27efa3909a6f385ca4c730..c19bbaf2b0038203294ed2630dcaa66149457908 100644 (file)
--- a/util.c
+++ b/util.c
@@ -181,9 +181,11 @@ void util_meminfo() {
         }
     }
     
-    con_out("Additional Statistics:\n    Total vectors used: %lu\n",
-        vectors
-    );
+    if (OPTS_OPTION_BOOL(OPTION_STATISTICS)) {
+        con_out("Additional Statistics:\n    Total vectors used: %lu\n",
+            vectors
+        );
+    }
 
     if (OPTS_OPTION_BOOL(OPTION_DEBUG) ||
         OPTS_OPTION_BOOL(OPTION_MEMCHK)) {