Skip to contentSkip to conversation

cmdline: add prefix to numeric type enums

RFC PATCH New Bruce Richardson 1 participant 1 message Apr 11, 2019

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 cmdline: add prefix to numeric type enums

The cmdline defined an enum for the various numeric type parameters, but these were missing the RTE_ prefix and so could conflict with defines in various environments, e.g. on Windows. Adding the prefix fixes these conflicts.

Note: this changes the API used by apps using cmdline, but since enum values aren't changing, it's ABI compatible.

---
 app/test-cmdline/commands.c                   |   2 +-
 app/test-pmd/bpf_cmd.c                        |   8 +-
 app/test-pmd/cmdline.c                        | 656 +++++++++---------
 app/test-pmd/cmdline_mtr.c                    |  84 +--
 app/test-pmd/cmdline_tm.c                     | 172 ++---
 app/test/test_cmdline_num.c                   |  48 +-
 doc/guides/rel_notes/release_19_05.rst        |   4 +
 examples/ethtool/ethtool-app/ethapp.c         |  18 +-
 examples/ipsec-secgw/parser.c                 |   2 +-
 examples/qos_sched/cmdline.c                  |  46 +-
 examples/quota_watermark/qwctl/commands.c     |   2 +-
 .../guest_cli/vm_power_cli_guest.c            |   2 +-
 examples/vm_power_manager/vm_power_cli.c      |   8 +-
 lib/librte_cmdline/cmdline_parse_num.c        |  40 +-
 lib/librte_cmdline/cmdline_parse_num.h        |  16 +-
 15 files changed, 556 insertions(+), 552 deletions(-)
app/test-cmdline/commands.c +1 -1
index d81da9665..0e2ca8ac4 100644
@@ -191,7 +191,7 @@ cmd_num_parsed(void *parsed_result,
 }
 
 cmdline_parse_token_num_t cmd_num_tok =
-	TOKEN_NUM_INITIALIZER(struct cmd_num_result, num, UINT32);
+	TOKEN_NUM_INITIALIZER(struct cmd_num_result, num, RTE_UINT32);
 
 cmdline_parse_inst_t cmd_num = {
 	.f = cmd_num_parsed,  /* function to call */
app/test-pmd/bpf_cmd.c +4 -4
index 830bfc13a..254290f30 100644
@@ -124,9 +124,9 @@ cmdline_parse_token_string_t cmd_load_bpf_dir =
 	TOKEN_STRING_INITIALIZER(struct cmd_bpf_ld_result,
 			dir, "rx#tx");
 cmdline_parse_token_num_t cmd_load_bpf_port =
-	TOKEN_NUM_INITIALIZER(struct cmd_bpf_ld_result, port, UINT8);
+	TOKEN_NUM_INITIALIZER(struct cmd_bpf_ld_result, port, RTE_UINT8);
 cmdline_parse_token_num_t cmd_load_bpf_queue =
-	TOKEN_NUM_INITIALIZER(struct cmd_bpf_ld_result, queue, UINT16);
+	TOKEN_NUM_INITIALIZER(struct cmd_bpf_ld_result, queue, RTE_UINT16);
 cmdline_parse_token_string_t cmd_load_bpf_flags =
 	TOKEN_STRING_INITIALIZER(struct cmd_bpf_ld_result,
 			flags, NULL);
@@ -180,9 +180,9 @@ cmdline_parse_token_string_t cmd_unload_bpf_dir =
 	TOKEN_STRING_INITIALIZER(struct cmd_bpf_unld_result,
 			dir, "rx#tx");
 cmdline_parse_token_num_t cmd_unload_bpf_port =
-	TOKEN_NUM_INITIALIZER(struct cmd_bpf_unld_result, port, UINT8);
+	TOKEN_NUM_INITIALIZER(struct cmd_bpf_unld_result, port, RTE_UINT8);
 cmdline_parse_token_num_t cmd_unload_bpf_queue =
-	TOKEN_NUM_INITIALIZER(struct cmd_bpf_unld_result, queue, UINT16);
+	TOKEN_NUM_INITIALIZER(struct cmd_bpf_unld_result, queue, RTE_UINT16);
 
 cmdline_parse_inst_t cmd_operate_bpf_unld_parse = {
 	.f = cmd_operate_bpf_unld_parsed,
app/test-pmd/cmdline.c +328 -328

2,303 lines not on this page · raw message

app/test-pmd/cmdline_mtr.c +42 -42

242 lines not on this page · raw message

app/test-pmd/cmdline_tm.c +86 -86

425 lines not on this page · raw message

app/test/test_cmdline_num.c +24 -24

48 lines not on this page · raw message

doc/guides/rel_notes/release_19_05.rst +4 -0
index dbdf07a0c..d660f441a 100644

Lines of this file are not shown. View the raw message.

examples/ethtool/ethtool-app/ethapp.c +9 -9
index a4e64b354..22f293904 100644

Lines of this file are not shown. View the raw message.

examples/ipsec-secgw/parser.c +1 -1
index b0a8ee23b..523b46d6b 100644

Lines of this file are not shown. View the raw message.

examples/qos_sched/cmdline.c +23 -23

46 lines not on this page · raw message

examples/quota_watermark/qwctl/commands.c +1 -1
index a1c646b9f..3f0cef7f1 100644

Lines of this file are not shown. View the raw message.

examples/vm_power_manager/guest_cli/vm_power_cli_guest.c +1 -1
index 2d9e7689a..82e1a0a03 100644

Lines of this file are not shown. View the raw message.

examples/vm_power_manager/vm_power_cli.c +4 -4
index 41e89ff20..98e61a4ac 100644

Lines of this file are not shown. View the raw message.

lib/librte_cmdline/cmdline_parse_num.c +20 -20
index 182ac12f0..37d094893 100644

Lines of this file are not shown. View the raw message.

lib/librte_cmdline/cmdline_parse_num.h +8 -8
index 58b28cad7..02133bb21 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.20.1

Part of the diff is not shown here. View the raw message.