core_timing: Make use of uintptr_t to represent user_data

Makes the interface future-proofed for supporting other platforms in the event we ever support platforms with differing pointer sizes. This way, we have a type in place that is always guaranteed to be able to represent a pointer exactly.
This commit is contained in:
Lioncash 2020-07-27 19:00:41 -04:00
parent f8370efc1b
commit 7decda6bc2
15 changed files with 52 additions and 43 deletions

View file

@ -25,10 +25,10 @@ std::bitset<CB_IDS.size()> callbacks_ran_flags;
u64 expected_callback = 0;
template <unsigned int IDX>
void HostCallbackTemplate(u64 userdata, std::chrono::nanoseconds ns_late) {
void HostCallbackTemplate(std::uintptr_t user_data, std::chrono::nanoseconds ns_late) {
static_assert(IDX < CB_IDS.size(), "IDX out of range");
callbacks_ran_flags.set(IDX);
REQUIRE(CB_IDS[IDX] == userdata);
REQUIRE(CB_IDS[IDX] == user_data);
REQUIRE(CB_IDS[IDX] == CB_IDS[calls_order[expected_callback]]);
delays[IDX] = ns_late.count();
++expected_callback;