X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=util.c;h=3961c74f81d996d3b28e41641fcbc2a3be57b376;hp=15db97cfd9a1dbac5f044abba347004a466d1c55;hb=3e8435783c0112a294588c7ec72fe03559888ed1;hpb=5fc1cc24146b535043ba13618fb2402fe9e6cb20 diff --git a/util.c b/util.c index 15db97c..3961c74 100644 --- a/util.c +++ b/util.c @@ -495,7 +495,7 @@ size_t util_strtononcmd(const char *in, char *out, size_t outsz) { FILE *util_fopen(const char *filename, const char *mode) { -#ifdef WIN32 +#ifdef _MSC_VER FILE *out; if (fopen_s(&out, filename, mode) != 0) return NULL; @@ -533,8 +533,8 @@ typedef struct hash_node_t { * below. These should be autovectorized by gcc. */ #ifdef __x86_64__ -GMQCC_INLINE uint32_t util_hthashfunc(hash_table_t *ht, const char *key, register size_t seed) { - const uint64_t mix = 0xC6A4A7935BD1E995; +static GMQCC_INLINE uint32_t util_hthashfunc(hash_table_t *ht, const char *key, size_t seed) { + const uint64_t mix = 0xC6A4A7935BD1E995UL; const int rot = 47; size_t size = strlen(key); uint64_t hash = seed ^ (size - mix); @@ -575,7 +575,7 @@ GMQCC_INLINE uint32_t util_hthashfunc(hash_table_t *ht, const char *key, registe } #else -GMQCC_INLINE uint32_t util_hthashfunc(hash_table_t *ht, const char *key, register size_t seed) { +static GMQCC_INLINE uint32_t util_hthashfunc(hash_table_t *ht, const char *key, size_t seed) { const uint32_t mix = 0x5BD1E995; const uint32_t rot = 24; size_t size = strlen(key);