Compiling with MSVC results in errors like the one below: app/test-pmd/cmdline_flow.c(8819): error C2099: initializer is not a constant
Signed-off-by: Andre Muezerie <andre...@linux.microsoft.com> Signed-off-by: Chengwen Feng <fengcheng...@huawei.com> --- app/test-pmd/cmdline_flow.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index e1720e54d7..24323d8891 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -8812,8 +8812,6 @@ parse_vc_spec(struct context *ctx, const struct token *token, return -1; /* Parse parameter types. */ switch (ctx->curr) { - static const enum index prefix[] = NEXT_ENTRY(COMMON_PREFIX); - case ITEM_PARAM_IS: index = 0; objmask = 1; @@ -8828,7 +8826,7 @@ parse_vc_spec(struct context *ctx, const struct token *token, /* Modify next token to expect a prefix. */ if (ctx->next_num < 2) return -1; - ctx->next[ctx->next_num - 2] = prefix; + ctx->next[ctx->next_num - 2] = NEXT_ENTRY(COMMON_PREFIX); /* Fall through. */ case ITEM_PARAM_MASK: index = 2; @@ -9270,7 +9268,6 @@ parse_vc_action_rss_type(struct context *ctx, const struct token *token, const char *str, unsigned int len, void *buf, unsigned int size) { - static const enum index next[] = NEXT_ENTRY(ACTION_RSS_TYPE); struct action_rss_data *action_rss_data; unsigned int i; @@ -9296,7 +9293,7 @@ parse_vc_action_rss_type(struct context *ctx, const struct token *token, /* Repeat token. */ if (ctx->next_num == RTE_DIM(ctx->next)) return -1; - ctx->next[ctx->next_num++] = next; + ctx->next[ctx->next_num++] = NEXT_ENTRY(ACTION_RSS_TYPE); if (!ctx->object) return len; action_rss_data = ctx->object; @@ -9314,7 +9311,6 @@ parse_vc_action_rss_queue(struct context *ctx, const struct token *token, const char *str, unsigned int len, void *buf, unsigned int size) { - static const enum index next[] = NEXT_ENTRY(ACTION_RSS_QUEUE); struct action_rss_data *action_rss_data; const struct arg *arg; int ret; @@ -9347,7 +9343,7 @@ parse_vc_action_rss_queue(struct context *ctx, const struct token *token, /* Repeat token. */ if (ctx->next_num == RTE_DIM(ctx->next)) return -1; - ctx->next[ctx->next_num++] = next; + ctx->next[ctx->next_num++] = NEXT_ENTRY(ACTION_RSS_QUEUE); end: if (!ctx->object) return len; -- 2.48.1.vfs.0.0