From 5abe467f7d97ceffc9032a04a543b8f31d5e778f Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 13 Aug 2023 23:34:33 +0900 Subject: [PATCH] [gamecode] Specify underlying type for opcode enums And remove the bitfield from dstatement_t. I have wanted this for over twenty years :) --- include/QF/progs/pr_comp.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/QF/progs/pr_comp.h b/include/QF/progs/pr_comp.h index 696de6218..09865b467 100644 --- a/include/QF/progs/pr_comp.h +++ b/include/QF/progs/pr_comp.h @@ -96,7 +96,7 @@ extern const char * const pr_type_name[ev_type_count]; #define RESERVED_OFS 28 -typedef enum { +typedef enum : pr_ushort_t { OP_DONE_v6p, OP_MUL_F_v6p, OP_MUL_V_v6p, @@ -432,7 +432,7 @@ typedef enum { } pr_opcode_v6p_e; #define OP_BREAK 0x8000 -typedef enum { +typedef enum : pr_ushort_t { #ifndef IN_DOXYGEN #include "QF/progs/pr_opcode.hinc" #endif @@ -489,7 +489,7 @@ extern const opcode_t pr_opcodes[512]; const opcode_t *PR_Opcode (pr_ushort_t opcode) __attribute__((const)); typedef struct dstatement_s { - pr_opcode_e op:16; // will be pr_opcode_v6p_e for older progs + pr_opcode_e op; // will be pr_opcode_v6p_e for older progs pr_ushort_t a,b,c; } GCC_STRUCT dstatement_t;