diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2025-02-15 07:29:31 +0000 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2025-02-15 07:29:31 +0000 |
commit | 1de44cb970730cdf4f04ca91f9fc5e98fd411f63 (patch) | |
tree | 1cb04721f325258b0c744a62da9697164ec28a27 /arith.txr | |
parent | cc05029249b35b7f65e9a308a6d07aaed060c0b5 (diff) | |
download | txr-1de44cb970730cdf4f04ca91f9fc5e98fd411f63.tar.gz txr-1de44cb970730cdf4f04ca91f9fc5e98fd411f63.tar.bz2 txr-1de44cb970730cdf4f04ca91f9fc5e98fd411f63.zip |
ffi: rework endian-type rput/rget routines on big endian.
* ffi.c (ffi_be_i16_rput, ffi_be_i16_rget, ffi_be_u16_rput,
ffi_be_u16_rget, ffi_be_i32_rput, ffi_be_i32_rget, ffi_be_u32_rput,
ffi_be_u32_rget, ffi_le_i16_rput, ffi_le_i16_rget, ffi_le_u16_rput,
ffi_le_u16_rget, ffi_le_i32_rput, ffi_le_i32_rget, ffi_le_u32_rput,
ffi_le_u32_rget): Rewriten to avoid memory clearing,
memsets, pointer arithmetic and use of helper functions. The big endian rput
and rget functions just wrap the non-endian versions.
The ones which need byte swapping work in terms of a full ffi_arg
word. For instance to prepare a 16 bit big endian unsigned return
value we byte swap the uin16_t, then convert fo ffi_arg.
Diffstat (limited to 'arith.txr')
0 files changed, 0 insertions, 0 deletions