From c4e45d509a25ad1d341a5519606ddff59bfeb64e Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Wed, 17 Jan 2024 00:03:35 +0100 Subject: [PATCH] encoding/cbor: adhere to new quaternion rules of master --- core/encoding/cbor/unmarshal.odin | 6 +++--- tests/core/encoding/cbor/test_core_cbor.odin | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/encoding/cbor/unmarshal.odin b/core/encoding/cbor/unmarshal.odin index 0acb48083..eec999c12 100644 --- a/core/encoding/cbor/unmarshal.odin +++ b/core/encoding/cbor/unmarshal.odin @@ -903,9 +903,9 @@ _assign_float :: proc(val: any, f: $T) -> bool { case complex64: dst = complex(f32(f), 0) case complex128: dst = complex(f64(f), 0) - case quaternion64: dst = quaternion(f16(f), 0, 0, 0) - case quaternion128: dst = quaternion(f32(f), 0, 0, 0) - case quaternion256: dst = quaternion(f64(f), 0, 0, 0) + case quaternion64: dst = quaternion(w=f16(f), x=0, y=0, z=0) + case quaternion128: dst = quaternion(w=f32(f), x=0, y=0, z=0) + case quaternion256: dst = quaternion(w=f64(f), x=0, y=0, z=0) case: return false } diff --git a/tests/core/encoding/cbor/test_core_cbor.odin b/tests/core/encoding/cbor/test_core_cbor.odin index 691a0a5ec..e7a3ef419 100644 --- a/tests/core/encoding/cbor/test_core_cbor.odin +++ b/tests/core/encoding/cbor/test_core_cbor.odin @@ -177,7 +177,7 @@ test_marshalling :: proc(t: ^testing.T) { ennie = .EFoo, ennieb = {.EBar}, - quat = quaternion(16, 17, 18, 19), + quat = quaternion(w=16, x=17, y=18, z=19), comp = complex(32, 33), important = '!',