2
0
mirror of https://github.com/Genymobile/scrcpy synced 2025-08-30 22:05:12 +00:00

Improve string util API

Use prefixed names and improve documentation.
This commit is contained in:
Romain Vimont
2021-11-12 23:08:19 +01:00
parent 9a0bd545d5
commit 979ce64dc0
12 changed files with 169 additions and 134 deletions

View File

@@ -779,9 +779,9 @@ parse_integer_arg(const char *s, long *out, bool accept_suffix, long min,
long value;
bool ok;
if (accept_suffix) {
ok = parse_integer_with_suffix(s, &value);
ok = sc_str_parse_integer_with_suffix(s, &value);
} else {
ok = parse_integer(s, &value);
ok = sc_str_parse_integer(s, &value);
}
if (!ok) {
LOGE("Could not parse %s: %s", name, s);
@@ -801,7 +801,7 @@ parse_integer_arg(const char *s, long *out, bool accept_suffix, long min,
static size_t
parse_integers_arg(const char *s, size_t max_items, long *out, long min,
long max, const char *name) {
size_t count = parse_integers(s, ':', max_items, out);
size_t count = sc_str_parse_integers(s, ':', max_items, out);
if (!count) {
LOGE("Could not parse %s: %s", name, s);
return 0;