summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5F.c79
-rw-r--r--src/H5Fprivate.h3
-rw-r--r--src/H5G.c137
-rw-r--r--src/H5Gent.c28
-rw-r--r--src/H5Tcommit.c6
5 files changed, 104 insertions, 149 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 4cd5b67..61d38d5 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -61,19 +61,16 @@ typedef struct H5F_olist_t {
} H5F_olist_t;
/* PRIVATE PROTOTYPES */
-
#ifdef NOT_YET
-static herr_t H5F_flush_all(hbool_t invalidate);
static int H5F_flush_all_cb(void *f, hid_t fid, void *_invalidate);
#endif /* NOT_YET */
-
-static herr_t H5F_close(H5F_t *f);
-static H5F_t *H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id);
-static herr_t H5F_dest(H5F_t *f, hid_t dxpl_id);
-static herr_t H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope, unsigned flags);
static unsigned H5F_get_objects(const H5F_t *f, unsigned types, int max_objs, hid_t *obj_id_list);
static int H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key);
static herr_t H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void** file_handle);
+static H5F_t *H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id);
+static herr_t H5F_dest(H5F_t *f, hid_t dxpl_id);
+static herr_t H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope, unsigned flags);
+static herr_t H5F_close(H5F_t *f);
/* Declare a free list to manage the H5F_t struct */
H5FL_DEFINE_STATIC(H5F_t);
@@ -619,7 +616,7 @@ H5F_flush_all_cb(void *_f, hid_t UNUSED fid, void *_invalidate)
H5F_t *f=(H5F_t *)_f;
unsigned invalidate = (*((hbool_t*)_invalidate);
- FUNC_ENTER_NOAPI_NOINIT(H5F_flush_all_cb)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_flush_all_cb)
H5F_flush(f, H5F_SCOPE_LOCAL, (invalidate ? H5F_FLUSH_INVALIDATE : H5F_FLUSH_NONE));
@@ -1441,6 +1438,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id)
if (NULL==(f=H5FL_CALLOC(H5F_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
+ f->file_id = -1;
if (shared) {
f->shared = shared;
@@ -1584,10 +1582,9 @@ H5F_dest(H5F_t *f, hid_t dxpl_id)
if (1==f->shared->nrefs) {
/* Remove shared file struct from list of open files */
- if(H5F_sfile_remove(f->shared) < 0) {
- HERROR(H5E_FILE, H5E_CANTRELEASE, "problems closing file");
- ret_value = FAIL; /*but keep going*/
- } /* end if */
+ if(H5F_sfile_remove(f->shared) < 0)
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file")
/*
* Do not close the root group since we didn't count it, but free
@@ -1595,47 +1592,39 @@ H5F_dest(H5F_t *f, hid_t dxpl_id)
*/
if (f->shared->root_grp) {
/* Free the ID to name buffer */
- if(H5G_free_grp_name(f->shared->root_grp)<0) {
- HERROR(H5E_FILE, H5E_CANTRELEASE, "problems closing file");
- ret_value = FAIL; /*but keep going*/
- } /* end if */
+ if(H5G_free_grp_name(f->shared->root_grp)<0)
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file")
/* Free the memory for the root group */
- if(H5G_free(f->shared->root_grp)<0) {
- HERROR(H5E_FILE, H5E_CANTRELEASE, "problems closing file");
- ret_value = FAIL; /*but keep going*/
- } /* end if */
+ if(H5G_free(f->shared->root_grp)<0)
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file")
f->shared->root_grp=NULL;
}
- if (H5AC_dest(f, dxpl_id)) {
- HERROR(H5E_FILE, H5E_CANTRELEASE, "problems closing file");
- ret_value = FAIL; /*but keep going*/
- }
- if (H5FO_dest(f)<0) {
- HERROR(H5E_FILE, H5E_CANTRELEASE, "problems closing file");
- ret_value = FAIL; /*but keep going*/
- } /* end if */
+ if (H5AC_dest(f, dxpl_id))
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file")
+ if (H5FO_dest(f)<0)
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file")
f->shared->cwfs = H5MM_xfree (f->shared->cwfs);
- if (H5G_node_close(f)<0) {
- HERROR(H5E_FILE, H5E_CANTRELEASE, "problems closing file");
- ret_value = FAIL; /*but keep going*/
- } /* end if */
+ if (H5G_node_close(f)<0)
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_FILE, H5E_CANTRELEASE, FAIL, "problems closing file")
/* Destroy file creation properties */
- if(H5I_GENPROP_LST != H5I_get_type(f->shared->fcpl_id)) {
- HERROR(H5E_PLIST, H5E_BADTYPE, "not a property list");
- ret_value = FAIL; /*but keep going*/
- } /* end if */
- if((ret_value=H5I_dec_ref(f->shared->fcpl_id)) < 0) {
- HERROR(H5E_PLIST, H5E_CANTFREE, "can't close property list");
- ret_value = FAIL; /*but keep going*/
- } /* end if */
+ if(H5I_GENPROP_LST != H5I_get_type(f->shared->fcpl_id))
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a property list")
+ if((ret_value=H5I_dec_ref(f->shared->fcpl_id)) < 0)
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "can't close property list")
/* Close low-level file */
- if (H5FD_close(f->shared->lf)<0) {
- HERROR(H5E_FILE, H5E_CANTINIT, "problems closing file");
- ret_value = FAIL; /*but keep going*/
- }
+ if (H5FD_close(f->shared->lf)<0)
+ /* Push error, but keep going*/
+ HDONE_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "problems closing file")
/* Destroy shared file struct */
f->shared = H5FL_FREE(H5F_file_t,f->shared);
@@ -2551,7 +2540,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
H5F_close(H5F_t *f)
{
herr_t ret_value = SUCCEED; /* Return value */
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 697a260..211a2aa 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -429,6 +429,9 @@ struct H5RC_t;
/* Private functions, not part of the publicly documented API */
H5_DLL herr_t H5F_init(void);
+#ifdef NOT_YET
+H5_DLL herr_t H5F_flush_all(hbool_t invalidate);
+#endif /* NOT_YET */
H5_DLL H5F_t * H5F_open(const char *name, unsigned flags, hid_t fcpl_id,
hid_t fapl_id, hid_t dxpl_id);
diff --git a/src/H5G.c b/src/H5G.c
index d1c5ac9..1f04f61 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -166,35 +166,41 @@ H5FL_DEFINE(H5G_shared_t);
H5FL_BLK_EXTERN(str_buf);
/* Private prototypes */
+static herr_t H5G_register_type(H5G_obj_t type, htri_t(*isa)(H5G_entry_t*, hid_t),
+ const char *desc);
+static const char * H5G_component(const char *name, size_t *size_p);
+static const char * H5G_basename(const char *name, size_t *size_p);
+static char * H5G_normalize(const char *name);
+static herr_t H5G_namei(const H5G_entry_t *loc_ent, const char *name,
+ const char **rest/*out*/, H5G_entry_t *grp_ent/*out*/, H5G_entry_t *obj_ent/*out*/,
+ unsigned target, int *nlinks/*out*/, H5G_namei_act_t action,
+ H5G_entry_t *ent, hid_t dxpl_id);
+static herr_t H5G_traverse_slink(H5G_entry_t *grp_ent/*in,out*/,
+ H5G_entry_t *obj_ent/*in,out*/, int *nlinks/*in,out*/, hid_t dxpl_id);
static H5G_t *H5G_create(H5G_entry_t *loc, const char *name, size_t size_hint,
- hid_t dxpl_id, hid_t gcpl_id, hid_t gapl_id);
-#ifdef NOT_YET
-static H5G_t *H5G_reopen(H5G_t *grp);
-#endif /* NOT_YET */
+ hid_t dxpl_id, hid_t gcpl_id, hid_t gapl_id);
static htri_t H5G_isa(H5G_entry_t *ent, hid_t dxpl_id);
static htri_t H5G_link_isa(H5G_entry_t *ent, hid_t dxpl_id);
+static H5G_t * H5G_open_oid(H5G_entry_t *ent, hid_t dxpl_id);
+static H5G_t *H5G_rootof(H5F_t *f);
static herr_t H5G_link(H5G_entry_t *cur_loc, const char *cur_name,
H5G_entry_t *new_loc, const char *new_name,
H5G_link_t type, unsigned namei_flags, hid_t dxpl_id);
-static herr_t H5G_linkval(H5G_entry_t *loc, const char *name, size_t size,
- char *buf/*out*/, hid_t dxpl_id);
-static herr_t H5G_move(H5G_entry_t *src_loc, const char *src_name,
- H5G_entry_t *dst_loc, const char *dst_name, hid_t dxpl_it);
-static H5G_t * H5G_open_oid(H5G_entry_t *ent, hid_t dxpl_id);
-static herr_t H5G_unlink(H5G_entry_t *loc, const char *name, hid_t dxpl_id);
static herr_t H5G_get_num_objs(H5G_entry_t *grp, hsize_t *num_objs, hid_t dxpl_id);
static ssize_t H5G_get_objname_by_idx(H5G_entry_t *loc, hsize_t idx, char* name, size_t size, hid_t dxpl_id);
static H5G_obj_t H5G_get_objtype_by_idx(H5G_entry_t *loc, hsize_t idx, hid_t dxpl_id);
-static int H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key);
-static herr_t H5G_traverse_slink(H5G_entry_t *grp_ent/*in,out*/,
- H5G_entry_t *obj_ent/*in,out*/, int *nlinks/*in,out*/, hid_t dxpl_id);
+static herr_t H5G_linkval(H5G_entry_t *loc, const char *name, size_t size,
+ char *buf/*out*/, hid_t dxpl_id);
static herr_t H5G_set_comment(H5G_entry_t *loc, const char *name,
const char *buf, hid_t dxpl_id);
static int H5G_get_comment(H5G_entry_t *loc, const char *name,
size_t bufsize, char *buf, hid_t dxpl_id);
-static herr_t H5G_register_type(H5G_obj_t type, htri_t(*isa)(H5G_entry_t*, hid_t),
- const char *desc);
-static H5G_t *H5G_rootof(H5F_t *f);
+static herr_t H5G_unlink(H5G_entry_t *loc, const char *name, hid_t dxpl_id);
+static herr_t H5G_move(H5G_entry_t *src_loc, const char *src_name,
+ H5G_entry_t *dst_loc, const char *dst_name, hid_t dxpl_it);
+static htri_t H5G_common_path(const H5RS_str_t *fullpath_r,
+ const H5RS_str_t *prefix_r);
+static int H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key);
/*-------------------------------------------------------------------------
@@ -1140,7 +1146,7 @@ H5G_register_type(H5G_obj_t type, htri_t(*isa)(H5G_entry_t*, hid_t), const char
size_t i;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5G_register_type, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5G_register_type);
assert(type>=0);
assert(isa);
@@ -1685,7 +1691,6 @@ H5G_traverse_slink (H5G_entry_t *grp_ent/*in,out*/,
H5G_entry_t tmp_grp_ent; /* Temporary copy of group entry */
H5RS_str_t *tmp_user_path_r=NULL, *tmp_canon_path_r=NULL; /* Temporary pointer to object's user path & canonical path */
const H5HL_t *heap;
- unsigned heap_flags = H5AC__NO_FLAGS_SET;
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5G_traverse_slink);
@@ -1705,7 +1710,7 @@ H5G_traverse_slink (H5G_entry_t *grp_ent/*in,out*/,
linkval = H5MM_xstrdup (clv);
assert(linkval);
- if (H5HL_unprotect(grp_ent->file, dxpl_id, heap, stab_mesg.heap_addr, heap_flags) < 0)
+ if (H5HL_unprotect(grp_ent->file, dxpl_id, heap, stab_mesg.heap_addr, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR (H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read unprotect link value")
/* Hold the entry's name (& old_name) to restore later */
@@ -1732,7 +1737,7 @@ H5G_traverse_slink (H5G_entry_t *grp_ent/*in,out*/,
tmp_user_path_r=NULL;
obj_ent->canon_path_r = tmp_canon_path_r;
tmp_canon_path_r=NULL;
-
+
done:
/* Error cleanup */
if(tmp_user_path_r)
@@ -1876,7 +1881,7 @@ H5G_create(H5G_entry_t *loc, const char *name, size_t size_hint,
unsigned stab_init=0; /* Flag to indicate that the symbol table was created successfully */
H5G_t *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5G_create, NULL);
+ FUNC_ENTER_NOAPI_NOINIT(H5G_create);
/* check args */
assert(loc);
@@ -2116,7 +2121,7 @@ H5G_open_oid(H5G_entry_t *ent, hid_t dxpl_id)
H5G_t *ret_value = NULL;
H5O_stab_t mesg;
- FUNC_ENTER_NOAPI(H5G_open_oid, NULL);
+ FUNC_ENTER_NOAPI_NOINIT(H5G_open_oid);
/* Check args */
assert(ent);
@@ -2151,44 +2156,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value);
}
-#ifdef NOT_YET
-
-/*-------------------------------------------------------------------------
- * Function: H5G_reopen
- *
- * Purpose: Reopens a group by incrementing the open count.
- *
- * Return: Success: The GRP argument.
- *
- * Failure: NULL
- *
- * Programmer: Robb Matzke
- * Monday, January 5, 1998
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-H5G_t *
-H5G_reopen(H5G_t *grp)
-{
- H5G_t *ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(H5G_reopen, NULL);
-
- assert(grp);
- assert(grp->nref > 0);
-
- grp->nref++;
-
- /* Set return value */
- ret_value=grp;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-}
-#endif /* NOT_YET */
-
/*-------------------------------------------------------------------------
* Function: H5G_close
@@ -2307,17 +2274,12 @@ done:
static H5G_t *
H5G_rootof(H5F_t *f)
{
- H5G_t *ret_value; /* Return value */
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_rootof);
- FUNC_ENTER_NOAPI(H5G_rootof, NULL);
while (f->mtab.parent)
f = f->mtab.parent;
- /* Set return value */
- ret_value=f->shared->root_grp;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(f->shared->root_grp);
}
@@ -2616,7 +2578,7 @@ H5G_link (H5G_entry_t *cur_loc, const char *cur_name, H5G_entry_t *new_loc,
size_t offset; /*offset to sym-link value */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5G_link, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5G_link);
/* Check args */
assert (cur_loc);
@@ -2783,9 +2745,7 @@ herr_t
H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link,
H5G_stat_t *statbuf/*out*/, hid_t dxpl_id)
{
- H5O_stab_t stab_mesg;
H5G_entry_t grp_ent, obj_ent;
- const char *s = NULL;
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5G_get_objinfo, FAIL);
@@ -2806,8 +2766,9 @@ H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link,
*/
if (statbuf) {
if (H5G_CACHED_SLINK==obj_ent.type) {
- const H5HL_t *heap;
- unsigned heap_flags = H5AC__NO_FLAGS_SET;
+ H5O_stab_t stab_mesg; /* Symbol table message info */
+ const H5HL_t *heap; /* Pointer to local heap for group */
+ const char *s; /* Pointer to link value */
/* Named object is a symbolic link */
if (NULL == H5O_read(&grp_ent, H5O_STAB_ID, 0, &stab_mesg, dxpl_id))
@@ -2820,13 +2781,11 @@ H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link,
statbuf->linklen = HDstrlen(s) + 1; /*count the null terminator*/
- if (H5HL_unprotect(grp_ent.file, dxpl_id, heap, stab_mesg.heap_addr, heap_flags) < 0)
+ if (H5HL_unprotect(grp_ent.file, dxpl_id, heap, stab_mesg.heap_addr, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read unprotect link value")
- statbuf->objno = 0;
- statbuf->nlink = 0;
+ /* Set object type */
statbuf->type = H5G_LINK;
- statbuf->mtime = 0;
} else {
/* Some other type of object */
statbuf->objno = obj_ent.header;
@@ -2838,6 +2797,7 @@ H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link,
statbuf->mtime = 0;
}
}
+ /* Get object type */
statbuf->type = H5G_get_type(&obj_ent, dxpl_id);
H5E_clear_stack(NULL); /*clear errors resulting from checking type*/
@@ -2849,7 +2809,7 @@ H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link,
/* Common code to retrieve the file's fileno */
if(H5F_get_fileno(obj_ent.file,&statbuf->fileno)<0)
HGOTO_ERROR (H5E_FILE, H5E_BADVALUE, FAIL, "unable to read fileno");
- }
+ } /* end if */
done:
/* Free the ID to name buffers */
@@ -2884,7 +2844,7 @@ H5G_get_num_objs(H5G_entry_t *loc, hsize_t *num_objs, hid_t dxpl_id)
H5O_stab_t stab_mesg; /*info about B-tree */
herr_t ret_value;
- FUNC_ENTER_NOAPI(H5G_get_num_objs, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5G_get_num_objs);
/* Sanity check */
assert(loc);
@@ -2931,7 +2891,7 @@ H5G_get_objname_by_idx(H5G_entry_t *loc, hsize_t idx, char* name, size_t size, h
H5G_bt_ud3_t udata; /* Iteration information */
ssize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5G_get_objname_by_idx, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5G_get_objname_by_idx);
/* Sanity check */
assert(loc);
@@ -2997,7 +2957,7 @@ H5G_get_objtype_by_idx(H5G_entry_t *loc, hsize_t idx, hid_t dxpl_id)
H5G_bt_ud3_t udata; /* User data for B-tree callback */
H5G_obj_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5G_get_objtype_by_idx, H5G_UNKNOWN);
+ FUNC_ENTER_NOAPI_NOINIT(H5G_get_objtype_by_idx);
/* Sanity check */
assert(loc);
@@ -3063,10 +3023,9 @@ H5G_linkval (H5G_entry_t *loc, const char *name, size_t size, char *buf/*out*/,
H5G_entry_t grp_ent, obj_ent;
H5O_stab_t stab_mesg;
const H5HL_t *heap;
- unsigned heap_flags = H5AC__NO_FLAGS_SET;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5G_linkval, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5G_linkval);
/*
* Get the symbol table entry for the link head and the symbol table
@@ -3094,7 +3053,7 @@ H5G_linkval (H5G_entry_t *loc, const char *name, size_t size, char *buf/*out*/,
if (size>0 && buf)
HDstrncpy (buf, s, size);
- if (H5HL_unprotect(grp_ent.file, dxpl_id, heap, stab_mesg.heap_addr, heap_flags) < 0)
+ if (H5HL_unprotect(grp_ent.file, dxpl_id, heap, stab_mesg.heap_addr, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read unprotect link value")
done:
@@ -3130,7 +3089,7 @@ H5G_set_comment(H5G_entry_t *loc, const char *name, const char *buf, hid_t dxpl_
H5O_name_t comment;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5G_set_comment, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5G_set_comment);
/* Get the symbol table entry for the object */
if (H5G_namei(loc, name, NULL, NULL, &obj_ent/*out*/, H5G_TARGET_NORMAL,
@@ -3185,7 +3144,7 @@ H5G_get_comment(H5G_entry_t *loc, const char *name, size_t bufsize, char *buf, h
H5G_entry_t obj_ent;
int ret_value;
- FUNC_ENTER_NOAPI(H5G_get_comment, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5G_get_comment);
/* Get the symbol table entry for the object */
if (H5G_namei(loc, name, NULL, NULL, &obj_ent/*out*/, H5G_TARGET_NORMAL,
@@ -3241,7 +3200,9 @@ H5G_unlink(H5G_entry_t *loc, const char *name, hid_t dxpl_id)
H5RS_str_t *name_r; /* Ref-counted version of name */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5G_unlink, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5G_unlink);
+
+ /* Sanity check */
assert(loc);
assert(name && *name);
@@ -3322,7 +3283,9 @@ H5G_move(H5G_entry_t *src_loc, const char *src_name, H5G_entry_t *dst_loc,
H5RS_str_t *dst_name_r; /* Ref-counted version of dest name */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5G_move, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5G_move);
+
+ /* Sanity check */
assert(src_loc);
assert(dst_loc);
assert(src_name && *src_name);
diff --git a/src/H5Gent.c b/src/H5Gent.c
index 6005b10..d6219ab 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -203,21 +203,21 @@ H5G_ent_decode(H5F_t *f, const uint8_t **pp, H5G_entry_t *ent)
/* decode scratch-pad */
switch (ent->type) {
- case H5G_NOTHING_CACHED:
- break;
+ case H5G_NOTHING_CACHED:
+ break;
- case H5G_CACHED_STAB:
- assert(2 * H5F_SIZEOF_ADDR(f) <= H5G_SIZEOF_SCRATCH);
- H5F_addr_decode(f, pp, &(ent->cache.stab.btree_addr));
- H5F_addr_decode(f, pp, &(ent->cache.stab.heap_addr));
- break;
+ case H5G_CACHED_STAB:
+ assert(2 * H5F_SIZEOF_ADDR(f) <= H5G_SIZEOF_SCRATCH);
+ H5F_addr_decode(f, pp, &(ent->cache.stab.btree_addr));
+ H5F_addr_decode(f, pp, &(ent->cache.stab.heap_addr));
+ break;
- case H5G_CACHED_SLINK:
- UINT32DECODE (*pp, ent->cache.slink.lval_offset);
- break;
+ case H5G_CACHED_SLINK:
+ UINT32DECODE (*pp, ent->cache.slink.lval_offset);
+ break;
- default:
- HDabort();
+ default:
+ HDabort();
}
*pp = p_ret + H5G_SIZEOF_ENTRY(f);
@@ -486,8 +486,8 @@ H5G_ent_debug(H5F_t UNUSED *f, hid_t dxpl_id, const H5G_entry_t *ent, FILE * str
case H5G_CACHED_SLINK:
HDfprintf (stream, "Symbolic Link\n");
- HDfprintf(stream, "%*s%-*s ", indent, "", fwidth,
- "Cached information:\n");
+ HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth,
+ "Cached information:");
HDfprintf (stream, "%*s%-*s %lu\n", nested_indent, "", nested_fwidth,
"Link value offset:",
(unsigned long)(ent->cache.slink.lval_offset));
diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c
index fceec6d..cd2929c 100644
--- a/src/H5Tcommit.c
+++ b/src/H5Tcommit.c
@@ -139,7 +139,7 @@ H5Tcommit_expand(hid_t loc_id, const char *name, hid_t type_id, hid_t tcpl_id, h
tcpl_id = H5P_DATATYPE_CREATE_DEFAULT;
else
if(TRUE != H5P_isa_class(tcpl_id, H5P_DATATYPE_CREATE))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not datatype create property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype create property list")
#ifdef LATER
/* Get correct property list */
@@ -147,7 +147,7 @@ H5Tcommit_expand(hid_t loc_id, const char *name, hid_t type_id, hid_t tcpl_id, h
tapl_id = H5P_DATATYPE_ACCESS_DEFAULT;
else
if(TRUE != H5P_isa_class(tapl_id, H5P_DATATYPE_ACCESS))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not datatype access property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype access property list")
#endif /* LATER */
/* Commit the type */
@@ -229,7 +229,7 @@ H5T_commit(H5G_entry_t *loc, const char *name, H5T_t *type, hid_t dxpl_id,
/* Get the property list */
if (NULL == (tc_plist = H5I_object(tcpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
if (H5G_insert (loc, name, &(type->ent), dxpl_id, tc_plist)<0)
HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to name datatype")