diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-10-01 15:29:53 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-10-01 15:29:53 (GMT) |
commit | ec8ad09125032c9c232878d02e90aa86df162841 (patch) | |
tree | 5d63105d3a0db7d5bbee41c5b74b097649a2115e /src/H5Fsfile.c | |
parent | 453238e90e1574ef1c15e3c79f7fb3d77920e77c (diff) | |
download | hdf5-ec8ad09125032c9c232878d02e90aa86df162841.zip hdf5-ec8ad09125032c9c232878d02e90aa86df162841.tar.gz hdf5-ec8ad09125032c9c232878d02e90aa86df162841.tar.bz2 |
Source formatted
Diffstat (limited to 'src/H5Fsfile.c')
-rw-r--r-- | src/H5Fsfile.c | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/src/H5Fsfile.c b/src/H5Fsfile.c index 9a9bbab..79e6fbe 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 * @@ -139,7 +136,7 @@ H5F_shared_t * H5F__sfile_search(H5FD_t *lf) { H5F_sfile_node_t *curr; /* Current shared file node */ - H5F_shared_t *ret_value = NULL; /* Return value */ + H5F_shared_t * ret_value = NULL; /* Return value */ FUNC_ENTER_PACKAGE_NOERR @@ -148,9 +145,9 @@ H5F__sfile_search(H5FD_t *lf) /* Iterate through low-level files for matching low-level file info */ curr = H5F_sfile_head_g; - while(curr) { + while (curr) { /* Check for match */ - if(0 == H5FD_cmp(curr->shared->lf, lf)) + if (0 == H5FD_cmp(curr->shared->lf, lf)) HGOTO_DONE(curr->shared) /* Advance to next shared file node */ @@ -161,7 +158,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__sfile_search() */ - /*------------------------------------------------------------------------- * Function: H5F__sfile_remove * @@ -177,9 +173,9 @@ done: 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 @@ -189,18 +185,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 @@ -214,4 +210,3 @@ H5F__sfile_remove(H5F_shared_t *shared) done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F__sfile_remove() */ - |