summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5.c2
-rw-r--r--src/H5A.c2
-rw-r--r--src/H5D.c16
-rw-r--r--src/H5Distore.c10
-rw-r--r--src/H5Fistore.c10
-rw-r--r--src/H5I.c7
-rw-r--r--src/H5R.c6
-rw-r--r--src/H5S.c4
-rw-r--r--src/H5Shyper.c6
-rw-r--r--src/H5Sselect.c4
-rw-r--r--src/H5TB.c15
-rw-r--r--src/H5private.h3
12 files changed, 30 insertions, 55 deletions
diff --git a/src/H5.c b/src/H5.c
index 20d7da4..e2ecb89 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -235,7 +235,7 @@ H5_init_thread(void)
FUNC_ENTER_INIT(H5_init_thread, NULL, FAIL);
/* Add the "thread termination" routine to the exit chain */
- if (H5_add_exit(&H5_term_thread) == FAIL)
+ if (H5_add_exit(&H5_term_thread)<0)
HRETURN_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL,
"unable to set thread atexit function");
diff --git a/src/H5A.c b/src/H5A.c
index 8b3241c..da5c3ed 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -72,7 +72,7 @@ H5A_init_interface(void)
*/
if ((ret_value = H5I_init_group(H5I_ATTR, H5I_ATTRID_HASHSIZE,
H5A_RESERVED_ATOMS,
- (herr_t (*)(void *)) H5A_close)) == FAIL) {
+ (herr_t (*)(void *)) H5A_close))<0) {
HRETURN_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL,
"unable to initialize attribute group");
}
diff --git a/src/H5D.c b/src/H5D.c
index f7bc440..d37b3eb 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -1297,7 +1297,7 @@ H5D_open_oid(H5D_t *dataset, H5G_entry_t *ent)
done:
if (space)
H5S_close (space);
- if (ret_value==FAIL && dataset) {
+ if (ret_value<0 && dataset) {
if (H5F_addr_defined(&(dataset->ent.header))) {
H5O_close(&(dataset->ent));
}
@@ -1586,16 +1586,15 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
}
if (NULL==(tconv_buf=xfer_parms->tconv_buf)) {
/* Allocate temporary buffer */
- if (FAIL==(tconv_id = H5TB_get_buf(target_size, 1,
- (void **)&tconv_buf))) {
+ if ((tconv_id = H5TB_get_buf(target_size, 1, (void **)&tconv_buf))<0) {
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL,
"memory allocation failed for type conversion");
}
}
if (need_bkg && NULL==(bkg_buf=xfer_parms->bkg_buf)) {
/* Allocate temporary buffer */
- if (FAIL==(bkg_id = H5TB_get_buf(request_nelmts*dst_type_size, 1,
- (void **)&bkg_buf))) {
+ if ((bkg_id=H5TB_get_buf(request_nelmts*dst_type_size, 1,
+ (void **)&bkg_buf))<0) {
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL,
"memory allocation failed for type conversion");
}
@@ -1960,16 +1959,15 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
}
if (NULL==(tconv_buf=xfer_parms->tconv_buf)) {
/* Allocate temporary buffer */
- if (FAIL==(tconv_id = H5TB_get_buf(target_size, 1,
- (void **)&tconv_buf))) {
+ if ((tconv_id=H5TB_get_buf(target_size, 1, (void **)&tconv_buf))<0) {
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL,
"memory allocation failed for type conversion");
}
}
if (need_bkg && NULL==(bkg_buf=xfer_parms->bkg_buf)) {
/* Allocate temporary buffer */
- if (FAIL==(bkg_id = H5TB_get_buf(request_nelmts*dst_type_size, 1,
- (void **)&bkg_buf))) {
+ if ((bkg_id=H5TB_get_buf(request_nelmts*dst_type_size, 1,
+ (void **)&bkg_buf))<0) {
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL,
"memory allocation failed for type conversion");
}
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 49311f5..4eeb05f 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -1625,7 +1625,7 @@ H5F_istore_read(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout,
H5F_istore_ud1_t udata;
H5O_layout_t l; /* temporary layout */
H5D_xfer_t tmp_xfer = *xfer;
- if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)==FAIL){
+ if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)<0){
HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
"unable to locate raw data chunk");
};
@@ -1643,7 +1643,7 @@ H5F_istore_read(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout,
tmp_xfer.xfer_mode = H5D_XFER_DFLT;
if (H5F_arr_read(f, &tmp_xfer, &l, pline, fill, NULL/*no efl*/,
sub_size, size_m, sub_offset_m, offset_wrt_chunk,
- buf)==FAIL){
+ buf)<0){
HRETURN_ERROR (H5E_IO, H5E_READERROR, FAIL,
"unable to read raw data from file");
}
@@ -1802,7 +1802,7 @@ H5F_istore_write(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout,
H5F_istore_ud1_t udata;
H5O_layout_t l; /* temporary layout */
H5D_xfer_t tmp_xfer = *xfer;
- if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)==FAIL){
+ if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)<0){
HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
"unable to locate raw data chunk");
};
@@ -1820,7 +1820,7 @@ H5F_istore_write(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout,
tmp_xfer.xfer_mode = H5D_XFER_DFLT;
if (H5F_arr_write(f, &tmp_xfer, &l, pline, fill, NULL/*no efl*/,
sub_size, size_m, sub_offset_m, offset_wrt_chunk,
- buf)==FAIL){
+ buf)<0){
HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
"unable to write raw data to file");
}
@@ -2140,7 +2140,7 @@ H5F_istore_allocate (H5F_t *f, const H5O_layout_t *layout,
printf(")\n");
#endif
#ifdef NO
- if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)==FAIL){
+ if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)<0){
#endif
/* No file space assigned yet. Allocate it. */
/* The following needs improvement like calling the */
diff --git a/src/H5Fistore.c b/src/H5Fistore.c
index 49311f5..4eeb05f 100644
--- a/src/H5Fistore.c
+++ b/src/H5Fistore.c
@@ -1625,7 +1625,7 @@ H5F_istore_read(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout,
H5F_istore_ud1_t udata;
H5O_layout_t l; /* temporary layout */
H5D_xfer_t tmp_xfer = *xfer;
- if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)==FAIL){
+ if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)<0){
HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
"unable to locate raw data chunk");
};
@@ -1643,7 +1643,7 @@ H5F_istore_read(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout,
tmp_xfer.xfer_mode = H5D_XFER_DFLT;
if (H5F_arr_read(f, &tmp_xfer, &l, pline, fill, NULL/*no efl*/,
sub_size, size_m, sub_offset_m, offset_wrt_chunk,
- buf)==FAIL){
+ buf)<0){
HRETURN_ERROR (H5E_IO, H5E_READERROR, FAIL,
"unable to read raw data from file");
}
@@ -1802,7 +1802,7 @@ H5F_istore_write(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout,
H5F_istore_ud1_t udata;
H5O_layout_t l; /* temporary layout */
H5D_xfer_t tmp_xfer = *xfer;
- if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)==FAIL){
+ if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)<0){
HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
"unable to locate raw data chunk");
};
@@ -1820,7 +1820,7 @@ H5F_istore_write(H5F_t *f, const H5D_xfer_t *xfer, const H5O_layout_t *layout,
tmp_xfer.xfer_mode = H5D_XFER_DFLT;
if (H5F_arr_write(f, &tmp_xfer, &l, pline, fill, NULL/*no efl*/,
sub_size, size_m, sub_offset_m, offset_wrt_chunk,
- buf)==FAIL){
+ buf)<0){
HRETURN_ERROR (H5E_IO, H5E_WRITEERROR, FAIL,
"unable to write raw data to file");
}
@@ -2140,7 +2140,7 @@ H5F_istore_allocate (H5F_t *f, const H5O_layout_t *layout,
printf(")\n");
#endif
#ifdef NO
- if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)==FAIL){
+ if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)<0){
#endif
/* No file space assigned yet. Allocate it. */
/* The following needs improvement like calling the */
diff --git a/src/H5I.c b/src/H5I.c
index b387fc2..3a23010 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -251,7 +251,7 @@ H5I_init_group(H5I_type_t grp, /* IN: Group to initialize */
grp_ptr->count++;
done:
- if (ret_value == FAIL) {
+ if (ret_value<0) {
/* Error condition cleanup */
if (grp_ptr != NULL) {
H5MM_xfree (grp_ptr->id_list);
@@ -463,11 +463,6 @@ H5I_register(H5I_type_t grp, void *object)
ret_value = new_id;
done:
- if (ret_value == FAIL) {
- /* Error condition cleanup */
- }
-
- /* Normal function cleanup */
FUNC_LEAVE(ret_value);
}
diff --git a/src/H5R.c b/src/H5R.c
index a7d79c7..15ad790 100644
--- a/src/H5R.c
+++ b/src/H5R.c
@@ -202,7 +202,7 @@ H5Rcreate(void *ref, hid_t loc_id, const char *name, H5R_type_t ref_type, hid_t
herr_t ret_value = FAIL;
FUNC_ENTER(H5Rcreate, FAIL);
- H5TRACE5("e","*risRti",ref,loc_id,name,ref_type,space_id);
+ H5TRACE5("e","xisRti",ref,loc_id,name,ref_type,space_id);
/* Check args */
if(ref==NULL)
@@ -325,7 +325,7 @@ H5Rdereference(hid_t dataset, H5R_type_t ref_type, void *_ref)
hid_t ret_value = FAIL;
FUNC_ENTER(H5Rdereference, FAIL);
- H5TRACE2("i","i*r",dataset,_ref);
+ H5TRACE3("i","iRtx",dataset,ref_type,_ref);
/* Check args */
if (H5I_DATASET != H5I_get_type(dataset) || NULL == (dset = H5I_object(dataset)))
@@ -407,7 +407,7 @@ H5Rget_space(void *ref)
hid_t ret_value = FAIL;
FUNC_ENTER(H5Rget_space, FAIL);
- H5TRACE1("i","*r",ref);
+ H5TRACE1("i","x",ref);
/* Check args */
if(ref==NULL)
diff --git a/src/H5S.c b/src/H5S.c
index 3c689ba..09bde19 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -1247,10 +1247,6 @@ H5Sis_simple(hid_t space_id)
ret_value = H5S_is_simple(space);
done:
- if (ret_value == FAIL) { /* Error condition cleanup */
-
- } /* end if */
- /* Normal function cleanup */
FUNC_LEAVE(ret_value);
}
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 40a157f..c19a76b 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -441,7 +441,7 @@ H5S_hyper_block_cache (H5S_hyper_node_t *node,
assert(fhyper_info);
/* Allocate temporary buffer of proper size */
- if((node->cinfo.block_id=H5TB_get_buf(node->cinfo.size*fhyper_info->elmt_size,1,(void **)&(node->cinfo.block)))==FAIL)
+ if((node->cinfo.block_id=H5TB_get_buf(node->cinfo.size*fhyper_info->elmt_size,1,(void **)&(node->cinfo.block)))<0)
HRETURN_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
"can't allocate hyperslab cache block");
@@ -683,7 +683,7 @@ H5S_hyper_fread (intn dim, H5S_hyper_fhyper_info_t *fhyper_info)
/* Read information from the cached block */
if(regions[i].node->cinfo.cached) {
- if(H5S_hyper_block_read(regions[i].node,fhyper_info,region_size)==FAIL)
+ if(H5S_hyper_block_read(regions[i].node,fhyper_info,region_size)<0)
HRETURN_ERROR (H5E_DATASPACE, H5E_READERROR, 0, "read error");
}
else {
@@ -955,7 +955,7 @@ H5S_hyper_fwrite (intn dim, H5S_hyper_fhyper_info_t *fhyper_info)
/* Read information from the cached block */
if(regions[i].node->cinfo.cached) {
- if(H5S_hyper_block_write(regions[i].node,fhyper_info,region_size)==FAIL)
+ if(H5S_hyper_block_write(regions[i].node,fhyper_info,region_size)<0)
HRETURN_ERROR (H5E_DATASPACE, H5E_WRITEERROR, 0, "write error");
}
else {
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index 8e7383f..e770d3a 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -321,7 +321,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
hssize_t fill=1;
/* Allocate temporary buffer */
- if((stride_id = H5TB_get_buf(sizeof(hssize_t)*space->extent.u.simple.rank,0,(void **)&_stride)) ==FAIL)
+ if((stride_id = H5TB_get_buf(sizeof(hssize_t)*space->extent.u.simple.rank,0,(void **)&_stride))<0)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
"can't allocate stride vector");
H5V_array_fill(_stride,&fill,sizeof(hssize_t),space->extent.u.simple.rank);
@@ -332,7 +332,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
if(block==NULL) {
hssize_t fill=1;
- if((block_id = H5TB_get_buf(sizeof(hssize_t)*space->extent.u.simple.rank,0,(void **)&_block))==FAIL)
+ if((block_id = H5TB_get_buf(sizeof(hssize_t)*space->extent.u.simple.rank,0,(void **)&_block))<0)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL,
"can't allocate block vector");
H5V_array_fill(_block,&fill,sizeof(hssize_t),space->extent.u.simple.rank);
diff --git a/src/H5TB.c b/src/H5TB.c
index f07b353..9e39324 100644
--- a/src/H5TB.c
+++ b/src/H5TB.c
@@ -426,11 +426,6 @@ H5TB_resize_buf(hid_t tbuf_id, hsize_t size)
} /* end else */
} /* end if */
-#ifdef LATER
-done:
-#endif
- if (ret_value == FAIL) {
- }
FUNC_LEAVE(ret_value);
} /* H5TB_resize_buf() */
@@ -489,11 +484,6 @@ H5TB_garbage_coll(void)
ret_value=SUCCEED;
-#ifdef LATER
-done:
-#endif
- if (ret_value == FAIL) {
- }
FUNC_LEAVE(ret_value);
} /* H5TB_garbage_coll() */
@@ -532,11 +522,6 @@ H5TB_release_buf(hid_t tbuf_id)
ret_value=SUCCEED;
-#ifdef LATER
-done:
-#endif
- if (ret_value == FAIL) {
- }
FUNC_LEAVE(ret_value);
} /* H5TB_release_buf() */
diff --git a/src/H5private.h b/src/H5private.h
index 058dedf..25e93f6 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -63,7 +63,8 @@
# include <sys/time.h>
# include <sys/types.h>
# include <unistd.h>
-#endif//if defined(WIN32)
+#endif /*if defined(WIN32)*/
+
#endif
/*