mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +00:00
More moving towards using signed types.
I'm still feeling this out, but I am starting to like the general idea.
This commit is contained in:
parent
beda478821
commit
9624b54703
48 changed files with 234 additions and 250 deletions
|
@ -11,13 +11,13 @@ static unsigned parse_uint(const String& str, bool& ok)
|
|||
return 0;
|
||||
}
|
||||
unsigned value = 0;
|
||||
for (size_t i = 0; i < str.length(); ++i) {
|
||||
for (int i = 0; i < str.length(); ++i) {
|
||||
if (str[i] < '0' || str[i] > '9') {
|
||||
ok = false;
|
||||
return 0;
|
||||
}
|
||||
value = value * 10;
|
||||
value += str[i] - '0';
|
||||
value += (unsigned)(str[i] - '0');
|
||||
}
|
||||
ok = true;
|
||||
return value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue