From a926868dcd2e832a2d2f320fc3bca83043f3b214 Mon Sep 17 00:00:00 2001 From: Rene Nyffenegger Date: Sat, 2 Feb 2019 14:01:09 +0100 Subject: [PATCH] Use const char* --- disasm-lib/disasm_x86.c | 2 +- disasm-lib/disasm_x86.h | 2 +- disasm-lib/disasm_x86_tables.h | 34 +++++++++++++++++----------------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/disasm-lib/disasm_x86.c b/disasm-lib/disasm_x86.c index 26a5d76..0c55ba9 100644 --- a/disasm-lib/disasm_x86.c +++ b/disasm-lib/disasm_x86.c @@ -217,7 +217,7 @@ ARCHITECTURE_FORMAT_FUNCTIONS X86 = X86_FindFunctionByPrologue }; -char *X86_Registers[0xE0] = +const char *X86_Registers[0xE0] = { // Segments "es", // 0x00 diff --git a/disasm-lib/disasm_x86.h b/disasm-lib/disasm_x86.h index e64a11f..55da8b1 100644 --- a/disasm-lib/disasm_x86.h +++ b/disasm-lib/disasm_x86.h @@ -677,7 +677,7 @@ typedef enum _X86_SEGMENT SEG_MAX = 6 } X86_SEGMENT; -extern char *X86_Registers[]; +extern const char *X86_Registers[]; #pragma pack(push,1) typedef struct _MODRM diff --git a/disasm-lib/disasm_x86_tables.h b/disasm-lib/disasm_x86_tables.h index 9ddb3f4..481ab8c 100644 --- a/disasm-lib/disasm_x86_tables.h +++ b/disasm-lib/disasm_x86_tables.h @@ -133,22 +133,22 @@ ///////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////// -static char *Addressing16[8] = {"bx+si","bx+di","bp+si","bp+di","si","di","bp","bx"}; -static char *MMX_Registers[8] = {"mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7"}; -static char *SSE_Registers[8] = {"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"}; -static char *DR_Registers[8] = {"dr0", "dr1", "dr2", "dr3", "dr4", "dr5", "dr6", "dr7"}; -static char *CR_Registers[8] = {"cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7"}; -static char *TR_Registers[8] = {"tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7"}; -static char *FPU_Registers[8] = {"st(0)", "st(1)", "st(2)", "st(3)", "st(4)", "st(5)", "st(6)", "st(7)"}; -static char *Segments[8] = {"es", "cs", "ss", "ds", "fs", "gs", "ERROR", "ERROR"}; -static char *Registers8[8] = {"al", "cl", "dl", "bl", "ah", "ch", "dh", "bh" }; -static char *Registers16[8] = {"ax", "cx", "dx", "bx", "sp", "bp", "si", "di" }; -static char *Registers32[8] = {"eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi" }; -static char *REX_Registers8[16] = {"al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil", "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b" }; -static char *REX_Registers16[16] = {"ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w" }; -static char *REX_Registers32[16] = {"eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d" }; -static char *REX_Registers64[16] = {"rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" }; -static char *DataSizes[8+1] = {"byte ptr", "word ptr", "dword ptr", "6_byte ptr", "qword ptr", "10_byte ptr", "INVALID PTR", "INVALID PTR", "oword ptr"}; +static const char *Addressing16[8] = {"bx+si","bx+di","bp+si","bp+di","si","di","bp","bx"}; +static const char *MMX_Registers[8] = {"mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7"}; +static const char *SSE_Registers[8] = {"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"}; +static const char *DR_Registers[8] = {"dr0", "dr1", "dr2", "dr3", "dr4", "dr5", "dr6", "dr7"}; +static const char *CR_Registers[8] = {"cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7"}; +static const char *TR_Registers[8] = {"tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7"}; +static const char *FPU_Registers[8] = {"st(0)", "st(1)", "st(2)", "st(3)", "st(4)", "st(5)", "st(6)", "st(7)"}; +static const char *Segments[8] = {"es", "cs", "ss", "ds", "fs", "gs", "ERROR", "ERROR"}; +static const char *Registers8[8] = {"al", "cl", "dl", "bl", "ah", "ch", "dh", "bh" }; +static const char *Registers16[8] = {"ax", "cx", "dx", "bx", "sp", "bp", "si", "di" }; +static const char *Registers32[8] = {"eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi" }; +static const char *REX_Registers8[16] = {"al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil", "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b" }; +static const char *REX_Registers16[16] = {"ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w" }; +static const char *REX_Registers32[16] = {"eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d" }; +static const char *REX_Registers64[16] = {"rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15" }; +static const char *DataSizes[8+1] = {"byte ptr", "word ptr", "dword ptr", "6_byte ptr", "qword ptr", "10_byte ptr", "INVALID PTR", "INVALID PTR", "oword ptr"}; ///////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////// @@ -3651,4 +3651,4 @@ BYTE X86_Invalid_Addr64_2[0x100] = /* Fx */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* Fx */ }; -#endif // DISASM_X86_TABLES \ No newline at end of file +#endif // DISASM_X86_TABLES