Fix build warnings for win64
authorRobert Ou <rqou@robertou.com>
Mon, 17 Jul 2017 19:36:43 +0000 (12:36 -0700)
committerRobert Ou <rqou@robertou.com>
Mon, 17 Jul 2017 19:36:43 +0000 (12:36 -0700)
Win64 has a 32-bit long. Use intptr_t to work on any data model.

kernel/hashlib.h

index 3c824b8c31f9a6f8cc92c7b62550d650a86aba14..4199e6f3ae87241a548ab3d02f7e92d9df1da563 100644 (file)
@@ -147,7 +147,7 @@ struct hash_ptr_ops {
                return a == b;
        }
        static inline unsigned int hash(const void *a) {
-               return (unsigned long)a;
+               return (intptr_t)a;
        }
 };