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

Fixed: uint can't be <0

This commit is contained in:
Anthony Scemama 2021-03-28 15:45:18 +02:00
parent 6cb7f4e074
commit ea61a24291

View File

@ -493,7 +493,7 @@ trexio_exit_code trexio_read_$group$_$group_dset$(trexio_t* file, $group_dset_dt
if ($group_dset$ == NULL) return TREXIO_INVALID_ARG_2;
trexio_exit_code rc;
uint64_t $group_dset_dim$ = -1;
uint64_t $group_dset_dim$ = 0;
switch (file->back_end) {
@ -513,7 +513,7 @@ trexio_exit_code trexio_read_$group$_$group_dset$(trexio_t* file, $group_dset_dt
if (rc != TREXIO_SUCCESS) return rc;
if ($group_dset_dim$ <= 0L) return TREXIO_INVALID_NUM;
if ($group_dset_dim$ == 0L) return TREXIO_INVALID_NUM;
uint32_t rank = $group_dset_rank$;
uint64_t dims[$group_dset_rank$] = {$group_dset_dim_list$};
@ -545,7 +545,7 @@ trexio_exit_code trexio_write_$group$_$group_dset$(trexio_t* file, const $group_
if ($group_dset$ == NULL) return TREXIO_INVALID_ARG_2;
trexio_exit_code rc;
uint64_t $group_dset_dim$ = -1;
uint64_t $group_dset_dim$ = 0;
switch (file->back_end) {
case TREXIO_TEXT:
@ -563,7 +563,7 @@ trexio_exit_code trexio_write_$group$_$group_dset$(trexio_t* file, const $group_
}
if (rc != TREXIO_SUCCESS) return rc;
if ($group_dset_dim$ <= 0L) return TREXIO_INVALID_NUM;
if ($group_dset_dim$ == 0L) return TREXIO_INVALID_NUM;
uint32_t rank = $group_dset_rank$;
uint64_t dims[$group_dset_rank$] = {$group_dset_dim_list$};