summaryrefslogtreecommitdiffstats
path: root/src/H5Gnode.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-08-21 21:15:00 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-08-21 21:15:00 (GMT)
commit7a2756e7ae8164ac6601957f3a9617a00456f918 (patch)
tree07de6d5fe4151080e2da9375156ee5a62c2c627b /src/H5Gnode.c
parent428715468b9ddbe7077a191939fde535588afe3a (diff)
downloadhdf5-7a2756e7ae8164ac6601957f3a9617a00456f918.zip
hdf5-7a2756e7ae8164ac6601957f3a9617a00456f918.tar.gz
hdf5-7a2756e7ae8164ac6601957f3a9617a00456f918.tar.bz2
[svn-r15513] Description:
Bring back r15510 & r15512 from trunk: Fix compiler warnings and formatting. Tested on: Mac OS X/32 10.5.4 (amazon) More tests upcoming
Diffstat (limited to 'src/H5Gnode.c')
-rw-r--r--src/H5Gnode.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index f494f99..a3239c2 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -276,7 +276,7 @@ H5G_node_debug_key(FILE *stream, H5F_t *f, hid_t UNUSED dxpl_id, int indent,
HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Name:");
- s = H5HL_offset_into(f, udata->heap, key->offset);
+ s = (const char *)H5HL_offset_into(f, udata->heap, key->offset);
HDfprintf(stream, "%s\n", s);
} /* end if */
else
@@ -369,7 +369,7 @@ H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *_udata1
size = H5G_node_size_real(f);
/* Get a pointer to a buffer that's large enough for node */
- if(NULL == (node = H5WB_actual(wb, size)))
+ if(NULL == (node = (uint8_t *)H5WB_actual(wb, size)))
HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, NULL, "can't get actual buffer")
/* Read the serialized symbol table node. */
@@ -496,7 +496,7 @@ H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5G_node_
size = H5G_node_size_real(f);
/* Get a pointer to a buffer that's large enough for node */
- if(NULL == (node = H5WB_actual(wb, size)))
+ if(NULL == (node = (uint8_t *)H5WB_actual(wb, size)))
HGOTO_ERROR(H5E_SYM, H5E_NOSPACE, FAIL, "can't get actual buffer")
/* Serialize symbol table node into buffer */
@@ -599,21 +599,21 @@ done:
static herr_t
H5G_node_dest(H5F_t UNUSED *f, H5G_node_t *sym)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_dest);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_dest)
/*
* Check arguments.
*/
- assert(sym);
+ HDassert(sym);
/* Verify that node is clean */
- assert (sym->cache_info.is_dirty==FALSE);
+ HDassert(sym->cache_info.is_dirty == FALSE);
if(sym->entry)
- sym->entry = H5FL_SEQ_FREE(H5G_entry_t,sym->entry);
- H5FL_FREE(H5G_node_t,sym);
+ sym->entry = (H5G_entry_t *)H5FL_SEQ_FREE(H5G_entry_t, sym->entry);
+ (void)H5FL_FREE(H5G_node_t, sym);
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5G_node_dest() */
@@ -760,7 +760,7 @@ done:
if(sym != NULL) {
if(sym->entry != NULL)
H5FL_SEQ_FREE(H5G_entry_t, sym->entry);
- H5FL_FREE(H5G_node_t, sym);
+ (void)H5FL_FREE(H5G_node_t, sym);
} /* end if */
} /* end if */
@@ -810,7 +810,7 @@ H5G_node_cmp2(H5F_t *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_udata,
HDassert(rt_key);
/* Get base address of heap */
- base = H5HL_offset_into(f, udata->heap, (size_t)0);
+ base = (const char *)H5HL_offset_into(f, udata->heap, (size_t)0);
HDassert(base);
/* Get pointers to string names */
@@ -870,7 +870,7 @@ H5G_node_cmp3(H5F_t *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_udata,
HDassert(rt_key);
/* Get base address of heap */
- base = H5HL_offset_into(f, udata->heap, (size_t)0);
+ base = (const char *)H5HL_offset_into(f, udata->heap, (size_t)0);
HDassert(base);
/* left side */
@@ -938,11 +938,11 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *_lt_key
/*
* Load the symbol table node for exclusive access.
*/
- if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ)))
+ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to protect symbol table node")
/* Get base address of heap */
- base = H5HL_offset_into(f, udata->common.heap, (size_t)0);
+ base = (const char *)H5HL_offset_into(f, udata->common.heap, (size_t)0);
HDassert(base);
/*
@@ -1044,11 +1044,11 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr,
/*
* Load the symbol node.
*/
- if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_WRITE)))
+ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_WRITE)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node")
/* Get base address of heap */
- base = H5HL_offset_into(f, udata->common.heap, (size_t)0);
+ base = (const char *)H5HL_offset_into(f, udata->common.heap, (size_t)0);
HDassert(base);
/*
@@ -1087,7 +1087,7 @@ H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr,
if(H5G_node_create(f, dxpl_id, H5B_INS_FIRST, NULL, NULL, NULL, new_node_p/*out*/) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5B_INS_ERROR, "unable to split symbol table node")
- if(NULL == (snrt = H5AC_protect(f, dxpl_id, H5AC_SNODE, *new_node_p, NULL, NULL, H5AC_WRITE)))
+ if(NULL == (snrt = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, *new_node_p, NULL, NULL, H5AC_WRITE)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to split symbol table node")
HDmemcpy(snrt->entry, sn->entry + H5F_SYM_LEAF_K(f),
@@ -1204,7 +1204,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/,
HDassert(udata && udata->common.heap);
/* Load the symbol table */
- if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_WRITE)))
+ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_WRITE)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node")
/* "Normal" removal of a single entry from the symbol table node */
@@ -1214,7 +1214,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/,
const char *base; /* Base of heap */
/* Get base address of heap */
- base = H5HL_offset_into(f, udata->common.heap, (size_t)0);
+ base = (const char *)H5HL_offset_into(f, udata->common.heap, (size_t)0);
/* Find the name with a binary search */
rt = sn->nsyms;
@@ -1234,7 +1234,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/,
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5B_INS_ERROR, "name not found")
/* Get a pointer to the name of the link */
- if(NULL == (lnk.name = H5HL_offset_into(f, udata->common.heap, sn->entry[idx].name_off)))
+ if(NULL == (lnk.name = (char *)H5HL_offset_into(f, udata->common.heap, sn->entry[idx].name_off)))
HGOTO_ERROR(H5E_SYM, H5E_CANTGET, FAIL, "unable to get link name")
/* Set up rest of link structure */
@@ -1243,7 +1243,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/,
lnk.cset = H5T_CSET_ASCII;
if(sn->entry[idx].type == H5G_CACHED_SLINK) {
lnk.type = H5L_TYPE_SOFT;
- lnk.u.soft.name = H5HL_offset_into(f, udata->common.heap, sn->entry[idx].cache.slink.lval_offset);
+ lnk.u.soft.name = (char *)H5HL_offset_into(f, udata->common.heap, sn->entry[idx].cache.slink.lval_offset);
} /* end if */
else {
lnk.type = H5L_TYPE_HARD;
@@ -1414,7 +1414,7 @@ H5G_node_iterate(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t ad
HDassert(udata && udata->heap);
/* Protect the symbol table node & local heap while we iterate over entries */
- if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ)))
+ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node")
/*
@@ -1428,7 +1428,7 @@ H5G_node_iterate(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t ad
const char *name; /* Pointer to link name in heap */
/* Get the pointer to the name of the link in the heap */
- name = H5HL_offset_into(f, udata->heap, ents[u].name_off);
+ name = (const char *)H5HL_offset_into(f, udata->heap, ents[u].name_off);
HDassert(name);
/* Convert the entry to a link */
@@ -1491,7 +1491,7 @@ H5G_node_sumup(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr
HDassert(num_objs);
/* Find the object node and add the number of symbol entries. */
- if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ)))
+ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node")
*num_objs += sn->nsyms;
@@ -1536,7 +1536,7 @@ H5G_node_by_idx(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t add
HDassert(udata);
/* Get a pointer to the symbol table node */
- if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ)))
+ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node");
/* Find the node, locate the object symbol table entry and retrieve the name */
@@ -1674,7 +1674,7 @@ H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr,
HDassert(udata);
/* load the symbol table into memory from the source file */
- if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ)))
+ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node")
/* get the base address of the heap */
@@ -1742,7 +1742,7 @@ H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr,
/* Construct link information for eventual insertion */
lnk.type = H5L_TYPE_SOFT;
- lnk.u.soft.name = H5HL_offset_into(f, heap, src_ent->cache.slink.lval_offset);
+ lnk.u.soft.name = (char *)H5HL_offset_into(f, heap, src_ent->cache.slink.lval_offset);
} /* else if */
else
HDassert(0 && "Unknown entry type");
@@ -1754,7 +1754,7 @@ H5G_node_copy(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr,
/* lnk.name = name; */ /* This will be set in callback */
/* Determine name of source object */
- name = H5HL_offset_into(f, heap, src_ent->name_off);
+ name = (const char *)H5HL_offset_into(f, heap, src_ent->name_off);
HDassert(name);
/* Insert the new object in the destination file's group */
@@ -1809,7 +1809,7 @@ H5G_node_build_table(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_
* Save information about the symbol table node since we can't lock it
* because we're about to call an application function.
*/
- if(NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ)))
+ if(NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ)))
HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5_ITER_ERROR, "unable to load symbol table node")
/* Check if the link table needs to be extended */
@@ -1818,7 +1818,7 @@ H5G_node_build_table(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_
H5O_link_t *x; /* Pointer to larger array of links */
/* Re-allocate the link table */
- if((x = H5MM_realloc(udata->ltable->lnks, sizeof(H5O_link_t) * na)) == NULL)
+ if(NULL == (x = (H5O_link_t *)H5MM_realloc(udata->ltable->lnks, sizeof(H5O_link_t) * na)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, H5_ITER_ERROR, "memory allocation failed")
udata->ltable->lnks = x;
} /* end if */
@@ -1829,7 +1829,7 @@ H5G_node_build_table(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_
unsigned linkno; /* Link allocated */
/* Get pointer to link's name in the heap */
- name = H5HL_offset_into(f, udata->heap, sn->entry[u].name_off);
+ name = (const char *)H5HL_offset_into(f, udata->heap, sn->entry[u].name_off);
HDassert(name);
/* Determine the link to operate on in the table */
@@ -1923,7 +1923,7 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent,
* If we couldn't load the symbol table node, then try loading the
* B-tree node.
*/
- if (NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ))) {
+ if (NULL == (sn = (H5G_node_t *)H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ))) {
H5G_bt_common_t udata; /*data to pass through B-tree */
H5E_clear_stack(NULL); /* discard that error */
@@ -1948,7 +1948,7 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent,
fprintf(stream, "%*sSymbol %u:\n", indent - 3, "", u);
if(heap) {
- const char *s = H5HL_offset_into(f, heap, sn->entry[u].name_off);
+ const char *s = (const char *)H5HL_offset_into(f, heap, sn->entry[u].name_off);
if(s)
fprintf(stream, "%*s%-*s `%s'\n", indent, "", fwidth, "Name:", s);