mapi: Clean up mapi_stub struct.
We no longer use the address field, and the name is always a size_t offset in the string pool (never a dynamic strduped name). Acked-by: Marek Olšák <marek.olsak@amd.com> Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23451>
This commit is contained in:
@@ -388,7 +388,7 @@ class ABIPrinter(object):
|
||||
"""Return the initializer for struct mapi_stub array."""
|
||||
stubs = []
|
||||
for ent in self.entries_sorted_by_names:
|
||||
stubs.append('%s{ (void *) %d, %d, NULL }' % (
|
||||
stubs.append('%s{ %d, %d }' % (
|
||||
self.indent, pool_offsets[ent], ent.slot))
|
||||
|
||||
return ',\n'.join(stubs)
|
||||
|
@@ -39,9 +39,8 @@
|
||||
|
||||
|
||||
struct mapi_stub {
|
||||
const void *name;
|
||||
size_t name_offset;
|
||||
int slot;
|
||||
mapi_func addr;
|
||||
};
|
||||
|
||||
/* define public_string_pool and public_stubs */
|
||||
@@ -62,7 +61,7 @@ stub_compare(const void *key, const void *elem)
|
||||
const struct mapi_stub *stub = (const struct mapi_stub *) elem;
|
||||
const char *stub_name;
|
||||
|
||||
stub_name = &public_string_pool[(size_t) stub->name];
|
||||
stub_name = &public_string_pool[stub->name_offset];
|
||||
|
||||
return strcmp(name, stub_name);
|
||||
}
|
||||
@@ -104,7 +103,7 @@ stub_find_by_slot(int slot)
|
||||
const char *
|
||||
stub_get_name(const struct mapi_stub *stub)
|
||||
{
|
||||
return &public_string_pool[(size_t) stub->name];
|
||||
return &public_string_pool[stub->name_offset];
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user