Codechange: Use std::strto* variants everywhere (#10720)
This commit is contained in:
@@ -117,7 +117,7 @@ struct FileStringReader : StringReader {
|
||||
void FileStringReader::HandlePragma(char *str)
|
||||
{
|
||||
if (!memcmp(str, "id ", 3)) {
|
||||
this->data.next_string_id = strtoul(str + 3, nullptr, 0);
|
||||
this->data.next_string_id = std::strtoul(str + 3, nullptr, 0);
|
||||
} else if (!memcmp(str, "name ", 5)) {
|
||||
strecpy(_lang.name, str + 5, lastof(_lang.name));
|
||||
} else if (!memcmp(str, "ownname ", 8)) {
|
||||
@@ -143,14 +143,14 @@ void FileStringReader::HandlePragma(char *str)
|
||||
strecpy(_lang.digit_decimal_separator, strcmp(str, "{NBSP}") == 0 ? NBSP : str, lastof(_lang.digit_decimal_separator));
|
||||
} else if (!memcmp(str, "winlangid ", 10)) {
|
||||
const char *buf = str + 10;
|
||||
long langid = strtol(buf, nullptr, 16);
|
||||
long langid = std::strtol(buf, nullptr, 16);
|
||||
if (langid > (long)UINT16_MAX || langid < 0) {
|
||||
FatalError("Invalid winlangid {}", buf);
|
||||
}
|
||||
_lang.winlangid = (uint16)langid;
|
||||
} else if (!memcmp(str, "grflangid ", 10)) {
|
||||
const char *buf = str + 10;
|
||||
long langid = strtol(buf, nullptr, 16);
|
||||
long langid = std::strtol(buf, nullptr, 16);
|
||||
if (langid >= 0x7F || langid < 0) {
|
||||
FatalError("Invalid grflangid {}", buf);
|
||||
}
|
||||
|
@@ -309,7 +309,7 @@ bool ParseRelNum(char **buf, int *value, int *offset)
|
||||
rel = true;
|
||||
s++;
|
||||
}
|
||||
int v = strtol(s, &end, 0);
|
||||
int v = std::strtol(s, &end, 0);
|
||||
if (end == s) return false;
|
||||
if (rel || v < 0) {
|
||||
*value += v;
|
||||
@@ -319,7 +319,7 @@ bool ParseRelNum(char **buf, int *value, int *offset)
|
||||
if (offset != nullptr && *end == ':') {
|
||||
/* Take the Nth within */
|
||||
s = end + 1;
|
||||
*offset = strtol(s, &end, 0);
|
||||
*offset = std::strtol(s, &end, 0);
|
||||
if (end == s) return false;
|
||||
}
|
||||
*buf = end;
|
||||
@@ -509,7 +509,7 @@ static const CmdStruct *ParseCommandString(const char **str, char *param, int *a
|
||||
if (*s >= '0' && *s <= '9') {
|
||||
char *end;
|
||||
|
||||
*argno = strtoul(s, &end, 0);
|
||||
*argno = std::strtoul(s, &end, 0);
|
||||
if (*end != ':') StrgenFatal("missing arg #");
|
||||
s = end + 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user