From: Jay Krell Date: Fri, 16 Aug 2019 08:37:20 +0000 (-0700) Subject: intepreter: remove last element from various arrays (mono/mono#16134) X-Git-Tag: submit/tizen/20210909.063632~10331^2~5^2~766 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5a653bbe6f961820a85e9e84db5efb0d3cf3722;p=platform%2Fupstream%2Fdotnet%2Fruntime.git intepreter: remove last element from various arrays (mono/mono#16134) add const combine lines for searchability Commit migrated from https://github.com/mono/mono/commit/0c637a73a9663bf6ca984037c4a5eac16ac91913 --- diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 3c4f815..b5aadd3 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -3193,11 +3193,10 @@ interp_exec_method_full (InterpFrame *frame, ThreadContext *context, FrameClause MonoObject *o = NULL; MonoClass *c; #if USE_COMPUTED_GOTO - static void *in_labels[] = { -#define OPDEF(a,b,c,d) \ - &&LAB_ ## a, + static void * const in_labels[] = { +#define OPDEF(a,b,c,d) &&LAB_ ## a, #include "mintops.def" - 0 }; + }; #endif frame->ex = NULL; diff --git a/src/mono/mono/mini/interp/mintops.c b/src/mono/mono/mini/interp/mintops.c index 1a6321d..af1351c 100644 --- a/src/mono/mono/mini/interp/mintops.c +++ b/src/mono/mono/mini/interp/mintops.c @@ -10,28 +10,22 @@ #include #include "mintops.h" -#define OPDEF(a,b,c,d) \ - b, -const char *mono_interp_opname[] = { +#define OPDEF(a,b,c,d) b, +const char * const mono_interp_opname [] = { #include "mintops.def" - "" }; #undef OPDEF -#define OPDEF(a,b,c,d) \ - c, -unsigned char mono_interp_oplen[] = { +#define OPDEF(a,b,c,d) c, +unsigned char const mono_interp_oplen [] = { #include "mintops.def" - 0 }; #undef OPDEF -#define OPDEF(a,b,c,d) \ - d, -MintOpArgType mono_interp_opargtype[] = { +#define OPDEF(a,b,c,d) d, +MintOpArgType const mono_interp_opargtype [] = { #include "mintops.def" - (MintOpArgType)0 }; #undef OPDEF diff --git a/src/mono/mono/mini/interp/mintops.h b/src/mono/mono/mini/interp/mintops.h index 2920224..e6a1203 100644 --- a/src/mono/mono/mini/interp/mintops.h +++ b/src/mono/mono/mini/interp/mintops.h @@ -26,11 +26,9 @@ typedef enum MintOpShortAndInt } MintOpArgType; -#define OPDEF(a,b,c,d) \ - a, +#define OPDEF(a,b,c,d) a, enum { #include "mintops.def" - MINT_LASTOP }; #undef OPDEF @@ -55,9 +53,9 @@ enum { #define MINT_SWITCH_LEN(n) (3 + (n) * 2) -extern const char *mono_interp_opname[]; -extern unsigned char mono_interp_oplen[]; -extern MintOpArgType mono_interp_opargtype[]; +extern const char * const mono_interp_opname[]; +extern unsigned char const mono_interp_oplen[]; +extern MintOpArgType const mono_interp_opargtype[]; extern char* mono_interp_dis_mintop(const unsigned short *base, const guint16 *ip); extern const guint16* mono_interp_dis_mintop_len (const guint16 *ip);