]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - util.c
Another fix
[xonotic/gmqcc.git] / util.c
diff --git a/util.c b/util.c
index f213e2fd56e9a08c43fda50569bc85335e1398d6..c3d3d4fa2d6cc9c220784c079122f146e508ff1f 100644 (file)
--- 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;
@@ -534,7 +534,7 @@ typedef struct hash_node_t {
  */
 #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;
+    const uint64_t       mix   = 0xC6A4A7935BD1E995UL;
     const int            rot   = 47;
     size_t               size  = strlen(key);
     uint64_t             hash  = seed ^ (size - mix);
@@ -581,7 +581,7 @@ GMQCC_INLINE uint32_t util_hthashfunc(hash_table_t *ht, const char *key, registe
     size_t               size  = strlen(key);
     uint32_t             hash  = seed ^ size;
     uint32_t             alias = 0;
-    const unsigned char *data  = (const unsigned char*)ket;
+    const unsigned char *data  = (const unsigned char*)key;
 
     while (size >= 4) {
         alias = *(uint32_t*)data;