From: Andre Muezerie <andremue@linux.microsoft.com>
To: Ori Kam <orika@nvidia.com>, Aman Singh <aman.deep.singh@intel.com>
Cc: dev@dpdk.org, Andre Muezerie <andremue@linux.microsoft.com>
Subject: [PATCH 06/10] test-pmd: avoid non-constant initializer
Date: Tue, 11 Feb 2025 14:02:02 -0800 [thread overview]
Message-ID: <1739311325-14425-7-git-send-email-andremue@linux.microsoft.com> (raw)
In-Reply-To: <1739311325-14425-1-git-send-email-andremue@linux.microsoft.com>
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 <andremue@linux.microsoft.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.47.2.vfs.0.1
next prev parent reply other threads:[~2025-02-11 22:03 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-11 22:01 [PATCH 00/10] enable "app" to be compiled with MSVC Andre Muezerie
2025-02-11 22:01 ` [PATCH 01/10] eal: add workaround for __builtin_constant_p Andre Muezerie
2025-02-11 22:09 ` Stephen Hemminger
2025-02-12 0:59 ` fengchengwen
2025-02-11 22:01 ` [PATCH 02/10] test_alarm: avoid warning about different qualifiers Andre Muezerie
2025-02-12 0:59 ` fengchengwen
2025-02-11 22:01 ` [PATCH 03/10] test-pmd: fix printf format string mismatch Andre Muezerie
2025-02-11 22:10 ` Stephen Hemminger
2025-02-12 1:01 ` fengchengwen
2025-02-11 22:02 ` [PATCH 04/10] test-pmd: do explicit 64-bit shift to avoid implicit conversion Andre Muezerie
2025-02-12 1:03 ` fengchengwen
2025-02-11 22:02 ` [PATCH 05/10] test-pmd: avoid undefined behavior Andre Muezerie
2025-02-12 1:04 ` fengchengwen
2025-02-11 22:02 ` Andre Muezerie [this message]
2025-02-12 1:04 ` [PATCH 06/10] test-pmd: avoid non-constant initializer fengchengwen
2025-02-11 22:02 ` [PATCH 07/10] test-pmd: don't return value from void function Andre Muezerie
2025-02-12 1:10 ` fengchengwen
2025-02-11 22:02 ` [PATCH 08/10] test-pmd: declare lcore_count atomic when using C11 memory model Andre Muezerie
2025-02-11 22:12 ` Stephen Hemminger
2025-02-12 1:16 ` Andre Muezerie
2025-02-12 1:16 ` fengchengwen
2025-02-11 22:02 ` [PATCH 09/10] test: add workaround for __builtin_constant_p in test_memcpy_perf Andre Muezerie
2025-02-11 22:13 ` Stephen Hemminger
2025-02-12 2:07 ` Andre Muezerie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1739311325-14425-7-git-send-email-andremue@linux.microsoft.com \
--to=andremue@linux.microsoft.com \
--cc=aman.deep.singh@intel.com \
--cc=dev@dpdk.org \
--cc=orika@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).