]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
these can be const now before-library
authorWolfgang Bumiller <wry.git@bumiller.com>
Thu, 25 Apr 2013 07:55:58 +0000 (09:55 +0200)
committerWolfgang Bumiller <wry.git@bumiller.com>
Thu, 25 Apr 2013 07:55:58 +0000 (09:55 +0200)
gmqcc.h
ir.c
main.c

diff --git a/gmqcc.h b/gmqcc.h
index ed371f5716d476c7d0f0063cd0b57b86edb9ef4a..b3ba81782320d517ad4e6976416d3530fd8e6bbb 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
@@ -500,9 +500,9 @@ enum {
 #define CV_VAR   -1
 #define CV_WRONG  0x8000 /* magic number to help parsing */
 
 #define CV_VAR   -1
 #define CV_WRONG  0x8000 /* magic number to help parsing */
 
-extern const char *type_name        [TYPE_COUNT];
-extern uint16_t    type_store_instr [TYPE_COUNT];
-extern uint16_t    field_store_instr[TYPE_COUNT];
+extern const char    *type_name        [TYPE_COUNT];
+extern const uint16_t type_store_instr [TYPE_COUNT];
+extern const uint16_t field_store_instr[TYPE_COUNT];
 
 /*
  * could use type_store_instr + INSTR_STOREP_F - INSTR_STORE_F
 
 /*
  * could use type_store_instr + INSTR_STOREP_F - INSTR_STORE_F
@@ -510,10 +510,10 @@ extern uint16_t    field_store_instr[TYPE_COUNT];
  * instruction set, the old ones are left untouched, thus the _I instructions
  * are at a seperate place.
  */
  * instruction set, the old ones are left untouched, thus the _I instructions
  * are at a seperate place.
  */
-extern uint16_t type_storep_instr[TYPE_COUNT];
-extern uint16_t type_eq_instr    [TYPE_COUNT];
-extern uint16_t type_ne_instr    [TYPE_COUNT];
-extern uint16_t type_not_instr   [TYPE_COUNT];
+extern const uint16_t type_storep_instr[TYPE_COUNT];
+extern const uint16_t type_eq_instr    [TYPE_COUNT];
+extern const uint16_t type_ne_instr    [TYPE_COUNT];
+extern const uint16_t type_not_instr   [TYPE_COUNT];
 
 typedef struct {
     uint32_t offset;      /* Offset in file of where data begins  */
 
 typedef struct {
     uint32_t offset;      /* Offset in file of where data begins  */
diff --git a/ir.c b/ir.c
index 68186dc3dfa5cfcc5bb6d8fc6e2935913aaf6f6e..40094edfffdb9cf0febe0a36db3dd3cc157395dc 100644 (file)
--- a/ir.c
+++ b/ir.c
@@ -66,7 +66,7 @@ static size_t type_sizeof_[TYPE_COUNT] = {
     0, /* TYPE_NOESPR   */
 };
 
     0, /* TYPE_NOESPR   */
 };
 
-uint16_t type_store_instr[TYPE_COUNT] = {
+const uint16_t type_store_instr[TYPE_COUNT] = {
     INSTR_STORE_F, /* should use I when having integer support */
     INSTR_STORE_S,
     INSTR_STORE_F,
     INSTR_STORE_F, /* should use I when having integer support */
     INSTR_STORE_S,
     INSTR_STORE_F,
@@ -90,7 +90,7 @@ uint16_t type_store_instr[TYPE_COUNT] = {
     VINSTR_END, /* noexpr */
 };
 
     VINSTR_END, /* noexpr */
 };
 
-uint16_t field_store_instr[TYPE_COUNT] = {
+const uint16_t field_store_instr[TYPE_COUNT] = {
     INSTR_STORE_FLD,
     INSTR_STORE_FLD,
     INSTR_STORE_FLD,
     INSTR_STORE_FLD,
     INSTR_STORE_FLD,
     INSTR_STORE_FLD,
@@ -114,7 +114,7 @@ uint16_t field_store_instr[TYPE_COUNT] = {
     VINSTR_END, /* noexpr */
 };
 
     VINSTR_END, /* noexpr */
 };
 
-uint16_t type_storep_instr[TYPE_COUNT] = {
+const uint16_t type_storep_instr[TYPE_COUNT] = {
     INSTR_STOREP_F, /* should use I when having integer support */
     INSTR_STOREP_S,
     INSTR_STOREP_F,
     INSTR_STOREP_F, /* should use I when having integer support */
     INSTR_STOREP_S,
     INSTR_STOREP_F,
@@ -138,7 +138,7 @@ uint16_t type_storep_instr[TYPE_COUNT] = {
     VINSTR_END, /* noexpr */
 };
 
     VINSTR_END, /* noexpr */
 };
 
-uint16_t type_eq_instr[TYPE_COUNT] = {
+const uint16_t type_eq_instr[TYPE_COUNT] = {
     INSTR_EQ_F, /* should use I when having integer support */
     INSTR_EQ_S,
     INSTR_EQ_F,
     INSTR_EQ_F, /* should use I when having integer support */
     INSTR_EQ_S,
     INSTR_EQ_F,
@@ -162,7 +162,7 @@ uint16_t type_eq_instr[TYPE_COUNT] = {
     VINSTR_END, /* noexpr */
 };
 
     VINSTR_END, /* noexpr */
 };
 
-uint16_t type_ne_instr[TYPE_COUNT] = {
+const uint16_t type_ne_instr[TYPE_COUNT] = {
     INSTR_NE_F, /* should use I when having integer support */
     INSTR_NE_S,
     INSTR_NE_F,
     INSTR_NE_F, /* should use I when having integer support */
     INSTR_NE_S,
     INSTR_NE_F,
@@ -186,9 +186,9 @@ uint16_t type_ne_instr[TYPE_COUNT] = {
     VINSTR_END, /* noexpr */
 };
 
     VINSTR_END, /* noexpr */
 };
 
-uint16_t type_not_instr[TYPE_COUNT] = {
+const uint16_t type_not_instr[TYPE_COUNT] = {
     INSTR_NOT_F, /* should use I when having integer support */
     INSTR_NOT_F, /* should use I when having integer support */
-    INSTR_NOT_S,
+    VINSTR_END,  /* not to be used, depends on string related -f flags */
     INSTR_NOT_F,
     INSTR_NOT_V,
     INSTR_NOT_ENT,
     INSTR_NOT_F,
     INSTR_NOT_V,
     INSTR_NOT_ENT,
diff --git a/main.c b/main.c
index 0a22b1bada1716cdf55a6d389f71dd9294a27701..60780efe1cb5db4eeb6455c24ad55e161f5194f0 100644 (file)
--- a/main.c
+++ b/main.c
@@ -643,9 +643,6 @@ int main(int argc, char **argv) {
         }
     }
 
         }
     }
 
-    if (OPTS_FLAG(TRUE_EMPTY_STRINGS))
-        type_not_instr[TYPE_STRING] = INSTR_NOT_F;
-
     util_debug("COM", "starting ...\n");
 
     /* add macros */
     util_debug("COM", "starting ...\n");
 
     /* add macros */