diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-10-17 19:22:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-17 19:22:10 (GMT) |
commit | 08d0909c9c2916ae7f3cc5f8918b7066a9847433 (patch) | |
tree | 4037f440e4b71a9337d60dca957c9b40dd93823f /src | |
parent | 3523d4ba66a6256e74f3896a039d87f0398d68e7 (diff) | |
download | hdf5-08d0909c9c2916ae7f3cc5f8918b7066a9847433.zip hdf5-08d0909c9c2916ae7f3cc5f8918b7066a9847433.tar.gz hdf5-08d0909c9c2916ae7f3cc5f8918b7066a9847433.tar.bz2 |
Fix unused variable warning in H5F_sfile_assert_num (#3700)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Fsfile.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/H5Fsfile.c b/src/H5Fsfile.c index ef80a79..6cf2c80 100644 --- a/src/H5Fsfile.c +++ b/src/H5Fsfile.c @@ -47,14 +47,17 @@ static H5F_sfile_node_t *H5F_sfile_head_s = NULL; *------------------------------------------------------------------------- */ void -H5F_sfile_assert_num(unsigned n) +H5F_sfile_assert_num(unsigned H5_ATTR_NDEBUG_UNUSED n) { FUNC_ENTER_NOAPI_NOINIT_NOERR + /* The only useful work this function does is asserting so when NDEBUG + * is defined it's a no-op. + */ +#ifndef NDEBUG if (n == 0) { - /* Sanity checking */ assert(H5F_sfile_head_s == NULL); - } /* end if */ + } else { unsigned count; /* Number of open shared files */ H5F_sfile_node_t *curr; /* Current shared file node */ @@ -68,11 +71,11 @@ H5F_sfile_assert_num(unsigned n) /* Advance to next shared file node */ curr = curr->next; - } /* end while */ + } - /* Sanity checking */ assert(count == n); - } /* end else */ + } +#endif FUNC_LEAVE_NOAPI_VOID } /* H5F_sfile_assert_num() */ |