mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 00:07:34 +00:00
AK: Add global FlatPtr typedef. It's u32 or u64, based on sizeof(void*)
Use this instead of uintptr_t throughout the codebase. This makes it possible to pass a FlatPtr to something that has u32 and u64 overloads.
This commit is contained in:
parent
b98d8ad5b0
commit
b1058b33fb
36 changed files with 164 additions and 161 deletions
|
@ -164,9 +164,9 @@ public:
|
|||
}
|
||||
|
||||
if (type == "SetInspectedObject") {
|
||||
auto address = request.get("address").to_number<uintptr_t>();
|
||||
auto address = request.get("address").to_number<FlatPtr>();
|
||||
for (auto& object : Object::all_objects()) {
|
||||
if ((uintptr_t)&object == address) {
|
||||
if ((FlatPtr)&object == address) {
|
||||
if (m_inspected_object)
|
||||
m_inspected_object->decrement_inspector_count({});
|
||||
m_inspected_object = object.make_weak_ptr();
|
||||
|
@ -178,9 +178,9 @@ public:
|
|||
}
|
||||
|
||||
if (type == "SetProperty") {
|
||||
auto address = request.get("address").to_number<uintptr_t>();
|
||||
auto address = request.get("address").to_number<FlatPtr>();
|
||||
for (auto& object : Object::all_objects()) {
|
||||
if ((uintptr_t)&object == address) {
|
||||
if ((FlatPtr)&object == address) {
|
||||
bool success = object.set_property(request.get("name").to_string(), request.get("value"));
|
||||
JsonObject response;
|
||||
response.set("type", "SetProperty");
|
||||
|
|
|
@ -168,9 +168,9 @@ void Object::deferred_invoke(Function<void(Object&)> invokee)
|
|||
void Object::save_to(JsonObject& json)
|
||||
{
|
||||
json.set("class_name", class_name());
|
||||
json.set("address", (uintptr_t)this);
|
||||
json.set("address", (FlatPtr)this);
|
||||
json.set("name", name());
|
||||
json.set("parent", (uintptr_t)parent());
|
||||
json.set("parent", (FlatPtr)parent());
|
||||
}
|
||||
|
||||
bool Object::set_property(const StringView& name, const JsonValue& value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue