1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-12-23 04:43:57 +01:00

fix type conversion for 32-bit indices

This commit is contained in:
q-posev 2021-11-18 14:33:18 +01:00
parent 9dbdbe9581
commit 527417cd8f

View File

@ -1699,7 +1699,7 @@ trexio_read_$group_dset$_64 (trexio_t* const file, $group_dset_dtype_double$* co
dim_size *= dims[i]; dim_size *= dims[i];
} }
for (uint64_t i=0; i<dim_size; ++i){ for (uint64_t i=0; i<dim_size; ++i){
$group_dset$[i] += ($group_dset_dtype_single$) 1; $group_dset$[i] += ($group_dset_dtype_double$) 1;
} }
} }
@ -1742,7 +1742,7 @@ trexio_write_$group_dset$_64 (trexio_t* const file, const $group_dset_dtype_doub
if ($group_dset$_p == NULL) return TREXIO_ALLOCATION_FAILED; if ($group_dset$_p == NULL) return TREXIO_ALLOCATION_FAILED;
for (uint64_t i=0; i<dim_size; ++i){ for (uint64_t i=0; i<dim_size; ++i){
$group_dset$_p[i] = $group_dset$_p[i] - ($group_dset_dtype_single$) 1; $group_dset$_p[i] -= ($group_dset_dtype_double$) 1;
} }
} }
@ -1840,7 +1840,7 @@ trexio_read_$group_dset$_32 (trexio_t* const file, $group_dset_dtype_single$* co
if ($is_index$) { if ($is_index$) {
for (uint64_t i=0; i<dim_size; ++i){ for (uint64_t i=0; i<dim_size; ++i){
$group_dset$[i] = ($group_dset_dtype_single$) $group_dset$_64[i] + ($group_dset_dtype_single$) 1; $group_dset$[i] = ($group_dset_dtype_single$) $group_dset$_64[i] + 1;
} }
} else { } else {
for (uint64_t i=0; i<dim_size; ++i){ for (uint64_t i=0; i<dim_size; ++i){