summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2020-11-10 17:10:57 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-11 18:37:36 +0000
commite2dfdb09d970143b521a9c6f316ebe09159988ed (patch)
tree02fc659853834812b28387060aed74e0ad722bdb
parent737d4205a62c4b70ad33a6fbd547f5cb3f2b888c (diff)
downloadchrome-ec-e2dfdb09d970143b521a9c6f316ebe09159988ed.tar.gz
tree: rename strtoul to strtoull since it is 64-bit
A long is 32-bit, but a long long is 64-bit. The function name should be strtoull if it is returning 64 bits of data. BRANCH=none BUG=b:172592963 TEST=builds Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I04c40f9256ed37eb1cf9b6bd1b0ef0320fe49b0c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2530874 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--common/host_event_commands.c2
-rw-r--r--common/mkbp_event.c2
-rw-r--r--common/util.c4
-rw-r--r--extra/ftdi_hostcmd/test_cmds.c4
-rw-r--r--extra/touchpad_updater/touchpad_updater.c6
-rw-r--r--extra/usb_console/usb_console.c6
-rw-r--r--extra/usb_updater/usb_updater2.c4
-rw-r--r--include/util.h2
-rw-r--r--test/utils_str.c54
-rw-r--r--util/cbi-util.c8
-rw-r--r--util/ectool.c38
-rw-r--r--util/iteflash.c4
-rw-r--r--util/kconfig/expr.c2
-rw-r--r--util/kconfig/preprocess.c2
-rw-r--r--util/lbcc.c4
-rw-r--r--util/uut/main.c10
-rw-r--r--util/uut/opr.c2
17 files changed, 78 insertions, 76 deletions
diff --git a/common/host_event_commands.c b/common/host_event_commands.c
index 665a268ec4..ae2026efaf 100644
--- a/common/host_event_commands.c
+++ b/common/host_event_commands.c
@@ -459,7 +459,7 @@ static int command_host_event(int argc, char **argv)
/* Handle sub-commands */
if (argc == 3) {
char *e;
- host_event_t i = strtoul(argv[2], &e, 0);
+ host_event_t i = strtoull(argv[2], &e, 0);
if (*e)
return EC_ERROR_PARAM2;
diff --git a/common/mkbp_event.c b/common/mkbp_event.c
index f640a9340c..a5fe5635c6 100644
--- a/common/mkbp_event.c
+++ b/common/mkbp_event.c
@@ -479,7 +479,7 @@ static int command_mkbp_wake_mask(int argc, char **argv)
{
if (argc == 3) {
char *e;
- uint32_t new_mask = strtoul(argv[2], &e, 0);
+ uint32_t new_mask = strtoull(argv[2], &e, 0);
if (*e)
return EC_ERROR_PARAM2;
diff --git a/common/util.c b/common/util.c
index ed5b87c2c9..6188afc937 100644
--- a/common/util.c
+++ b/common/util.c
@@ -191,7 +191,8 @@ __stdlib_compat int strtoi(const char *nptr, char **endptr, int base)
return neg ? -result : result;
}
-__stdlib_compat uint64_t strtoul(const char *nptr, char **endptr, int base)
+__stdlib_compat unsigned long long int strtoull(const char *nptr, char **endptr,
+ int base)
{
uint64_t result = 0;
int c = '\0';
@@ -226,6 +227,7 @@ __stdlib_compat uint64_t strtoul(const char *nptr, char **endptr, int base)
*endptr = (char *)nptr - 1;
return result;
}
+BUILD_ASSERT(sizeof(unsigned long long int) == sizeof(uint64_t));
__stdlib_compat int parse_bool(const char *s, int *dest)
{
diff --git a/extra/ftdi_hostcmd/test_cmds.c b/extra/ftdi_hostcmd/test_cmds.c
index 9ee27cd6d4..4552476d0f 100644
--- a/extra/ftdi_hostcmd/test_cmds.c
+++ b/extra/ftdi_hostcmd/test_cmds.c
@@ -596,9 +596,9 @@ int main(int argc, char *argv[])
/* Range (no error checking) */
if (optind < argc)
- start = (uint16_t)strtoul(argv[optind++], 0, 0);
+ start = (uint16_t)strtoull(argv[optind++], 0, 0);
if (optind < argc)
- stop = (uint16_t)strtoul(argv[optind++], 0, 0);
+ stop = (uint16_t)strtoull(argv[optind++], 0, 0);
/* Find something to talk to */
mpsse = MPSSE(SPI0, 1000000, 0);
diff --git a/extra/touchpad_updater/touchpad_updater.c b/extra/touchpad_updater/touchpad_updater.c
index 598f7638e1..985ab1ca46 100644
--- a/extra/touchpad_updater/touchpad_updater.c
+++ b/extra/touchpad_updater/touchpad_updater.c
@@ -91,21 +91,21 @@ static void parse_cmdline(int argc, char *argv[])
firmware_binary = optarg;
break;
case 'p':
- pid = (uint16_t) strtoul(optarg, &e, 16);
+ pid = (uint16_t) strtoull(optarg, &e, 16);
if (!*optarg || (e && *e)) {
printf("Invalid argument: \"%s\"\n", optarg);
errorcnt++;
}
break;
case 'v':
- vid = (uint16_t) strtoul(optarg, &e, 16);
+ vid = (uint16_t) strtoull(optarg, &e, 16);
if (!*optarg || (e && *e)) {
printf("Invalid argument: \"%s\"\n", optarg);
errorcnt++;
}
break;
case 'e':
- ep_num = (uint8_t) strtoul(optarg, &e, 0);
+ ep_num = (uint8_t) strtoull(optarg, &e, 0);
if (!*optarg || (e && *e)) {
printf("Invalid argument: \"%s\"\n", optarg);
errorcnt++;
diff --git a/extra/usb_console/usb_console.c b/extra/usb_console/usb_console.c
index 7d99bc3082..3599076a23 100644
--- a/extra/usb_console/usb_console.c
+++ b/extra/usb_console/usb_console.c
@@ -279,21 +279,21 @@ int main(int argc, char *argv[])
while ((i = getopt_long(argc, argv, short_opts, long_opts, 0)) != -1) {
switch (i) {
case 'p':
- pid = (uint16_t) strtoul(optarg, &e, 16);
+ pid = (uint16_t) strtoull(optarg, &e, 16);
if (!*optarg || (e && *e)) {
printf("Invalid argument: \"%s\"\n", optarg);
errorcnt++;
}
break;
case 'v':
- vid = (uint16_t) strtoul(optarg, &e, 16);
+ vid = (uint16_t) strtoull(optarg, &e, 16);
if (!*optarg || (e && *e)) {
printf("Invalid argument: \"%s\"\n", optarg);
errorcnt++;
}
break;
case 'e':
- ep_num = (uint8_t) strtoul(optarg, &e, 0);
+ ep_num = (uint8_t) strtoull(optarg, &e, 0);
if (!*optarg || (e && *e)) {
printf("Invalid argument: \"%s\"\n", optarg);
errorcnt++;
diff --git a/extra/usb_updater/usb_updater2.c b/extra/usb_updater/usb_updater2.c
index 10bfeee7bb..971a977e55 100644
--- a/extra/usb_updater/usb_updater2.c
+++ b/extra/usb_updater/usb_updater2.c
@@ -377,11 +377,11 @@ static int parse_vidpid(const char *input, uint16_t *vid_ptr, uint16_t *pid_ptr)
return 0;
*s++ = '\0';
- *vid_ptr = (uint16_t) strtoul(copy, &e, 16);
+ *vid_ptr = (uint16_t) strtoull(copy, &e, 16);
if (!*optarg || (e && *e))
return 0;
- *pid_ptr = (uint16_t) strtoul(s, &e, 16);
+ *pid_ptr = (uint16_t) strtoull(s, &e, 16);
if (!*optarg || (e && *e))
return 0;
diff --git a/include/util.h b/include/util.h
index 47524e8b96..ffb4c0e10d 100644
--- a/include/util.h
+++ b/include/util.h
@@ -127,7 +127,7 @@ int strtoi(const char *nptr, char **endptr, int base);
/* TODO(b/172592963): This should be unsigned long, and conflicts with Zephyr */
#ifndef CONFIG_ZEPHYR
-uint64_t strtoul(const char *nptr, char **endptr, int base);
+unsigned long long int strtoull(const char *nptr, char **endptr, int base);
#endif
/* Like strncpy(), but guarantees null termination. */
diff --git a/test/utils_str.c b/test/utils_str.c
index 2a68f6c35f..c592f6100a 100644
--- a/test/utils_str.c
+++ b/test/utils_str.c
@@ -99,59 +99,59 @@ static int test_strtoi(void)
return EC_SUCCESS;
}
-static int test_strtoul(void)
+static int test_strtoull(void)
{
char *e;
- TEST_ASSERT(strtoul("10", &e, 0) == 10);
+ TEST_ASSERT(strtoull("10", &e, 0) == 10);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("010", &e, 0) == 8);
+ TEST_ASSERT(strtoull("010", &e, 0) == 8);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("+010", &e, 0) == 8);
+ TEST_ASSERT(strtoull("+010", &e, 0) == 8);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("-010", &e, 0) == 0);
+ TEST_ASSERT(strtoull("-010", &e, 0) == 0);
TEST_ASSERT(e && (*e == '-'));
- TEST_ASSERT(strtoul("0x1f z", &e, 0) == 31);
+ TEST_ASSERT(strtoull("0x1f z", &e, 0) == 31);
TEST_ASSERT(e && (*e == ' '));
- TEST_ASSERT(strtoul("0X1f z", &e, 0) == 31);
+ TEST_ASSERT(strtoull("0X1f z", &e, 0) == 31);
TEST_ASSERT(e && (*e == ' '));
- TEST_ASSERT(strtoul("10a", &e, 16) == 266);
+ TEST_ASSERT(strtoull("10a", &e, 16) == 266);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("0x02C", &e, 16) == 44);
+ TEST_ASSERT(strtoull("0x02C", &e, 16) == 44);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("+0x02C", &e, 16) == 44);
+ TEST_ASSERT(strtoull("+0x02C", &e, 16) == 44);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("-0x02C", &e, 16) == 0);
+ TEST_ASSERT(strtoull("-0x02C", &e, 16) == 0);
TEST_ASSERT(e && (*e == '-'));
- TEST_ASSERT(strtoul("0x02C", &e, 0) == 44);
+ TEST_ASSERT(strtoull("0x02C", &e, 0) == 44);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("+0x02C", &e, 0) == 44);
+ TEST_ASSERT(strtoull("+0x02C", &e, 0) == 44);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("-0x02C", &e, 0) == 0);
+ TEST_ASSERT(strtoull("-0x02C", &e, 0) == 0);
TEST_ASSERT(e && (*e == '-'));
- TEST_ASSERT(strtoul("0X02C", &e, 16) == 44);
+ TEST_ASSERT(strtoull("0X02C", &e, 16) == 44);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("+0X02C", &e, 16) == 44);
+ TEST_ASSERT(strtoull("+0X02C", &e, 16) == 44);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("-0X02C", &e, 16) == 0);
+ TEST_ASSERT(strtoull("-0X02C", &e, 16) == 0);
TEST_ASSERT(e && (*e == '-'));
- TEST_ASSERT(strtoul("0X02C", &e, 0) == 44);
+ TEST_ASSERT(strtoull("0X02C", &e, 0) == 44);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("+0X02C", &e, 0) == 44);
+ TEST_ASSERT(strtoull("+0X02C", &e, 0) == 44);
TEST_ASSERT(e && (*e == '\0'));
- TEST_ASSERT(strtoul("-0X02C", &e, 0) == 0);
+ TEST_ASSERT(strtoull("-0X02C", &e, 0) == 0);
TEST_ASSERT(e && (*e == '-'));
- TEST_ASSERT(strtoul(" -12", &e, 0) == 0);
+ TEST_ASSERT(strtoull(" -12", &e, 0) == 0);
TEST_ASSERT(e && (*e == '-'));
- TEST_ASSERT(strtoul("!", &e, 0) == 0);
+ TEST_ASSERT(strtoull("!", &e, 0) == 0);
TEST_ASSERT(e && (*e == '!'));
- TEST_ASSERT(strtoul("+!", &e, 0) == 0);
+ TEST_ASSERT(strtoull("+!", &e, 0) == 0);
TEST_ASSERT(e && (*e == '!'));
- TEST_ASSERT(strtoul("+0!", &e, 0) == 0);
+ TEST_ASSERT(strtoull("+0!", &e, 0) == 0);
TEST_ASSERT(e && (*e == '!'));
- TEST_ASSERT(strtoul("+0x!", &e, 0) == 0);
+ TEST_ASSERT(strtoull("+0x!", &e, 0) == 0);
TEST_ASSERT(e && (*e == '!'));
- TEST_ASSERT(strtoul("+0X!", &e, 0) == 0);
+ TEST_ASSERT(strtoull("+0X!", &e, 0) == 0);
TEST_ASSERT(e && (*e == '!'));
return EC_SUCCESS;
@@ -268,7 +268,7 @@ void run_test(int argc, char **argv)
RUN_TEST(test_isprint);
RUN_TEST(test_strstr);
RUN_TEST(test_strtoi);
- RUN_TEST(test_strtoul);
+ RUN_TEST(test_strtoull);
RUN_TEST(test_parse_bool);
RUN_TEST(test_strzcpy);
RUN_TEST(test_strncpy);
diff --git a/util/cbi-util.c b/util/cbi-util.c
index 3626b52859..54782f8bad 100644
--- a/util/cbi-util.c
+++ b/util/cbi-util.c
@@ -221,7 +221,7 @@ static int parse_integer_field(const char *arg, struct integer_field *f)
char *e;
char *ch;
- val = strtoul(arg, &e, 0);
+ val = strtoull(arg, &e, 0);
if (val > UINT32_MAX || !*arg || (e && *e && *e != ':')) {
fprintf(stderr, "Invalid integer value\n");
return -1;
@@ -231,7 +231,7 @@ static int parse_integer_field(const char *arg, struct integer_field *f)
ch = strchr(arg, ':');
if (ch) {
ch++;
- val = strtoul(ch, &e , 0);
+ val = strtoull(ch, &e, 0);
if (val < 1 || 4 < val || !*ch || (e && *e)) {
fprintf(stderr, "Invalid size suffix\n");
return -1;
@@ -291,7 +291,7 @@ static int cmd_create(int argc, char **argv)
set_mask |= ARGS_MASK_BOARD_VERSION;
break;
case OPT_ERASE_BYTE:
- erase = strtoul(optarg, &e, 0);
+ erase = strtoull(optarg, &e, 0);
if (!*optarg || (e && *e)) {
fprintf(stderr, "Invalid --erase_byte\n");
return -1;
@@ -306,7 +306,7 @@ static int cmd_create(int argc, char **argv)
return -1;
break;
case OPT_SIZE:
- val = strtoul(optarg, &e, 0);
+ val = strtoull(optarg, &e, 0);
if (val > UINT16_MAX || !*optarg || (e && *e)) {
fprintf(stderr, "Invalid --size\n");
return -1;
diff --git a/util/ectool.c b/util/ectool.c
index de2800745b..2cd71eb3d4 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -454,7 +454,7 @@ int cmd_adc_read(int argc, char *argv[])
return -1;
}
- p.adc_channel = (uint8_t)strtoul(argv[1], &e, 0);
+ p.adc_channel = (uint8_t)strtoull(argv[1], &e, 0);
if (e && *e) {
fprintf(stderr, "\"%s\": invalid channel!\n", argv[1]);
return -1;
@@ -539,7 +539,7 @@ int cmd_hibdelay(int argc, char *argv[])
if (argc < 2) {
p.seconds = 0; /* Just read the current settings. */
} else {
- p.seconds = strtoul(argv[1], &e, 0);
+ p.seconds = strtoull(argv[1], &e, 0);
if (e && *e) {
fprintf(stderr, "invalid number\n");
return -1;
@@ -603,7 +603,7 @@ static int cmd_hostevent(int argc, char *argv[])
return -1;
}
p.action = EC_HOST_EVENT_SET;
- p.value = strtoul(argv[3], &e, 0);
+ p.value = strtoull(argv[3], &e, 0);
if (e && *e) {
fprintf(stderr, "Bad value\n");
return -1;
@@ -698,7 +698,7 @@ int cmd_hostsleepstate(int argc, char *argv[])
if (argc > 2) {
p1.suspend_params.sleep_timeout_ms =
- strtoul(argv[2], &afterscan, 0);
+ strtoull(argv[2], &afterscan, 0);
if ((*afterscan != '\0') ||
(afterscan == argv[2])) {
@@ -4823,7 +4823,7 @@ static int cmd_lightbar(int argc, char **argv)
int rv;
if (argc > 2) {
param.set_brightness.num = 0xff &
- strtoul(argv[2], &e, 16);
+ strtoull(argv[2], &e, 16);
return lb_do_cmd(LIGHTBAR_CMD_SET_BRIGHTNESS,
&param, &resp);
}
@@ -4862,7 +4862,7 @@ static int cmd_lightbar(int argc, char **argv)
uint8_t num;
if (argc == 2)
return lb_show_msg_names();
- num = 0xff & strtoul(argv[2], &e, 16);
+ num = 0xff & strtoull(argv[2], &e, 16);
if (e && *e)
num = lb_find_msg_by_name(argv[2]);
if (num >= LIGHTBAR_NUM_SEQUENCES) {
@@ -4880,25 +4880,25 @@ static int cmd_lightbar(int argc, char **argv)
if (argc == 4) {
char *e;
- param.reg.ctrl = 0xff & strtoul(argv[1], &e, 16);
- param.reg.reg = 0xff & strtoul(argv[2], &e, 16);
- param.reg.value = 0xff & strtoul(argv[3], &e, 16);
+ param.reg.ctrl = 0xff & strtoull(argv[1], &e, 16);
+ param.reg.reg = 0xff & strtoull(argv[2], &e, 16);
+ param.reg.value = 0xff & strtoull(argv[3], &e, 16);
return lb_do_cmd(LIGHTBAR_CMD_REG, &param, &resp);
}
if (argc == 5) {
char *e;
- param.set_rgb.led = strtoul(argv[1], &e, 16);
- param.set_rgb.red = strtoul(argv[2], &e, 16);
- param.set_rgb.green = strtoul(argv[3], &e, 16);
- param.set_rgb.blue = strtoul(argv[4], &e, 16);
+ param.set_rgb.led = strtoull(argv[1], &e, 16);
+ param.set_rgb.red = strtoull(argv[2], &e, 16);
+ param.set_rgb.green = strtoull(argv[3], &e, 16);
+ param.set_rgb.blue = strtoull(argv[4], &e, 16);
return lb_do_cmd(LIGHTBAR_CMD_SET_RGB, &param, &resp);
}
/* Only thing left is to try to read an LED value */
if (argc == 2) {
char *e;
- param.get_rgb.led = strtoul(argv[1], &e, 0);
+ param.get_rgb.led = strtoull(argv[1], &e, 0);
if (!(e && *e)) {
r = lb_do_cmd(LIGHTBAR_CMD_GET_RGB, &param, &resp);
if (r)
@@ -7503,7 +7503,7 @@ static int cmd_charge_state(int argc, char **argv)
if (!strcasecmp(argv[2], "help"))
break;
param.cmd = CHARGE_STATE_CMD_GET_PARAM;
- p = strtoul(argv[2], &e, 0);
+ p = strtoull(argv[2], &e, 0);
if (e && *e) {
fprintf(stderr, "Bad param: %s\n", argv[2]);
return -1;
@@ -7521,12 +7521,12 @@ static int cmd_charge_state(int argc, char **argv)
return 0;
case 4:
param.cmd = CHARGE_STATE_CMD_SET_PARAM;
- p = strtoul(argv[2], &e, 0);
+ p = strtoull(argv[2], &e, 0);
if (e && *e) {
fprintf(stderr, "Bad param: %s\n", argv[2]);
return -1;
}
- v = strtoul(argv[3], &e, 0);
+ v = strtoull(argv[3], &e, 0);
if (e && *e) {
fprintf(stderr, "Bad value: %s\n", argv[3]);
return -1;
@@ -10310,7 +10310,7 @@ int main(int argc, char *argv[])
break;
case OPT_DEV:
- dev = strtoul(optarg, &e, 0);
+ dev = strtoull(optarg, &e, 0);
if (!*optarg || (e && *e)) {
fprintf(stderr, "Invalid --dev\n");
parse_error = 1;
@@ -10336,7 +10336,7 @@ int main(int argc, char *argv[])
device_name[40] = '\0';
break;
case OPT_I2C_BUS:
- i2c_bus = strtoul(optarg, &e, 0);
+ i2c_bus = strtoull(optarg, &e, 0);
if (*optarg == '\0' || (e && *e != '\0')
|| i2c_bus < 0) {
fprintf(stderr, "Invalid --i2c_bus\n");
diff --git a/util/iteflash.c b/util/iteflash.c
index 799ad3ca70..8b85482340 100644
--- a/util/iteflash.c
+++ b/util/iteflash.c
@@ -2122,7 +2122,7 @@ static int parse_range_options(char *str, struct iteflash_config *conf)
return -1;
}
- conf->range_base = strtoul(str, &size, 16);
+ conf->range_base = strtoull(str, &size, 16);
if (!size || !*size)
return 0;
@@ -2136,7 +2136,7 @@ static int parse_range_options(char *str, struct iteflash_config *conf)
return -1;
}
- conf->range_size = strtoul(size, &size, 16);
+ conf->range_size = strtoull(size, &size, 16);
if ((size && *size) || !conf->range_size) {
fprintf(stderr, "wrong range size specification\n");
return -1;
diff --git a/util/kconfig/expr.c b/util/kconfig/expr.c
index 77ffff3a05..7fbb7fc731 100644
--- a/util/kconfig/expr.c
+++ b/util/kconfig/expr.c
@@ -1009,7 +1009,7 @@ static enum string_value_kind expr_parse_string(const char *str,
kind = k_signed;
break;
case S_HEX:
- val->u = strtoull(str, &tail, 16);
+ val->u = strtoulll(str, &tail, 16);
kind = k_unsigned;
break;
default:
diff --git a/util/kconfig/preprocess.c b/util/kconfig/preprocess.c
index 67b9731a0a..b5eb09c197 100644
--- a/util/kconfig/preprocess.c
+++ b/util/kconfig/preprocess.c
@@ -360,7 +360,7 @@ static char *eval_clause(const char *str, size_t len, int argc, char *argv[])
* from a user-function call (i.e. local-scope variable). If not
* available, then look-up global-scope variables.
*/
- n = strtoul(tmp, &endptr, 10);
+ n = strtoull(tmp, &endptr, 10);
if (!*endptr && n > 0 && n <= argc) {
res = xstrdup(argv[n - 1]);
goto free_tmp;
diff --git a/util/lbcc.c b/util/lbcc.c
index 1a201e90d8..c0bde684da 100644
--- a/util/lbcc.c
+++ b/util/lbcc.c
@@ -291,7 +291,7 @@ static int split_line(char *buf, char *delim, struct parse_s *elt, int max)
i < max && (w = strtok_r(ptr, delim, &buf_savetok)) != 0;
ptr = 0, i++) {
elt[i].word = w;
- elt[i].val = (uint32_t)strtoul(w, &e, 0);
+ elt[i].val = (uint32_t)strtoull(w, &e, 0);
if (!e || !*e)
elt[i].is_num = 1;
@@ -315,7 +315,7 @@ static int is_led_set(char *buf, uint8_t *valp)
buf++;
for (;;) {
- next_led = strtoul(buf, &ptr, 0);
+ next_led = strtoull(buf, &ptr, 0);
if (buf == ptr) {
if (buf[0] == '}' && buf[1] == 0) {
*valp = led;
diff --git a/util/uut/main.c b/util/uut/main.c
index 94f8cd66c8..3a8204390e 100644
--- a/util/uut/main.c
+++ b/util/uut/main.c
@@ -441,7 +441,7 @@ int main(int argc, char *argv[])
/* Write buffer data to chosen address */
if (strcmp(opr_name, OPR_WRITE_MEM) == 0) {
- addr = strtoul(addr_str, &stop_str, 0);
+ addr = strtoull(addr_str, &stop_str, 0);
if (console) {
/*
@@ -468,21 +468,21 @@ int main(int argc, char *argv[])
} else if (strcmp(opr_name, OPR_READ_MEM) == 0) {
/* Read data to chosen address */
- addr = strtoul(addr_str, &stop_str, 0);
- size = strtoul(size_str, &stop_str, 0);
+ addr = strtoull(addr_str, &stop_str, 0);
+ size = strtoull(size_str, &stop_str, 0);
opr_read_mem(file_name, addr, size);
} else if (strcmp(opr_name, OPR_EXECUTE_EXIT) == 0) {
/* Execute From Address a non-return code */
- addr = strtoul(addr_str, &stop_str, 0);
+ addr = strtoull(addr_str, &stop_str, 0);
opr_execute_exit(addr);
exit_uart_app(EC_OK);
} else if (strcmp(opr_name, OPR_EXECUTE_CONT) == 0) {
/* Execute From Address a returnable code */
- addr = strtoul(addr_str, &stop_str, 0);
+ addr = strtoull(addr_str, &stop_str, 0);
opr_execute_return(addr);
} else {
diff --git a/util/uut/opr.c b/util/uut/opr.c
index bc60898ce4..fc1101c011 100644
--- a/util/uut/opr.c
+++ b/util/uut/opr.c
@@ -239,7 +239,7 @@ void opr_write_mem(uint8_t *buffer, uint32_t addr, uint32_t size)
* data buffer
*/
(*(uint32_t *)data_buf) =
- strtoul(token, &stop_str, BASE_HEXADECIMAL);
+ strtoull(token, &stop_str, BASE_HEXADECIMAL);
/* Prepare the next iteration */
token = strtok(NULL, seps);