aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaytan Laats <laytanlaats@hotmail.com>2024-01-17 00:03:35 +0100
committerLaytan Laats <laytanlaats@hotmail.com>2024-03-04 17:26:19 +0100
commitc4e45d509a25ad1d341a5519606ddff59bfeb64e (patch)
treeb39b1232206f2d4a38eb02b4477cb7c6f10f8a89
parentc1cf6c1a95bb489525e329280be735d7a5ce966b (diff)
encoding/cbor: adhere to new quaternion rules of master
-rw-r--r--core/encoding/cbor/unmarshal.odin6
-rw-r--r--tests/core/encoding/cbor/test_core_cbor.odin2
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 = '!',