Work on making userdata work through extern C entry points
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
#include <string>
|
||||
|
||||
class HashedString{
|
||||
const int _hash;
|
||||
const uint32_t _hash;
|
||||
public:
|
||||
explicit HashedString(const std::string& s) : _hash(ConstHash(s.c_str())){
|
||||
}
|
||||
@@ -13,13 +13,13 @@ public:
|
||||
}
|
||||
HashedString(const HashedString& b) = default;
|
||||
|
||||
static unsigned constexpr ConstHash(char const *input) {
|
||||
static uint32_t constexpr ConstHash(char const *input) {
|
||||
return *input ?
|
||||
static_cast<unsigned int>(*input) + 33 * ConstHash(input + 1) :
|
||||
static_cast<uint32_t>(*input) + 33 * ConstHash(input + 1) :
|
||||
5381;
|
||||
}
|
||||
|
||||
const int GetHash() const{
|
||||
const uint32_t GetHash() const{
|
||||
return _hash;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user