add number literal type

it gets implicitly casted to whatever is needed.

closes #24
This commit is contained in:
Andrew Kelley committed 2015-12-14 02:46:37 -07:00
1 parent 3d8eb10897
commit e411467e1d
17 files changed
+892 -235

No files matched your search

+9 -1
View File
@@ -21,8 +21,16 @@ void zig_panic(const char *format, ...) {
}
uint32_t int_hash(int i) {
return *reinterpret_cast<uint32_t*>(&i);
return (uint32_t)(i % UINT32_MAX);
}
bool int_eq(int a, int b) {
return a == b;
}
uint32_t uint64_hash(uint64_t i) {
return (uint32_t)(i % UINT32_MAX);
}
bool uint64_eq(uint64_t a, uint64_t b) {
return a == b;
}