summaryrefslogtreecommitdiff
path: root/examples/cmdline
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2014-06-24 11:15:28 -0700
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-06-27 02:31:24 +0200
commit6f41fe75e2dd8dd38f7bea7b9501edd4f9b72fa5 (patch)
tree38546261dbaf75edcf31bc3ccdad61f84f666590 /examples/cmdline
parente8ed6c78177fbbafa326d9efc590a51705848200 (diff)
downloaddpdk-6f41fe75e2dd8dd38f7bea7b9501edd4f9b72fa5.zip
dpdk-6f41fe75e2dd8dd38f7bea7b9501edd4f9b72fa5.tar.gz
dpdk-6f41fe75e2dd8dd38f7bea7b9501edd4f9b72fa5.tar.xz
eal: deprecate rte_snprintf
The function rte_snprintf serves no useful purpose. It is the same as snprintf() for all valid inputs. Deprecate it and replace all uses in current code. Leave the tests for the deprecated function in place. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Diffstat (limited to 'examples/cmdline')
-rw-r--r--examples/cmdline/commands.c10
-rw-r--r--examples/cmdline/parse_obj_list.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/examples/cmdline/commands.c b/examples/cmdline/commands.c
index fe82be5..8c6c11b 100644
--- a/examples/cmdline/commands.c
+++ b/examples/cmdline/commands.c
@@ -134,10 +134,10 @@ static void cmd_obj_del_show_parsed(void *parsed_result,
char ip_str[INET6_ADDRSTRLEN];
if (res->obj->ip.family == AF_INET)
- rte_snprintf(ip_str, sizeof(ip_str), NIPQUAD_FMT,
+ snprintf(ip_str, sizeof(ip_str), NIPQUAD_FMT,
NIPQUAD(res->obj->ip.addr.ipv4));
else
- rte_snprintf(ip_str, sizeof(ip_str), NIP6_FMT,
+ snprintf(ip_str, sizeof(ip_str), NIP6_FMT,
NIP6(res->obj->ip.addr.ipv6));
if (strcmp(res->action, "del") == 0) {
@@ -199,15 +199,15 @@ static void cmd_obj_add_parsed(void *parsed_result,
cmdline_printf(cl, "mem error\n");
return;
}
- rte_snprintf(o->name, sizeof(o->name), "%s", res->name);
+ snprintf(o->name, sizeof(o->name), "%s", res->name);
o->ip = res->ip;
SLIST_INSERT_HEAD(&global_obj_list, o, next);
if (o->ip.family == AF_INET)
- rte_snprintf(ip_str, sizeof(ip_str), NIPQUAD_FMT,
+ snprintf(ip_str, sizeof(ip_str), NIPQUAD_FMT,
NIPQUAD(o->ip.addr.ipv4));
else
- rte_snprintf(ip_str, sizeof(ip_str), NIP6_FMT,
+ snprintf(ip_str, sizeof(ip_str), NIP6_FMT,
NIP6(o->ip.addr.ipv6));
cmdline_printf(cl, "Object %s added, ip=%s\n",
diff --git a/examples/cmdline/parse_obj_list.c b/examples/cmdline/parse_obj_list.c
index 45a26ef..2625ca3 100644
--- a/examples/cmdline/parse_obj_list.c
+++ b/examples/cmdline/parse_obj_list.c
@@ -148,7 +148,7 @@ int complete_get_elt_obj_list(cmdline_parse_token_hdr_t *tk,
return -1;
if (dstbuf)
- rte_snprintf(dstbuf, size, "%s", o->name);
+ snprintf(dstbuf, size, "%s", o->name);
return 0;
}
@@ -157,6 +157,6 @@ int complete_get_elt_obj_list(cmdline_parse_token_hdr_t *tk,
int get_help_obj_list(__attribute__((unused)) cmdline_parse_token_hdr_t *tk,
char *dstbuf, unsigned int size)
{
- rte_snprintf(dstbuf, size, "Obj-List");
+ snprintf(dstbuf, size, "Obj-List");
return 0;
}