Improve file position handling on Big Engian machines

Added swap_HALFs(dest, src, len) function to byteswap.c.

Calc can now handle Big Engian file position sizes that are a
multiple of BASEB bits in length.  Before handle Big Engian file
positions could only be 32 and 64 bits in length.  This will allow,
for example, a Big Engian file position size of 128 (assuming that
128/BASEB is is an integer).
This commit is contained in:
Landon Curt Noll
2022-11-28 15:13:16 -08:00
parent 3e084d9fb9
commit e6fc1a92a9
4 changed files with 61 additions and 4 deletions

View File

@@ -643,6 +643,7 @@ E_FUNC void math_error(char *, ...) \
E_FUNC HALF *swap_b8_in_HALFs(HALF *dest, HALF *src, LEN len);
E_FUNC ZVALUE *swap_b8_in_ZVALUE(ZVALUE *dest, ZVALUE *src, BOOL all);
E_FUNC HALF *swap_b16_in_HALFs(HALF *dest, HALF *src, LEN len);
E_FUNC HALF *swap_HALFs(HALF *dest, HALF *src, LEN len);
E_FUNC ZVALUE *swap_b16_in_ZVALUE(ZVALUE *dest, ZVALUE *src, BOOL all);
E_FUNC ZVALUE *swap_HALF_in_ZVALUE(ZVALUE *dest, ZVALUE *src, BOOL all);