From fe2bfdbc1f54e4f6044a731dcea1c279a3b2387f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Prei=C3=9Fer?= Date: Mon, 21 Nov 2022 17:37:05 +0100 Subject: [PATCH] Move the endianness notes introduced with #4035 to `wasmtime_val_raw`. (#5303) It seems they were mistakenly added to the `wasmtime_valunion` union whereas it is actually the `ValRaw` Rust type (represented by `wasmtime_val_raw`) that is affected by the change. --- crates/c-api/include/wasmtime/val.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/c-api/include/wasmtime/val.h b/crates/c-api/include/wasmtime/val.h index ae0a1961ce..f16c7bd48e 100644 --- a/crates/c-api/include/wasmtime/val.h +++ b/crates/c-api/include/wasmtime/val.h @@ -119,38 +119,24 @@ typedef uint8_t wasmtime_v128[16]; */ typedef union wasmtime_valunion { /// Field used if #wasmtime_val_t::kind is #WASMTIME_I32 - /// - /// Note that this field is always stored in a little-endian format. int32_t i32; /// Field used if #wasmtime_val_t::kind is #WASMTIME_I64 - /// - /// Note that this field is always stored in a little-endian format. int64_t i64; /// Field used if #wasmtime_val_t::kind is #WASMTIME_F32 - /// - /// Note that this field is always stored in a little-endian format. float32_t f32; /// Field used if #wasmtime_val_t::kind is #WASMTIME_F64 - /// - /// Note that this field is always stored in a little-endian format. float64_t f64; /// Field used if #wasmtime_val_t::kind is #WASMTIME_FUNCREF /// /// If this value represents a `ref.null func` value then the `store_id` field /// is set to zero. - /// - /// Note that this field is always stored in a little-endian format. wasmtime_func_t funcref; /// Field used if #wasmtime_val_t::kind is #WASMTIME_EXTERNREF /// /// If this value represents a `ref.null extern` value then this pointer will /// be `NULL`. - /// - /// Note that this field is always stored in a little-endian format. wasmtime_externref_t *externref; /// Field used if #wasmtime_val_t::kind is #WASMTIME_V128 - /// - /// Note that this field is always stored in a little-endian format. wasmtime_v128 v128; } wasmtime_valunion_t; @@ -169,25 +155,39 @@ typedef union wasmtime_valunion { */ typedef union wasmtime_val_raw { /// Field for when this val is a WebAssembly `i32` value. + /// + /// Note that this field is always stored in a little-endian format. int32_t i32; /// Field for when this val is a WebAssembly `i64` value. + /// + /// Note that this field is always stored in a little-endian format. int64_t i64; /// Field for when this val is a WebAssembly `f32` value. + /// + /// Note that this field is always stored in a little-endian format. float32_t f32; /// Field for when this val is a WebAssembly `f64` value. + /// + /// Note that this field is always stored in a little-endian format. float64_t f64; /// Field for when this val is a WebAssembly `v128` value. + /// + /// Note that this field is always stored in a little-endian format. wasmtime_v128 v128; /// Field for when this val is a WebAssembly `funcref` value. /// /// If this is set to 0 then it's a null funcref, otherwise this must be /// passed to `wasmtime_func_from_raw` to determine the `wasmtime_func_t`. + /// + /// Note that this field is always stored in a little-endian format. size_t funcref; /// Field for when this val is a WebAssembly `externref` value. /// /// If this is set to 0 then it's a null externref, otherwise this must be /// passed to `wasmtime_externref_from_raw` to determine the /// `wasmtime_externref_t`. + /// + /// Note that this field is always stored in a little-endian format. size_t externref; } wasmtime_val_raw_t;