mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 05:34:58 +00:00
Kernel: Change the format of /proc/all to JSON.
Update ProcessManager, top and WSCPUMonitor to handle the new format. Since the kernel is not allowed to use floating-point math, we now compile the JSON classes in AK without JsonValue::Type::Double support. To accomodate large unsigned ints, I added a JsonValue::Type::UnsignedInt.
This commit is contained in:
parent
561bfd3ed6
commit
2bd8118843
9 changed files with 128 additions and 104 deletions
|
@ -146,7 +146,9 @@ JsonValue JsonParser::parse_number()
|
|||
{
|
||||
auto number_string = extract_while([](char ch) { return ch == '-' || (ch >= '0' && ch <= '9'); });
|
||||
bool ok;
|
||||
auto value = JsonValue(number_string.to_int(ok));
|
||||
auto value = JsonValue(number_string.to_uint(ok));
|
||||
if (!ok)
|
||||
value = JsonValue(number_string.to_int(ok));
|
||||
ASSERT(ok);
|
||||
return value;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue