diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/cbi-util.c | 8 | ||||
-rw-r--r-- | util/ectool.c | 38 | ||||
-rw-r--r-- | util/iteflash.c | 4 | ||||
-rw-r--r-- | util/kconfig/expr.c | 2 | ||||
-rw-r--r-- | util/kconfig/preprocess.c | 2 | ||||
-rw-r--r-- | util/lbcc.c | 4 | ||||
-rw-r--r-- | util/uut/main.c | 10 | ||||
-rw-r--r-- | util/uut/opr.c | 2 |
8 files changed, 35 insertions, 35 deletions
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, ¶m, &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, ¶m, &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, ¶m, &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, ¶m, &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); |