Skip to content

Commit

Permalink
fix BE swap issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendersonHDF committed Jul 3, 2024
1 parent 3e98473 commit 4aa3691
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/H5Tconv_integer.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,8 +819,16 @@ H5T__conv_i_f_loop(const H5T_t *src_p, const H5T_t *dst_p, const H5T_conv_ctx_t
* complex value.
*/
if (H5T_ORDER_BE == dst_atomic.order && reverse) {
for (size_t i = 0; i < dst_p->shared->size / 2; i++)
H5_SWAP_BYTES(d, i, dst_p->shared->size - (i + 1));
size_t half_size = dst_p->shared->size / 2;

if (H5T_FLOAT == dst_p->shared->type) {
for (size_t i = 0; i < half_size; i++)
H5_SWAP_BYTES(d, i, dst_p->shared->size - (i + 1));
}
else {
for (size_t i = 0; i < half_size / 2; i++)
H5_SWAP_BYTES(d, i, half_size - (i + 1));
}
}
else if (H5T_ORDER_VAX == dst_atomic.order && reverse) {
if (H5T_FLOAT == dst_p->shared->type) {
Expand Down

0 comments on commit 4aa3691

Please sign in to comment.