blob: 3854b1133c4add96df6b4cd7da501f7152be2df0 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From 994d9575374d3cdb34b1b0f70c3c53ae76fe578e Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 26 Aug 2017 07:41:05 -0700
4Subject: [PATCH 3/3] cli: Mark return of strtol as long int
5
6strtol does not return unsigned long
7
8error: taking the absolute value of unsigned type 'unsigned long' has no effect [-Werror,-Wabsolute-value]
9 if ((*endp == '\0') && (labs(tmp) < 32768)) {
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 cli/cli_lib.c | 8 ++++----
14 1 file changed, 4 insertions(+), 4 deletions(-)
15
16diff --git a/cli/cli_lib.c b/cli/cli_lib.c
17index e4d2fd5..5f487dc 100644
18--- a/cli/cli_lib.c
19+++ b/cli/cli_lib.c
20@@ -522,7 +522,7 @@ int cli_arg_parse_int32(struct cli_node *arg, const char *val, void *result)
21 int cli_arg_parse_int16(struct cli_node *arg, const char *val, void *result)
22 {
23 int16_t *intval = result;
24- unsigned long tmp;
25+ long tmp;
26 char *endp;
27 int ret = 0;
28
29@@ -539,7 +539,7 @@ int cli_arg_parse_int16(struct cli_node *arg, const char *val, void *result)
30 int cli_arg_parse_int8(struct cli_node *arg, const char *val, void *result)
31 {
32 int8_t *intval = result;
33- unsigned long tmp;
34+ long tmp;
35 char *endp;
36 int ret = 0;
37
38@@ -573,7 +573,7 @@ int cli_arg_parse_uint32(struct cli_node *arg, const char *val, void *result)
39 int cli_arg_parse_uint16(struct cli_node *arg, const char *val, void *result)
40 {
41 uint16_t *intval = result;
42- unsigned long tmp;
43+ long tmp;
44 char *endp;
45 int ret = 0;
46
47@@ -590,7 +590,7 @@ int cli_arg_parse_uint16(struct cli_node *arg, const char *val, void *result)
48 int cli_arg_parse_uint8(struct cli_node *arg, const char *val, void *result)
49 {
50 uint8_t *intval = result;
51- unsigned long tmp;
52+ long tmp;
53 char *endp;
54 int ret = 0;
55
56--
572.14.1
58