mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-28 02:10:06 +00:00
Fix proc groups from import names
This commit is contained in:
+3
-3
@@ -477,13 +477,13 @@ new_clone :: inline proc(data: $T, loc := #caller_location) -> ^T {
|
||||
}
|
||||
|
||||
free_string :: proc(str: string, loc := #caller_location) {
|
||||
free_ptr((^raw.String)(&str).data, loc);
|
||||
free_ptr(raw.data(str), loc);
|
||||
}
|
||||
free_dynamic_array :: proc(array: $T/[dynamic]$E, loc := #caller_location) {
|
||||
free_ptr((^raw.Dynamic_Array)(&array).data, loc);
|
||||
free_ptr(raw.data(array), loc);
|
||||
}
|
||||
free_slice :: proc(array: $T/[]$E, loc := #caller_location) {
|
||||
free_ptr((^raw.Slice)(&array).data, loc);
|
||||
free_ptr(raw.data(array), loc);
|
||||
}
|
||||
free_map :: proc(m: $T/map[$K]$V, loc := #caller_location) {
|
||||
raw := cast(^raw.Map)&m;
|
||||
|
||||
+2
-2
@@ -399,11 +399,11 @@ quat_mulf :: proc(q: Quat, f: f32) -> Quat { return Quat{q.x*f, q.y*f, q.z*f, q.
|
||||
quat_divf :: proc(q: Quat, f: f32) -> Quat { return Quat{q.x/f, q.y/f, q.z/f, q.w/f}; }
|
||||
|
||||
quat_div :: proc(q0, q1: Quat) -> Quat { return mul(q0, quat_inverse(q1)); }
|
||||
quat_inverse :: proc(q: Quat) -> Quat { return div(conj(q), quat_dot(q, q)); }
|
||||
quat_inverse :: proc(q: Quat) -> Quat { return div(conj(q), dot(q, q)); }
|
||||
quat_dot :: proc(q0, q1: Quat) -> f32 { return q0.x*q1.x + q0.y*q1.y + q0.z*q1.z + q0.w*q1.w; }
|
||||
|
||||
quat_norm :: proc(q: Quat) -> Quat {
|
||||
m := sqrt(quat_dot(q, q));
|
||||
m := sqrt(dot(q, q));
|
||||
return div(q, m);
|
||||
}
|
||||
|
||||
|
||||
+13
-1
@@ -4,7 +4,7 @@ Any :: struct #ordered {
|
||||
}
|
||||
|
||||
String :: struct #ordered {
|
||||
data: ^u8,
|
||||
data: ^byte,
|
||||
len: int,
|
||||
}
|
||||
|
||||
@@ -25,3 +25,15 @@ Map :: struct #ordered {
|
||||
entries: Dynamic_Array,
|
||||
}
|
||||
|
||||
string_data :: inline proc(s: $T/string) -> ^byte {
|
||||
return (^String)(&s).data;
|
||||
}
|
||||
|
||||
slice_data :: inline proc(a: $T/[]$E) -> ^E {
|
||||
return cast(^E)(^Slice)(&a).data;
|
||||
}
|
||||
dynamic_array_data :: inline proc(a: $T/[dynamic]$E) -> ^E {
|
||||
return cast(^E)(^Dynamic_Array)(&a).data;
|
||||
}
|
||||
|
||||
data :: proc[string_data, slice_data, dynamic_array_data];
|
||||
|
||||
Reference in New Issue
Block a user