diff options
-rw-r--r-- | src/H5Vprivate.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h index 1247912..3ed0707 100644 --- a/src/H5Vprivate.h +++ b/src/H5Vprivate.h @@ -221,11 +221,13 @@ H5V_vector_cmp_u (int n, const hsize_t *v1, const hsize_t *v2) FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_cmp_u) if (v1 == v2) HGOTO_DONE(0) + if (v1 == NULL) HGOTO_DONE(-1) + if (v2 == NULL) HGOTO_DONE(1) while (n--) { - if ((v1 ? *v1 : 0) < (v2 ? *v2 : 0)) HGOTO_DONE(-1) - if ((v1 ? *v1 : 0) > (v2 ? *v2 : 0)) HGOTO_DONE(1) - if (v1) v1++; - if (v2) v2++; + if (*v1 < *v2) HGOTO_DONE(-1) + if (*v1 > *v2) HGOTO_DONE(1) + v1++; + v2++; } done: @@ -261,11 +263,13 @@ H5V_vector_cmp_s (unsigned n, const hssize_t *v1, const hssize_t *v2) FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_cmp_s) if (v1 == v2) HGOTO_DONE(0) + if (v1 == NULL) HGOTO_DONE(-1) + if (v2 == NULL) HGOTO_DONE(1) while (n--) { - if ((v1 ? *v1 : 0) < (v2 ? *v2 : 0)) HGOTO_DONE(-1) - if ((v1 ? *v1 : 0) > (v2 ? *v2 : 0)) HGOTO_DONE(1) - if (v1) v1++; - if (v2) v2++; + if (*v1 < *v2) HGOTO_DONE(-1) + if (*v1 > *v2) HGOTO_DONE(1) + v1++; + v2++; } done: |