Skip to content

Commit

Permalink
Constify Alpha and TriCore (#2245)
Browse files Browse the repository at this point in the history
  • Loading branch information
rth7680 authored Jan 18, 2024
1 parent 362857c commit 25a69b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions arch/Alpha/AlphaMapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "AlphaGenInstrInfo.inc"

static insn_map insns[] = {
static const insn_map insns[] = {
#include "AlphaGenCSMappingInsn.inc"
};

Expand Down Expand Up @@ -109,7 +109,7 @@ void Alpha_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id)

#ifndef CAPSTONE_DIET

static const char *insn_names[] = {
static const char * const insn_names[] = {
#include "AlphaGenCSMappingInsnName.inc"
};

Expand All @@ -133,7 +133,7 @@ const char *Alpha_insn_name(csh handle, unsigned int id)
}

#ifndef CAPSTONE_DIET
static name_map group_name_maps[] = {
static const name_map group_name_maps[] = {
{Alpha_GRP_INVALID, NULL},
{Alpha_GRP_CALL, "call"},
{Alpha_GRP_JUMP, "jump"},
Expand Down Expand Up @@ -179,4 +179,4 @@ bool Alpha_getInstruction(csh handle, const uint8_t *code,
return Result;
}

#endif
#endif
10 changes: 5 additions & 5 deletions arch/TriCore/TriCoreMapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "TriCoreGenInstrInfo.inc"

static insn_map insns[] = {
static const insn_map insns[] = {
// dummy item
{ 0,
0,
Expand All @@ -40,7 +40,7 @@ void TriCore_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id)
}

#ifndef CAPSTONE_DIET
static tricore_reg flag_regs[] = { TRICORE_REG_PSW };
static const tricore_reg flag_regs[] = { TRICORE_REG_PSW };
#endif // CAPSTONE_DIET

static inline void check_updates_flags(MCInst *MI)
Expand Down Expand Up @@ -73,14 +73,14 @@ void TriCore_set_instr_map_data(MCInst *MI)

#ifndef CAPSTONE_DIET

static const char *insn_names[] = {
static const char * const insn_names[] = {
NULL,

#include "TriCoreGenCSMappingInsnName.inc"
};

// special alias insn
static name_map alias_insn_names[] = { { 0, NULL } };
static const name_map alias_insn_names[] = { { 0, NULL } };
#endif

const char *TriCore_insn_name(csh handle, unsigned int id)
Expand All @@ -104,7 +104,7 @@ const char *TriCore_insn_name(csh handle, unsigned int id)
}

#ifndef CAPSTONE_DIET
static name_map group_name_maps[] = {
static const name_map group_name_maps[] = {
{ TRICORE_GRP_INVALID, NULL },
{ TRICORE_GRP_CALL, "call" },
{ TRICORE_GRP_JUMP, "jump" },
Expand Down

0 comments on commit 25a69b5

Please sign in to comment.