diff options
author | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2018-01-12 20:36:03 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2018-01-12 20:36:03 (GMT) |
commit | 37318f109a294bb47e5040be5888963967c1badc (patch) | |
tree | 183f86084fec7afa0ce48787db692c567dc812ab /src/H5Dlayout.c | |
parent | 7af4786a9b29184596cb31afa80b69a68f00349b (diff) | |
download | hdf5-37318f109a294bb47e5040be5888963967c1badc.zip hdf5-37318f109a294bb47e5040be5888963967c1badc.tar.gz hdf5-37318f109a294bb47e5040be5888963967c1badc.tar.bz2 |
Changes made based on code reviews.
Diffstat (limited to 'src/H5Dlayout.c')
-rw-r--r-- | src/H5Dlayout.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index 5a4d537..980b810 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -46,9 +46,10 @@ /* Package Variables */ /*********************/ +/* Format version bounds for layout */ const unsigned H5O_layout_ver_bounds[] = { H5O_LAYOUT_VERSION_1, /* H5F_LIBVER_EARLIEST */ - H5O_LAYOUT_VERSION_3, /* H5F_LIBVER_V18 */ + H5O_LAYOUT_VERSION_3, /* H5F_LIBVER_V18 */ /* H5O_LAYOUT_VERSION_DEFAULT */ H5O_LAYOUT_VERSION_LATEST /* H5F_LIBVER_LATEST */ }; @@ -289,16 +290,15 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Quincey Koziol - * Thursday, January 15, 2009 + * Programmer: Vailin Choi; December 2017 * *------------------------------------------------------------------------- */ herr_t H5D__layout_set_version(H5F_t *f, H5O_layout_t *layout) { - unsigned vers; - herr_t ret_value = SUCCEED; /* Return value */ + unsigned version; /* Message version */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -307,12 +307,15 @@ H5D__layout_set_version(H5F_t *f, H5O_layout_t *layout) HDassert(f); /* Upgrade to the version indicated by the file's low bound if higher */ - layout->version = MAX(layout->version, H5O_layout_ver_bounds[H5F_LOW_BOUND(f)]); + version = MAX(layout->version, H5O_layout_ver_bounds[H5F_LOW_BOUND(f)]); - /* File bound check */ - if(layout->version > H5O_layout_ver_bounds[H5F_HIGH_BOUND(f)]) + /* Version bounds check */ + if(version > H5O_layout_ver_bounds[H5F_HIGH_BOUND(f)]) HGOTO_ERROR(H5E_DATASET, H5E_BADRANGE, FAIL, "layout version out of bounds") + /* Set the message version */ + layout->version = version; + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__layout_set_version() */ |