mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-29 19:00:06 +00:00
Prevent cast on pointer to union types
This commit is contained in:
+1
-1
@@ -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
@@ -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
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user