diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-03-28 15:29:59 +0100 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-03-28 15:29:59 +0100 |
commit | 089f68cf6d18799028eb12cc16bbe2f8cf5e57c3 (patch) | |
tree | 196e5765d35b42376b65da2d01d4f40bc6c710ee /src/uniquekey.h | |
parent | 23a8f1ed5b24c05ac203fc7f30a03f7fc52c0cbd (diff) | |
download | lanes-089f68cf6d18799028eb12cc16bbe2f8cf5e57c3.tar.gz lanes-089f68cf6d18799028eb12cc16bbe2f8cf5e57c3.tar.bz2 lanes-089f68cf6d18799028eb12cc16bbe2f8cf5e57c3.zip |
linda.batched is now a lightuserdata instead of a string. plus some reformatting.
Diffstat (limited to 'src/uniquekey.h')
-rw-r--r-- | src/uniquekey.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/uniquekey.h b/src/uniquekey.h index 777d640..93aaf37 100644 --- a/src/uniquekey.h +++ b/src/uniquekey.h | |||
@@ -3,6 +3,8 @@ | |||
3 | #include "compat.h" | 3 | #include "compat.h" |
4 | #include "macros_and_utils.h" | 4 | #include "macros_and_utils.h" |
5 | 5 | ||
6 | #include <bit> | ||
7 | |||
6 | class UniqueKey | 8 | class UniqueKey |
7 | { | 9 | { |
8 | private: | 10 | private: |
@@ -31,13 +33,11 @@ class UniqueKey | |||
31 | 33 | ||
32 | void push(lua_State* const L) const | 34 | void push(lua_State* const L) const |
33 | { | 35 | { |
34 | // unfortunately, converting a scalar to a pointer must go through a C cast | 36 | lua_pushlightuserdata(L, std::bit_cast<void*>(m_storage)); |
35 | lua_pushlightuserdata(L, (void*) m_storage); | ||
36 | } | 37 | } |
37 | bool equals(lua_State* const L, int i) const | 38 | bool equals(lua_State* const L, int i) const |
38 | { | 39 | { |
39 | // unfortunately, converting a scalar to a pointer must go through a C cast | 40 | return lua_touserdata(L, i) == std::bit_cast<void*>(m_storage); |
40 | return lua_touserdata(L, i) == (void*) m_storage; | ||
41 | } | 41 | } |
42 | void query_registry(lua_State* const L) const | 42 | void query_registry(lua_State* const L) const |
43 | { | 43 | { |