add number literal type

it gets implicitly casted to whatever is needed.

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

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