1
0
mirror of https://github.com/bitdefender/bddisasm.git synced 2024-11-22 07:28:07 +00:00

Make NdToText string arrays more const

This commit is contained in:
Turo Lamminen 2024-07-20 22:43:15 +03:00
parent a9819f76d0
commit ba68473703

View File

@ -9,12 +9,12 @@
#ifndef BDDISASM_NO_FORMAT #ifndef BDDISASM_NO_FORMAT
static const char *gReg8Bit[] = static const char *const gReg8Bit[] =
{ {
"al", "cl", "dl", "bl", "ah", "ch", "dh", "bh", "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh",
}; };
static const char *gReg8Bit64[] = static const char *const gReg8Bit64[] =
{ {
"al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil", "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil",
"r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b", "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b",
@ -22,7 +22,7 @@ static const char *gReg8Bit64[] =
"r24b", "r25b", "r26b", "r27b", "r28b", "r29b", "r30b", "r31b", "r24b", "r25b", "r26b", "r27b", "r28b", "r29b", "r30b", "r31b",
}; };
static const char *gReg16Bit[] = static const char *const gReg16Bit[] =
{ {
"ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "ax", "cx", "dx", "bx", "sp", "bp", "si", "di",
"r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w", "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w",
@ -30,7 +30,7 @@ static const char *gReg16Bit[] =
"r24w", "r25w", "r26w", "r27w", "r28w", "r29w", "r30w", "r31w", "r24w", "r25w", "r26w", "r27w", "r28w", "r29w", "r30w", "r31w",
}; };
static const char *gReg32Bit[] = static const char *const gReg32Bit[] =
{ {
"eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi", "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
"r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d", "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d",
@ -38,7 +38,7 @@ static const char *gReg32Bit[] =
"r24d", "r25d", "r26d", "r27d", "r28d", "r29d", "r30d", "r31d", "r24d", "r25d", "r26d", "r27d", "r28d", "r29d", "r30d", "r31d",
}; };
static const char *gReg64Bit[] = static const char *const gReg64Bit[] =
{ {
"rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi", "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
@ -46,17 +46,17 @@ static const char *gReg64Bit[] =
"r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
}; };
static const char *gRegFpu[] = static const char *const gRegFpu[] =
{ {
"st0", "st1", "st2", "st3", "st4", "st5", "st6", "st7", "st0", "st1", "st2", "st3", "st4", "st5", "st6", "st7",
}; };
static const char *gRegMmx[] = static const char *const gRegMmx[] =
{ {
"mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7", "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm6", "mm7",
}; };
static const char *gRegControl[] = static const char *const gRegControl[] =
{ {
"cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7", "cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7",
"cr8", "cr9", "cr10", "cr11", "cr12", "cr13", "cr14", "cr15", "cr8", "cr9", "cr10", "cr11", "cr12", "cr13", "cr14", "cr15",
@ -64,7 +64,7 @@ static const char *gRegControl[] =
"cr24", "cr25", "cr26", "cr27", "cr28", "cr29", "cr30", "cr31", "cr24", "cr25", "cr26", "cr27", "cr28", "cr29", "cr30", "cr31",
}; };
static const char *gRegDebug[] = static const char *const gRegDebug[] =
{ {
"dr0", "dr1", "dr2", "dr3", "dr4", "dr5", "dr6", "dr7", "dr0", "dr1", "dr2", "dr3", "dr4", "dr5", "dr6", "dr7",
"dr8", "dr9", "dr10", "dr11", "dr12", "dr13", "dr14", "dr15", "dr8", "dr9", "dr10", "dr11", "dr12", "dr13", "dr14", "dr15",
@ -72,13 +72,13 @@ static const char *gRegDebug[] =
"dr24", "dr25", "dr26", "dr27", "dr28", "dr29", "dr30", "dr31", "dr24", "dr25", "dr26", "dr27", "dr28", "dr29", "dr30", "dr31",
}; };
static const char *gRegTest[] = static const char *const gRegTest[] =
{ {
"tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7", "tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7",
"tr8", "tr9", "tr10", "tr11", "tr12", "tr13", "tr14", "tr15", "tr8", "tr9", "tr10", "tr11", "tr12", "tr13", "tr14", "tr15",
}; };
static const char *gRegXmm[] = static const char *const gRegXmm[] =
{ {
"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
"xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15", "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15",
@ -86,7 +86,7 @@ static const char *gRegXmm[] =
"xmm24", "xmm25", "xmm26", "xmm27", "xmm28", "xmm29", "xmm30", "xmm31", "xmm24", "xmm25", "xmm26", "xmm27", "xmm28", "xmm29", "xmm30", "xmm31",
}; };
static const char *gRegYmm[] = static const char *const gRegYmm[] =
{ {
"ymm0", "ymm1", "ymm2", "ymm3", "ymm4", "ymm5", "ymm6", "ymm7", "ymm0", "ymm1", "ymm2", "ymm3", "ymm4", "ymm5", "ymm6", "ymm7",
"ymm8", "ymm9", "ymm10", "ymm11", "ymm12", "ymm13", "ymm14", "ymm15", "ymm8", "ymm9", "ymm10", "ymm11", "ymm12", "ymm13", "ymm14", "ymm15",
@ -94,7 +94,7 @@ static const char *gRegYmm[] =
"ymm24", "ymm25", "ymm26", "ymm27", "ymm28", "ymm29", "ymm30", "ymm31" "ymm24", "ymm25", "ymm26", "ymm27", "ymm28", "ymm29", "ymm30", "ymm31"
}; };
static const char *gRegZmm[] = static const char *const gRegZmm[] =
{ {
"zmm0", "zmm1", "zmm2", "zmm3", "zmm4", "zmm5", "zmm6", "zmm7", "zmm0", "zmm1", "zmm2", "zmm3", "zmm4", "zmm5", "zmm6", "zmm7",
"zmm8", "zmm9", "zmm10", "zmm11", "zmm12", "zmm13", "zmm14", "zmm15", "zmm8", "zmm9", "zmm10", "zmm11", "zmm12", "zmm13", "zmm14", "zmm15",
@ -102,27 +102,27 @@ static const char *gRegZmm[] =
"zmm24", "zmm25", "zmm26", "zmm27", "zmm28", "zmm29", "zmm30", "zmm31", "zmm24", "zmm25", "zmm26", "zmm27", "zmm28", "zmm29", "zmm30", "zmm31",
}; };
static const char *gRegSeg[] = static const char *const gRegSeg[] =
{ {
"es", "cs", "ss", "ds", "fs", "gs", "segr6", "segr7", "es", "cs", "ss", "ds", "fs", "gs", "segr6", "segr7",
}; };
static const char *gRegBound[] = static const char *const gRegBound[] =
{ {
"bnd0", "bnd1", "bnd2", "bnd3", "bnd0", "bnd1", "bnd2", "bnd3",
}; };
static const char *gRegMask[] = static const char *const gRegMask[] =
{ {
"k0", "k1", "k2", "k3", "k4", "k5", "k6", "k7", "k0", "k1", "k2", "k3", "k4", "k5", "k6", "k7",
}; };
static const char *gRegTile[] = static const char *const gRegTile[] =
{ {
"tmm0", "tmm1", "tmm2", "tmm3", "tmm4", "tmm5", "tmm6", "tmm7", "tmm0", "tmm1", "tmm2", "tmm3", "tmm4", "tmm5", "tmm6", "tmm7",
}; };
static const char *gEmbeddedRounding[] = static const char *const gEmbeddedRounding[] =
{ {
"rn", "rd", "ru", "rz", "rn", "rd", "ru", "rz",
}; };