summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-04-25 02:09:14 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-04-25 02:09:14 (GMT)
commit536a8b57bcc63f69b5a66d889d126bee572f970d (patch)
tree3bf585bd5e9c96d0b8f6cf884fc2f220b86d1312 /src
parente54f5a14d28cf9eb1226ce7feab2e2600d3984b4 (diff)
parentd16eb45d536bd13ca3cf1b0bdc76c58d95d13f17 (diff)
downloadhdf5-536a8b57bcc63f69b5a66d889d126bee572f970d.zip
hdf5-536a8b57bcc63f69b5a66d889d126bee572f970d.tar.gz
hdf5-536a8b57bcc63f69b5a66d889d126bee572f970d.tar.bz2
Merge pull request #2537 in HDFFV/hdf5 from ~DYOUNG/werror:fix-werrors to develop
* commit 'd16eb45d536bd13ca3cf1b0bdc76c58d95d13f17': For compatibility with non-C99 Visual Studio versions, use "%" PRIuMAX instead of "%ju". Fix `test/swmr_sparse_reader.c:118:77: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]` and `test/snapshots-hdf5/current/test/swmr_sparse_reader.c:129:100: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]`. Fix `src/H5FDdirect.c:1346:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]`.
Diffstat (limited to 'src')
-rw-r--r--src/H5FDdirect.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index d045987..34c4346 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -1335,16 +1335,13 @@ static herr_t
H5FD_direct_lock(H5FD_t *_file, hbool_t rw)
{
H5FD_direct_t *file = (H5FD_direct_t*)_file; /* VFD file struct */
- int lock; /* The type of lock */
+ const int lock = rw ? LOCK_EX : LOCK_SH;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
HDassert(file);
- /* Determine the type of lock */
- int lock = rw ? LOCK_EX : LOCK_SH;
-
/* Place the lock with non-blocking */
if(HDflock(file->fd, lock | LOCK_NB) < 0)
HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to flock file")