summaryrefslogtreecommitdiffstats
path: root/src/H5Fsfile.c
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2023-06-19 05:13:38 (GMT)
committerGitHub <noreply@github.com>2023-06-19 05:13:38 (GMT)
commit65d8c9347010771473b53c91adcec2f281772213 (patch)
tree487567dae0dc005de896f616b90e67744239a5e2 /src/H5Fsfile.c
parent1f20354ee6cdfa9fd157ac9cdfff9acdf320a32d (diff)
downloadhdf5-65d8c9347010771473b53c91adcec2f281772213.zip
hdf5-65d8c9347010771473b53c91adcec2f281772213.tar.gz
hdf5-65d8c9347010771473b53c91adcec2f281772213.tar.bz2
Many fixes to various compiler warnings (#3124)
* Fixed various -Wmissing-variable-declarations by adding static keyword * In a few cases, renamed the variable suffix from _g to _s. * Fixed some -Wmissing-variable-declarations by using different declaration macros * Fixed various -Wconditional-uninitialized warnings by just initializing variable to zero * Fixed various -Wcomma warnings * Fixed clang -Wstrict-prototypes warnings * Fixed various -Wunused-variable warnings * Updated some casts to fix the only 3 -Wcast-qual warnings * Fixed the only -Wsometimes-uninitialized warning
Diffstat (limited to 'src/H5Fsfile.c')
-rw-r--r--src/H5Fsfile.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/H5Fsfile.c b/src/H5Fsfile.c
index 978d4dc..2cf75d0 100644
--- a/src/H5Fsfile.c
+++ b/src/H5Fsfile.c
@@ -35,7 +35,7 @@ typedef struct H5F_sfile_node_t {
H5FL_DEFINE_STATIC(H5F_sfile_node_t);
/* Declare a local variable to track the shared file information */
-H5F_sfile_node_t *H5F_sfile_head_g = NULL;
+static H5F_sfile_node_t *H5F_sfile_head_s = NULL;
/*-------------------------------------------------------------------------
* Function: H5F_sfile_assert_num
@@ -56,14 +56,14 @@ H5F_sfile_assert_num(unsigned n)
if (n == 0) {
/* Sanity checking */
- HDassert(H5F_sfile_head_g == NULL);
+ HDassert(H5F_sfile_head_s == NULL);
} /* end if */
else {
unsigned count; /* Number of open shared files */
H5F_sfile_node_t *curr; /* Current shared file node */
/* Iterate through low-level files for matching low-level file info */
- curr = H5F_sfile_head_g;
+ curr = H5F_sfile_head_s;
count = 0;
while (curr) {
/* Increment # of open shared file structs */
@@ -111,8 +111,8 @@ H5F__sfile_add(H5F_shared_t *shared)
new_shared->shared = shared;
/* Prepend to list of shared files open */
- new_shared->next = H5F_sfile_head_g;
- H5F_sfile_head_g = new_shared;
+ new_shared->next = H5F_sfile_head_s;
+ H5F_sfile_head_s = new_shared;
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -143,7 +143,7 @@ H5F__sfile_search(H5FD_t *lf)
HDassert(lf);
/* Iterate through low-level files for matching low-level file info */
- curr = H5F_sfile_head_g;
+ curr = H5F_sfile_head_s;
while (curr) {
/* Check for match */
if (0 == H5FD_cmp(curr->shared->lf, lf))
@@ -183,7 +183,7 @@ H5F__sfile_remove(H5F_shared_t *shared)
/* Locate shared file node with correct shared file */
last = NULL;
- curr = H5F_sfile_head_g;
+ curr = H5F_sfile_head_s;
while (curr && curr->shared != shared) {
/* Advance to next node */
last = curr;
@@ -200,7 +200,7 @@ H5F__sfile_remove(H5F_shared_t *shared)
last->next = curr->next;
else
/* Removing head node in list */
- H5F_sfile_head_g = curr->next;
+ H5F_sfile_head_s = curr->next;
/* Release the shared file node struct */
/* (the shared file info itself is freed elsewhere) */