these can be const now

This commit is contained in:
Wolfgang Bumiller 2013-04-25 09:55:58 +02:00
parent c6f2c8fc3d
commit 73070395eb
3 changed files with 14 additions and 17 deletions

14
gmqcc.h
View file

@ -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 */

14
ir.c
View file

@ -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,

3
main.c
View file

@ -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 */