diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2022-07-11 17:27:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-11 17:27:40 (GMT) |
commit | 0412d3f292b255da700d865fd1eb990e05c038bb (patch) | |
tree | 1d4ad4ab8d32b0452a30abae4c52ebd9fed17f43 /src/H5Shyper.c | |
parent | fa7caf843508b250f085e88cf5edfc2606da1205 (diff) | |
download | hdf5-0412d3f292b255da700d865fd1eb990e05c038bb.zip hdf5-0412d3f292b255da700d865fd1eb990e05c038bb.tar.gz hdf5-0412d3f292b255da700d865fd1eb990e05c038bb.tar.bz2 |
Fixes for production mode gcc warnings (#1873)
* Fixes for production mode gcc warnings
With the strict-overflow changes, this brings the number of warnings
in the C library w/ gcc 12 to zero.
* Fix typo
* Committing clang-format changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5Shyper.c')
-rw-r--r-- | src/H5Shyper.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/H5Shyper.c b/src/H5Shyper.c index f27b57a..52ca0dd 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -6610,10 +6610,11 @@ H5S__hyper_project_scalar(const H5S_t *space, hsize_t *offset) static herr_t H5S__hyper_project_simple_lower(const H5S_t *base_space, H5S_t *new_space) { - H5S_hyper_span_info_t *down; /* Pointer to list of spans */ - unsigned curr_dim; /* Current dimension being operated on */ + H5S_hyper_span_info_t *down; /* Pointer to list of spans */ + unsigned curr_dim; /* Current dimension being operated on */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_PACKAGE_NOERR + FUNC_ENTER_PACKAGE /* Check args */ HDassert(base_space && H5S_SEL_HYPERSLABS == H5S_GET_SELECT_TYPE(base_space)); @@ -6631,13 +6632,15 @@ H5S__hyper_project_simple_lower(const H5S_t *base_space, H5S_t *new_space) down = down->head->down; curr_dim++; } /* end while */ - HDassert(down); + if (NULL == down) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "NULL span list pointer") /* Share the underlying hyperslab span information */ new_space->select.sel_info.hslab->span_lst = down; new_space->select.sel_info.hslab->span_lst->count++; - FUNC_LEAVE_NOAPI(SUCCEED) +done: + FUNC_LEAVE_NOAPI(ret_value) } /* end H5S__hyper_project_simple_lower() */ /*------------------------------------------------------------------------- @@ -6723,7 +6726,8 @@ H5S__hyper_project_simple_higher(const H5S_t *base_space, H5S_t *new_space) /* Advance to next dimension */ curr_dim++; } /* end while */ - HDassert(new_space->select.sel_info.hslab->span_lst); + if (NULL == new_space->select.sel_info.hslab->span_lst) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "NULL span list pointer") HDassert(prev_span); /* Share the underlying hyperslab span information */ |