indentation

This commit is contained in:
Christoph Baumann
2025-05-22 12:23:27 +02:00
parent 11d32ec78f
commit 6cff5a41b4

View File

@@ -18,45 +18,44 @@
namespace ams::nxboot { namespace ams::nxboot {
u32 ParseHexInteger(const char *s) { u32 ParseHexInteger(const char *s) {
u32 x = 0; u32 x = 0;
if (s[0] == '0' && s[1] == 'x') { if (s[0] == '0' && s[1] == 'x') {
s += 2; s += 2;
} }
while (true) { while (true) {
const char c = *(s++); const char c = *(s++);
if (c == '\x00') { if (c == '\x00') {
return x; return x;
} else { } else {
x <<= 4; x <<= 4;
if ('0' <= c && c <= '9') { if ('0' <= c && c <= '9') {
x |= (c - '0'); x |= (c - '0');
} else if ('a' <= c && c <= 'f') { } else if ('a' <= c && c <= 'f') {
x |= (c - 'a') + 10; x |= (c - 'a') + 10;
} else if ('A' <= c && c <= 'F') { } else if ('A' <= c && c <= 'F') {
x |= (c - 'A') + 10; x |= (c - 'A') + 10;
}
} }
} }
} }
}
u32 ParseDecimalInteger(const char *s) { u32 ParseDecimalInteger(const char *s) {
u32 x = 0; u32 x = 0;
while (true) { while (true) {
const char c = *(s++); const char c = *(s++);
if (c == '\x00') { if (c == '\x00') {
return x; return x;
} else { } else {
x *= 10; x *= 10;
if ('0' <= c && c <= '9') { if ('0' <= c && c <= '9') {
x += c - '0'; x += c - '0';
}
} }
} }
} }
}
} }