diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-08 10:36:51 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-08 13:06:51 +0100 |
commit | b1058b33fb32cb398d1723eb6fe59c27dc7967cc (patch) | |
tree | 49f0e5af7b7e37afd80a6dedf655917bf51ed915 /DevTools/Inspector | |
parent | b98d8ad5b01c41efff24faffe94918435194257a (diff) | |
download | serenity-b1058b33fb32cb398d1723eb6fe59c27dc7967cc.zip |
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.
Diffstat (limited to 'DevTools/Inspector')
-rw-r--r-- | DevTools/Inspector/RemoteObject.h | 4 | ||||
-rw-r--r-- | DevTools/Inspector/RemoteObjectPropertyModel.cpp | 2 | ||||
-rw-r--r-- | DevTools/Inspector/RemoteProcess.cpp | 10 | ||||
-rw-r--r-- | DevTools/Inspector/RemoteProcess.h | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/DevTools/Inspector/RemoteObject.h b/DevTools/Inspector/RemoteObject.h index b8d5d680ca..89c0e93f21 100644 --- a/DevTools/Inspector/RemoteObject.h +++ b/DevTools/Inspector/RemoteObject.h @@ -42,8 +42,8 @@ public: RemoteObject* parent { nullptr }; NonnullOwnPtrVector<RemoteObject> children; - uintptr_t address { 0 }; - uintptr_t parent_address { 0 }; + FlatPtr address { 0 }; + FlatPtr parent_address { 0 }; String class_name; String name; diff --git a/DevTools/Inspector/RemoteObjectPropertyModel.cpp b/DevTools/Inspector/RemoteObjectPropertyModel.cpp index c4e69a16f3..adb650235d 100644 --- a/DevTools/Inspector/RemoteObjectPropertyModel.cpp +++ b/DevTools/Inspector/RemoteObjectPropertyModel.cpp @@ -75,7 +75,7 @@ void RemoteObjectPropertyModel::update() void RemoteObjectPropertyModel::set_data(const GUI::ModelIndex& index, const GUI::Variant& new_value) { auto& property = m_properties[index.row()]; - uintptr_t address = m_object.address; + FlatPtr address = m_object.address; RemoteProcess::the().set_property(address, property.name.to_string(), new_value.to_string()); property.value = new_value.to_string(); did_update(); diff --git a/DevTools/Inspector/RemoteProcess.cpp b/DevTools/Inspector/RemoteProcess.cpp index 9f3adab9a7..4c642ee45e 100644 --- a/DevTools/Inspector/RemoteProcess.cpp +++ b/DevTools/Inspector/RemoteProcess.cpp @@ -65,14 +65,14 @@ void RemoteProcess::handle_get_all_objects_response(const JsonObject& response) auto& object_array = objects.as_array(); NonnullOwnPtrVector<RemoteObject> remote_objects; - HashMap<uintptr_t, RemoteObject*> objects_by_address; + HashMap<FlatPtr, RemoteObject*> objects_by_address; for (auto& value : object_array.values()) { ASSERT(value.is_object()); auto& object = value.as_object(); auto remote_object = make<RemoteObject>(); - remote_object->address = object.get("address").to_number<uintptr_t>(); - remote_object->parent_address = object.get("parent").to_number<uintptr_t>(); + remote_object->address = object.get("address").to_number<FlatPtr>(); + remote_object->parent_address = object.get("parent").to_number<FlatPtr>(); remote_object->name = object.get("name").to_string(); remote_object->class_name = object.get("class_name").to_string(); remote_object->json = object; @@ -105,7 +105,7 @@ void RemoteProcess::send_request(const JsonObject& request) m_socket->write(serialized); } -void RemoteProcess::set_inspected_object(uintptr_t address) +void RemoteProcess::set_inspected_object(FlatPtr address) { JsonObject request; request.set("type", "SetInspectedObject"); @@ -113,7 +113,7 @@ void RemoteProcess::set_inspected_object(uintptr_t address) send_request(request); } -void RemoteProcess::set_property(uintptr_t object, const StringView& name, const JsonValue& value) +void RemoteProcess::set_property(FlatPtr object, const StringView& name, const JsonValue& value) { JsonObject request; request.set("type", "SetProperty"); diff --git a/DevTools/Inspector/RemoteProcess.h b/DevTools/Inspector/RemoteProcess.h index 6e22e2444a..d81ad4d9a3 100644 --- a/DevTools/Inspector/RemoteProcess.h +++ b/DevTools/Inspector/RemoteProcess.h @@ -45,9 +45,9 @@ public: RemoteObjectGraphModel& object_graph_model() { return *m_object_graph_model; } const NonnullOwnPtrVector<RemoteObject>& roots() const { return m_roots; } - void set_inspected_object(uintptr_t); + void set_inspected_object(FlatPtr); - void set_property(uintptr_t object, const StringView& name, const JsonValue& value); + void set_property(FlatPtr object, const StringView& name, const JsonValue& value); Function<void()> on_update; |