1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-11-03 20:54:07 +01:00

raise TREXIO_INVALID_ARG_2 also when writing zero as dimensioning variable

This commit is contained in:
q-posev 2021-09-21 14:35:29 +02:00
parent 6459543afd
commit d5405e700c
2 changed files with 2 additions and 3 deletions

View File

@ -1194,7 +1194,7 @@ trexio_exit_code
trexio_write_$group_num$_64 (trexio_t* const file, const $group_num_dtype_double$ num) trexio_write_$group_num$_64 (trexio_t* const file, const $group_num_dtype_double$ num)
{ {
if (file == NULL) return TREXIO_INVALID_ARG_1; if (file == NULL) return TREXIO_INVALID_ARG_1;
//if (num < 0L) return TREXIO_INVALID_ARG_2; /* this line is uncommented by the generator for dimensioning variables; do NOT remove! */ //if (num <= 0L) return TREXIO_INVALID_ARG_2; /* this line is uncommented by the generator for dimensioning variables; do NOT remove! */
if (trexio_has_$group_num$(file) == TREXIO_SUCCESS) return TREXIO_ATTR_ALREADY_EXISTS; if (trexio_has_$group_num$(file) == TREXIO_SUCCESS) return TREXIO_ATTR_ALREADY_EXISTS;
switch (file->back_end) { switch (file->back_end) {
@ -1258,7 +1258,7 @@ trexio_write_$group_num$_32 (trexio_t* const file, const $group_num_dtype_single
{ {
if (file == NULL) return TREXIO_INVALID_ARG_1; if (file == NULL) return TREXIO_INVALID_ARG_1;
//if (num < 0) return TREXIO_INVALID_ARG_2; /* this line is uncommented by the generator for dimensioning variables; do NOT remove! */ //if (num <= 0) return TREXIO_INVALID_ARG_2; /* this line is uncommented by the generator for dimensioning variables; do NOT remove! */
if (trexio_has_$group_num$(file) == TREXIO_SUCCESS) return TREXIO_ATTR_ALREADY_EXISTS; if (trexio_has_$group_num$(file) == TREXIO_SUCCESS) return TREXIO_ATTR_ALREADY_EXISTS;
switch (file->back_end) { switch (file->back_end) {

View File

@ -195,7 +195,6 @@ trexio_hdf5_write_$group_num$ (trexio_t* const file, const $group_num_dtype_doub
{ {
if (file == NULL) return TREXIO_INVALID_ARG_1; if (file == NULL) return TREXIO_INVALID_ARG_1;
if (num == 0L ) return TREXIO_INVALID_ARG_2;
trexio_hdf5_t* const f = (trexio_hdf5_t*) file; trexio_hdf5_t* const f = (trexio_hdf5_t*) file;