Work on making userdata work through extern C entry points
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-06-14 22:21:33 +02:00
parent 2c313791d9
commit 7c345d85e8
22 changed files with 128 additions and 51 deletions

View File

@@ -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;
}