summaryrefslogtreecommitdiffstats
path: root/src/H5Fsfile.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2021-03-25 00:39:37 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2021-03-25 00:39:37 (GMT)
commitfeb20aac304b39e18c70f88cae2f7cf7d5c82db2 (patch)
treee15d7e751af4e3c42e77ea955d91db4cf27a71cf /src/H5Fsfile.c
parentbdac2ecdbff2c389a222b3d93ff1eb1d23ec6b23 (diff)
downloadhdf5-feb20aac304b39e18c70f88cae2f7cf7d5c82db2.zip
hdf5-feb20aac304b39e18c70f88cae2f7cf7d5c82db2.tar.gz
hdf5-feb20aac304b39e18c70f88cae2f7cf7d5c82db2.tar.bz2
Formats the source and updates the gcc warning pragmas
Diffstat (limited to 'src/H5Fsfile.c')
-rw-r--r--src/H5Fsfile.c49
1 files changed, 22 insertions, 27 deletions
diff --git a/src/H5Fsfile.c b/src/H5Fsfile.c
index 3cbd490..3dedbcf 100644
--- a/src/H5Fsfile.c
+++ b/src/H5Fsfile.c
@@ -11,21 +11,21 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include "H5Fmodule.h" /* This source code file is part of the H5F module */
+#include "H5Fmodule.h" /* This source code file is part of the H5F module */
/* Packages needed by this file... */
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Fpkg.h" /* File access */
-#include "H5FDprivate.h" /* File drivers */
-#include "H5FLprivate.h" /* Free lists */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Fpkg.h" /* File access */
+#include "H5FDprivate.h" /* File drivers */
+#include "H5FLprivate.h" /* Free lists */
/* PRIVATE TYPEDEFS */
/* Struct for tracking "shared" file structs */
typedef struct H5F_sfile_node_t {
- H5F_shared_t *shared; /* Pointer to "shared" file struct */
- struct H5F_sfile_node_t *next; /* Pointer to next node */
+ H5F_shared_t * shared; /* Pointer to "shared" file struct */
+ struct H5F_sfile_node_t *next; /* Pointer to next node */
} H5F_sfile_node_t;
/* PRIVATE PROTOTYPES */
@@ -38,7 +38,6 @@ 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;
-
/*-------------------------------------------------------------------------
* Function: H5F_sfile_assert_num
*
@@ -56,18 +55,18 @@ H5F_sfile_assert_num(unsigned n)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
- if(n == 0) {
+ if (n == 0) {
/* Sanity checking */
HDassert(H5F_sfile_head_g == NULL);
} /* end if */
else {
- unsigned count; /* Number of open shared files */
- H5F_sfile_node_t *curr; /* Current shared file node */
+ 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_g;
count = 0;
- while(curr) {
+ while (curr) {
/* Increment # of open shared file structs */
count++;
@@ -82,7 +81,6 @@ H5F_sfile_assert_num(unsigned n)
FUNC_LEAVE_NOAPI_VOID
} /* H5F_sfile_assert_num() */
-
/*-------------------------------------------------------------------------
* Function: H5F__sfile_add
*
@@ -98,8 +96,8 @@ H5F_sfile_assert_num(unsigned n)
herr_t
H5F__sfile_add(H5F_shared_t *shared)
{
- H5F_sfile_node_t *new_shared; /* New shared file node */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5F_sfile_node_t *new_shared; /* New shared file node */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -121,7 +119,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F__sfile_add() */
-
/*-------------------------------------------------------------------------
* Function: H5F__sfile_search
*
@@ -141,13 +138,12 @@ H5F__sfile_search(H5FD_t *lf)
H5F_sfile_node_t *curr;
for (curr = H5F_sfile_head_g; curr != NULL; curr = curr->next) {
- if(curr->shared->lf == lf)
+ if (curr->shared->lf == lf)
return curr->shared;
}
return NULL;
}
-
/*-------------------------------------------------------------------------
* Function: H5F__sfile_remove
*
@@ -163,9 +159,9 @@ H5F__sfile_search(H5FD_t *lf)
herr_t
H5F__sfile_remove(H5F_shared_t *shared)
{
- H5F_sfile_node_t *curr; /* Current shared file node */
- H5F_sfile_node_t *last; /* Last shared file node */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5F_sfile_node_t *curr; /* Current shared file node */
+ H5F_sfile_node_t *last; /* Last shared file node */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
@@ -175,18 +171,18 @@ H5F__sfile_remove(H5F_shared_t *shared)
/* Locate shared file node with correct shared file */
last = NULL;
curr = H5F_sfile_head_g;
- while(curr && curr->shared != shared) {
+ while (curr && curr->shared != shared) {
/* Advance to next node */
last = curr;
curr = curr->next;
} /* end while */
/* Indicate error if the node wasn't found */
- if(curr == NULL)
+ if (curr == NULL)
HGOTO_ERROR(H5E_FILE, H5E_NOTFOUND, FAIL, "can't find shared file info")
/* Remove node found from list */
- if(last != NULL)
+ if (last != NULL)
/* Removing middle or tail node in list */
last->next = curr->next;
else
@@ -200,4 +196,3 @@ H5F__sfile_remove(H5F_shared_t *shared)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F__sfile_remove() */
-