From: Wolfgang Bumiller Date: Thu, 25 Apr 2013 07:55:58 +0000 (+0200) Subject: these can be const now X-Git-Tag: before-library X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=commitdiff_plain;h=73070395ebdf177b456bdaf52f75a3c3a40cd416;ds=sidebyside these can be const now --- diff --git a/gmqcc.h b/gmqcc.h index ed371f5..b3ba817 100644 --- a/gmqcc.h +++ b/gmqcc.h @@ -500,9 +500,9 @@ enum { #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 @@ -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. */ -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 */ diff --git a/ir.c b/ir.c index 68186dc..40094ed 100644 --- a/ir.c +++ b/ir.c @@ -66,7 +66,7 @@ static size_t type_sizeof_[TYPE_COUNT] = { 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, @@ -90,7 +90,7 @@ uint16_t type_store_instr[TYPE_COUNT] = { 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, @@ -114,7 +114,7 @@ uint16_t field_store_instr[TYPE_COUNT] = { 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, @@ -138,7 +138,7 @@ uint16_t type_storep_instr[TYPE_COUNT] = { 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, @@ -162,7 +162,7 @@ uint16_t type_eq_instr[TYPE_COUNT] = { 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, @@ -186,9 +186,9 @@ uint16_t type_ne_instr[TYPE_COUNT] = { 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_S, + VINSTR_END, /* not to be used, depends on string related -f flags */ INSTR_NOT_F, INSTR_NOT_V, INSTR_NOT_ENT, diff --git a/main.c b/main.c index 0a22b1b..60780ef 100644 --- 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 */