Skip to content

Commit

Permalink
Move the endianness notes introduced with bytecodealliance#4035 to `w…
Browse files Browse the repository at this point in the history
…asmtime_val_raw`. (bytecodealliance#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.
  • Loading branch information
kpreisser authored Nov 21, 2022
1 parent 54cfa4d commit fe2bfdb
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions crates/c-api/include/wasmtime/val.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand Down

0 comments on commit fe2bfdb

Please sign in to comment.