rename the pointer read/write methods to read and write
these names were artifacts of some early confusion / bad design i made in the traits. read and write are much simpler names! also, change a ptr_mut to ptr where we just read the contents in the argument marshalling for structs. this has no effect, but it is more correct.
This commit is contained in:
@@ -262,8 +262,8 @@ fn marshal_arg(
|
||||
let arg_name = names.func_ptr_binding(¶m.name);
|
||||
let name = names.func_param(¶m.name);
|
||||
quote! {
|
||||
let #name = match memory.ptr_mut::<#pointee_type>(#arg_name as u32) {
|
||||
Ok(p) => match p.read_ptr_from_guest() {
|
||||
let #name = match memory.ptr::<#pointee_type>(#arg_name as u32) {
|
||||
Ok(p) => match p.read() {
|
||||
Ok(r) => r,
|
||||
Err(e) => {
|
||||
#error_handling
|
||||
@@ -335,7 +335,7 @@ where
|
||||
// trait binding returns func_param name.
|
||||
let val_name = names.func_param(&result.name);
|
||||
let post = quote! {
|
||||
#ptr_name.write_ptr_to_guest(&#val_name);
|
||||
#ptr_name.write(&#val_name);
|
||||
};
|
||||
(pre, post)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user