]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Move some things around
authorDale Weiler <killfieldengine@gmail.com>
Tue, 30 Jul 2013 15:32:24 +0000 (15:32 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Tue, 30 Jul 2013 15:32:24 +0000 (15:32 +0000)
conout.c
gmqcc.h
include.mk
main.c
opts.c

index 13a242f4041b613f539c1030bd59a6c2bcf320e1..2f1eb9e25e369acbeaec9142c29737a91a62bd9f 100644 (file)
--- a/conout.c
+++ b/conout.c
@@ -327,6 +327,7 @@ int con_out(const char *fmt, ...) {
     return   ln;
 }
 
+#ifndef QCVM_EXECUTOR
 /*
  * Utility console message writes for lexer contexts.  These will allow
  * for reporting of file:line based on lexer context, These are used
@@ -445,3 +446,4 @@ bool GMQCC_WARN compile_warning(lex_ctx ctx, int warntype, const char *fmt, ...)
     va_end(ap);
     return r;
 }
+#endif
diff --git a/gmqcc.h b/gmqcc.h
index 5372120ddbc877914f1712388761053a881d5346..4595be9192f2710cf1941930bd55c64842cea8bf 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
@@ -1008,18 +1008,13 @@ void opts_restore_non_Wall(void);
 void opts_backup_non_Werror_all(void);
 void opts_restore_non_Werror_all(void);
 
+
 enum {
 # define GMQCC_TYPE_FLAGS
 # define GMQCC_DEFINE_FLAG(X) X,
 #  include "opts.def"
     COUNT_FLAGS
 };
-static const opts_flag_def opts_flag_list[] = {
-# define GMQCC_TYPE_FLAGS
-# define GMQCC_DEFINE_FLAG(X) { #X, LONGBIT(X) },
-#  include "opts.def"
-    { NULL, LONGBIT(0) }
-};
 
 enum {
 # define GMQCC_TYPE_WARNS
@@ -1027,12 +1022,6 @@ enum {
 #  include "opts.def"
     COUNT_WARNINGS
 };
-static const opts_flag_def opts_warn_list[] = {
-# define GMQCC_TYPE_WARNS
-# define GMQCC_DEFINE_FLAG(X) { #X, LONGBIT(WARN_##X) },
-#  include "opts.def"
-    { NULL, LONGBIT(0) }
-};
 
 enum {
 # define GMQCC_TYPE_OPTIMIZATIONS
@@ -1040,18 +1029,6 @@ enum {
 #  include "opts.def"
     COUNT_OPTIMIZATIONS
 };
-static const opts_flag_def opts_opt_list[] = {
-# define GMQCC_TYPE_OPTIMIZATIONS
-# define GMQCC_DEFINE_FLAG(NAME, MIN_O) { #NAME, LONGBIT(OPTIM_##NAME) },
-#  include "opts.def"
-    { NULL, LONGBIT(0) }
-};
-static const unsigned int opts_opt_oflag[] = {
-# define GMQCC_TYPE_OPTIMIZATIONS
-# define GMQCC_DEFINE_FLAG(NAME, MIN_O) MIN_O,
-#  include "opts.def"
-    0
-};
 
 enum {
 #   define GMQCC_TYPE_OPTIONS
@@ -1060,7 +1037,11 @@ enum {
     OPTION_COUNT
 };
 
-extern unsigned int opts_optimizationcount[COUNT_OPTIMIZATIONS];
+extern const opts_flag_def opts_flag_list[COUNT_FLAGS+1];
+extern const opts_flag_def opts_warn_list[COUNT_WARNINGS+1];
+extern const opts_flag_def opts_opt_list[COUNT_OPTIMIZATIONS+1];
+extern const unsigned int  opts_opt_oflag[COUNT_OPTIMIZATIONS+1];
+extern unsigned int        opts_optimizationcount[COUNT_OPTIMIZATIONS];
 
 /* other options: */
 typedef enum {
index d8ee6fe33d49577dff0cffa71c475005e31bb313..3fa588da73ba2488c6b896a3cf67c2e9b88f9e27 100644 (file)
@@ -16,8 +16,8 @@ LIBS    += -lm
 #objects
 OBJ_C = main.o lexer.o parser.o fs.o stat.o util.o code.o ast.o ir.o conout.o ftepp.o opts.o utf8.o correct.o
 OBJ_P = util.o fs.o conout.o opts.o pak.o stat.o
-OBJ_T = test.o util.o conout.o fs.o stat.o
-OBJ_X = exec-standalone.o util.o conout.o fs.o stat.o
+OBJ_T = test.o util.o opts.o conout.o fs.o stat.o
+OBJ_X = exec-standalone.o util.o opts.o conout.o fs.o stat.o
 
 #gource flags
 GOURCEFLAGS =                 \
diff --git a/main.c b/main.c
index e8a41b756c50e293d732a8f3086ef20f33530237..8aae427b5e886b3ce1b7c3e35249368c5a8d6380 100644 (file)
--- a/main.c
+++ b/main.c
@@ -45,7 +45,6 @@ static ppitem  *ppems = NULL;
 #define TYPE_ASM 1
 #define TYPE_SRC 2
 
-
 static const char *app_name;
 
 static void version(void) {
diff --git a/opts.c b/opts.c
index 286b1686b66c72a496f656664ffaba3e6497b75a..e009d4e2cf52f8100e5139127043c5b46a525f59 100644 (file)
--- a/opts.c
+++ b/opts.c
 
 #include "gmqcc.h"
 
+const unsigned int opts_opt_oflag[COUNT_OPTIMIZATIONS+1] = {
+# define GMQCC_TYPE_OPTIMIZATIONS
+# define GMQCC_DEFINE_FLAG(NAME, MIN_O) MIN_O,
+#  include "opts.def"
+    0
+};
+
+const opts_flag_def opts_opt_list[COUNT_OPTIMIZATIONS+1] = {
+# define GMQCC_TYPE_OPTIMIZATIONS
+# define GMQCC_DEFINE_FLAG(NAME, MIN_O) { #NAME, LONGBIT(OPTIM_##NAME) },
+#  include "opts.def"
+    { NULL, LONGBIT(0) }
+};
+
+const opts_flag_def opts_warn_list[COUNT_WARNINGS+1] = {
+# define GMQCC_TYPE_WARNS
+# define GMQCC_DEFINE_FLAG(X) { #X, LONGBIT(WARN_##X) },
+#  include "opts.def"
+    { NULL, LONGBIT(0) }
+};
+
+const opts_flag_def opts_flag_list[COUNT_FLAGS+1] = {
+# define GMQCC_TYPE_FLAGS
+# define GMQCC_DEFINE_FLAG(X) { #X, LONGBIT(X) },
+#  include "opts.def"
+    { NULL, LONGBIT(0) }
+};
+
 unsigned int opts_optimizationcount[COUNT_OPTIMIZATIONS];
 opts_cmd_t   opts; /* command lien options */
 
@@ -351,7 +379,6 @@ void opts_ini_init(const char *file) {
     size_t     line;
     FILE       *ini;
 
-
     if (!file) {
         /* try ini */
         if (!(ini = fs_file_open((file = "gmqcc.ini"), "r")))