Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force RDD::id to be always uint64_t #98910

Merged
merged 1 commit into from
Nov 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions servers/rendering/rendering_device_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ struct VersatileResourceTemplate {
class RenderingDeviceDriver : public RenderingDeviceCommons {
public:
struct ID {
size_t id = 0;
uint64_t id = 0;
_ALWAYS_INLINE_ ID() = default;
_ALWAYS_INLINE_ ID(size_t p_id) :
_ALWAYS_INLINE_ ID(uint64_t p_id) :
id(p_id) {}
};

Expand All @@ -138,11 +138,9 @@ class RenderingDeviceDriver : public RenderingDeviceCommons {
_ALWAYS_INLINE_ bool operator!=(const m_name##ID &p_other) const { return id != p_other.id; } \
_ALWAYS_INLINE_ m_name##ID(const m_name##ID &p_other) : ID(p_other.id) {} \
_ALWAYS_INLINE_ explicit m_name##ID(uint64_t p_int) : ID(p_int) {} \
_ALWAYS_INLINE_ explicit m_name##ID(void *p_ptr) : ID((size_t)p_ptr) {} \
_ALWAYS_INLINE_ explicit m_name##ID(void *p_ptr) : ID((uint64_t)p_ptr) {} \
_ALWAYS_INLINE_ m_name##ID() = default; \
}; \
/* Ensure type-punnable to pointer. Makes some things easier.*/ \
static_assert(sizeof(m_name##ID) == sizeof(void *));
};

// Id types declared before anything else to prevent cyclic dependencies between the different concerns.
DEFINE_ID(Buffer);
Expand Down
Loading