Prevent cast on pointer to union types

This commit is contained in:
Ginger Bill
2017-02-14 17:24:56 +00:00
parent 8b5e3428a1
commit 2722de65b7
7 changed files with 29 additions and 9 deletions
+1 -1
View File
@@ -381,7 +381,7 @@ Raw_Dynamic_Array :: struct #ordered {
};
Raw_Dynamic_Map :: struct #ordered {
hashes: [...]int,
hashes: [dynamic]int,
entries: Raw_Dynamic_Array,
};
+1 -1
View File
@@ -140,7 +140,7 @@ buffer_write_type :: proc(buf: ^Buffer, ti: ^Type_Info) {
if info.params == nil {
buffer_write_string(buf, "()");
} else {
t := cast(^Tuple)info.params;
t := union_cast(^Tuple)info.params;
buffer_write_string(buf, "(");
for type, i in t.types {
if i > 0 { buffer_write_string(buf, ", "); }
+1 -1
View File
@@ -1,6 +1,6 @@
is_signed :: proc(info: ^Type_Info) -> bool {
if is_integer(info) {
i := cast(^Type_Info.Integer)info;
i := union_cast(^Type_Info.Integer)info;
return i.signed;
}
if is_float(info) {