mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +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
|
@ -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;
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue