diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5.c | 6 | ||||
-rw-r--r-- | src/H5A.c | 3 | ||||
-rw-r--r-- | src/H5B.c | 11 | ||||
-rw-r--r-- | src/H5D.c | 50 | ||||
-rw-r--r-- | src/H5Dio.c | 33 | ||||
-rw-r--r-- | src/H5Dprivate.h | 2 | ||||
-rw-r--r-- | src/H5F.c | 18 | ||||
-rw-r--r-- | src/H5FD.c | 556 | ||||
-rw-r--r-- | src/H5Zfletcher32.c | 3 | ||||
-rw-r--r-- | src/H5Zshuffle.c | 3 | ||||
-rwxr-xr-x | src/hdf5.lnt | 1 |
11 files changed, 348 insertions, 338 deletions
@@ -749,6 +749,7 @@ H5close(void) * *------------------------------------------------------------------------- */ +/* ARGSUSED */ int HDsnprintf(char *buf, size_t UNUSED size, const char *fmt, ...) { @@ -759,7 +760,7 @@ HDsnprintf(char *buf, size_t UNUSED size, const char *fmt, ...) n = HDvsprintf(buf, fmt, ap); va_end(ap); return n; -} /*lint !e715 */ +} #endif /* H5_HAVE_SNPRINTF */ @@ -788,11 +789,12 @@ HDsnprintf(char *buf, size_t UNUSED size, const char *fmt, ...) * *------------------------------------------------------------------------- */ +/* ARGSUSED */ int HDvsnprintf(char *buf, size_t UNUSED size, const char *fmt, va_list ap) { return HDvsprintf(buf, fmt, ap); -} /*lint !e715 */ +} #endif /* H5_HAVE_VSNPRINTF */ @@ -151,6 +151,7 @@ H5A_term_interface(void) * The LOC_ID can also be a committed data type. * --------------------------------------------------------------------------*/ +/* ARGSUSED */ hid_t H5Acreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t UNUSED plist_id) @@ -181,7 +182,7 @@ H5Acreate(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, done: FUNC_LEAVE_API(ret_value) -} /* H5Acreate() */ /*lint !e715 */ +} /* H5Acreate() */ /*------------------------------------------------------------------------- @@ -521,6 +521,7 @@ done: * *------------------------------------------------------------------------- */ +/* ARGSUSED */ static herr_t H5B_dest(H5F_t UNUSED *f, H5B_t *bt) { @@ -541,7 +542,7 @@ H5B_dest(H5F_t UNUSED *f, H5B_t *bt) H5FL_FREE(H5B_t,bt); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5B_dest() */ /*lint !e715 !e818 */ +} /* end H5B_dest() */ /*------------------------------------------------------------------------- @@ -669,7 +670,7 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u done: if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, FALSE) < 0 && ret_value>=0) - HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release node"); + HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release node") FUNC_LEAVE_NOAPI(ret_value) } @@ -829,7 +830,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, H5B_t *old_bt, haddr done: if (new_bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_addr_p, new_bt, FALSE) < 0 && ret_value>=0) - HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node"); + HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") FUNC_LEAVE_NOAPI(ret_value) } @@ -1485,7 +1486,7 @@ done: herr_t e1 = (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, FALSE) < 0); herr_t e2 = (twin && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_node_p, twin, FALSE)<0); if (e1 || e2) /*use vars to prevent short-circuit of side effects */ - HDONE_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node(s)"); + HDONE_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node(s)") } FUNC_LEAVE_NOAPI(ret_value) @@ -1858,7 +1859,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type done: if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, FALSE)<0 && ret_value>=0) - HDONE_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node"); + HDONE_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node") FUNC_LEAVE_NOAPI(ret_value) } @@ -446,6 +446,7 @@ H5D_term_interface(void) * *------------------------------------------------------------------------- */ +/* ARGSUSED */ herr_t H5D_crt_copy(hid_t new_plist_id, hid_t old_plist_id, void UNUSED *copy_data) { @@ -499,7 +500,7 @@ H5D_crt_copy(hid_t new_plist_id, hid_t old_plist_id, void UNUSED *copy_data) done: FUNC_LEAVE_NOAPI(ret_value) -} /*lint !e715 !e818 Make lint ignore copy_data parameter */ +} /*------------------------------------------------------------------------- @@ -520,6 +521,7 @@ done: * *------------------------------------------------------------------------- */ +/* ARGSUSED */ herr_t H5D_crt_close(hid_t dcpl_id, void UNUSED *close_data) { @@ -555,7 +557,7 @@ H5D_crt_close(hid_t dcpl_id, void UNUSED *close_data) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_crt_close() */ /*lint !e715 !e818 Make lint ignore close_data parameter */ +} /* end H5D_crt_close() */ /*------------------------------------------------------------------------- @@ -580,6 +582,7 @@ done: * *------------------------------------------------------------------------- */ +/* ARGSUSED */ herr_t H5D_xfer_create(hid_t dxpl_id, void UNUSED *create_data) { @@ -617,7 +620,7 @@ H5D_xfer_create(hid_t dxpl_id, void UNUSED *create_data) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_xfer_create() */ /*lint !e715 !e818 Make lint ignore create_data parameter */ +} /* end H5D_xfer_create() */ /*------------------------------------------------------------------------- @@ -638,6 +641,7 @@ done: * *------------------------------------------------------------------------- */ +/* ARGSUSED */ herr_t H5D_xfer_copy(hid_t new_plist_id, hid_t UNUSED old_plist_id, void *copy_data) @@ -651,7 +655,7 @@ H5D_xfer_copy(hid_t new_plist_id, hid_t UNUSED old_plist_id, done: FUNC_LEAVE_NOAPI(ret_value) -} /*lint !e715 !e818 Make lint ignore old_plist_id parameter */ +} /*------------------------------------------------------------------------- @@ -674,6 +678,7 @@ done: * *------------------------------------------------------------------------- */ +/* ARGSUSED */ herr_t H5D_xfer_close(hid_t dxpl_id, void UNUSED *close_data) { @@ -701,7 +706,7 @@ H5D_xfer_close(hid_t dxpl_id, void UNUSED *close_data) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_xfer_close() */ /*lint !e715 !e818 Make lint ignore close_data parameter */ +} /* end H5D_xfer_close() */ /*------------------------------------------------------------------------- @@ -787,7 +792,7 @@ done: if(ret_value<0) { if(new_dset!=NULL) { if(H5D_close(new_dset)<0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset"); + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") } /* end if */ } /* end if */ @@ -937,7 +942,7 @@ done: if(ret_value<0) { if(space!=NULL) { if(H5S_close(space)<0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace"); + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") } /* end if */ } /* end if */ @@ -1106,7 +1111,7 @@ done: if(ret_value<0) { if(copied_type!=NULL) { if(H5T_close (copied_type)<0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype"); + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release datatype") } /* end if */ } /* end if */ @@ -1533,7 +1538,7 @@ done: /* Release pointer to object header itself */ if(ent!=NULL && oh!=NULL) if(H5O_unprotect(ent,oh, dxpl_id)<0) - HDONE_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to unprotect dataset object header"); + HDONE_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to unprotect dataset object header") FUNC_LEAVE_NOAPI(ret_value) } @@ -1921,23 +1926,23 @@ done: if (!ret_value && new_dset) { if (new_dset->space) { if(H5S_close(new_dset->space)<0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release dataspace"); + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release dataspace") } /* end if */ if (new_dset->type) { if(H5T_close(new_dset->type)<0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype"); + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype") } /* end if */ if (H5F_addr_defined(new_dset->ent.header)) { if(H5O_close(&(new_dset->ent))<0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release object header"); + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release object header") if(file) { if(H5O_delete(file, dxpl_id,new_dset->ent.header)<0) - HDONE_ERROR(H5E_DATASET, H5E_CANTDELETE, NULL, "unable to delete object header"); + HDONE_ERROR(H5E_DATASET, H5E_CANTDELETE, NULL, "unable to delete object header") } /* end if */ } /* end if */ if(new_dset->dcpl_id!=0) { if(H5I_dec_ref(new_dset->dcpl_id)<0) - HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement ref count on property list"); + HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement ref count on property list") } /* end if */ new_dset->ent.file = NULL; H5FL_FREE(H5D_t,new_dset); @@ -2291,15 +2296,15 @@ done: if (ret_value==NULL && dataset) { if (H5F_addr_defined(dataset->ent.header)) { if(H5O_close(&(dataset->ent))<0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release object header"); + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release object header") } /* end if */ if (dataset->space) { if(H5S_close(dataset->space)<0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release dataspace"); + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release dataspace") } /* end if */ if (dataset->type) { if(H5T_close(dataset->type)<0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype"); + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release datatype") } /* end if */ dataset->ent.file = NULL; H5FL_FREE(H5D_t,dataset); @@ -3174,6 +3179,7 @@ done: * *------------------------------------------------------------------------- */ +/* ARGSUSED */ static herr_t H5D_vlen_get_buf_size(void UNUSED *elem, hid_t type_id, hsize_t UNUSED ndim, hssize_t *point, void *op_data) { @@ -3204,7 +3210,7 @@ H5D_vlen_get_buf_size(void UNUSED *elem, hid_t type_id, hsize_t UNUSED ndim, hss done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_vlen_get_buf_size() */ /*lint !e715 !e818 Make lint ignore unused parameters */ +} /* end H5D_vlen_get_buf_size() */ /*------------------------------------------------------------------------- @@ -3298,11 +3304,11 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, done: if(vlen_bufsize.fspace_id>0) { if(H5I_dec_ref(vlen_bufsize.fspace_id)<0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace"); + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") } /* end if */ if(vlen_bufsize.mspace_id>0) { if(H5I_dec_ref(vlen_bufsize.mspace_id)<0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace"); + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") } /* end if */ if(vlen_bufsize.fl_tbuf!=NULL) H5FL_BLK_FREE(vlen_fl_buf,vlen_bufsize.fl_tbuf); @@ -3310,7 +3316,7 @@ done: H5FL_BLK_FREE(vlen_vl_buf,vlen_bufsize.vl_tbuf); if(vlen_bufsize.xfer_pid>0) { if(H5I_dec_ref(vlen_bufsize.xfer_pid)<0) - HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to decrement ref count on property list"); + HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, FAIL, "unable to decrement ref count on property list") } /* end if */ FUNC_LEAVE_API(ret_value) @@ -3486,7 +3492,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_flush(H5F_t *f, hid_t dxpl_id) +H5D_flush(const H5F_t *f, hid_t dxpl_id) { int num_dsets; /* Number of datasets in file */ hid_t *id_list=NULL; /* list of dataset IDs */ diff --git a/src/H5Dio.c b/src/H5Dio.c index 131cad1..d9bc1e9 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -917,6 +917,7 @@ done: * *------------------------------------------------------------------------- */ +/* ARGSUSED */ static herr_t H5D_contig_read(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, const H5S_t *file_space, H5T_path_t *tpath, @@ -1154,7 +1155,7 @@ done: H5FL_BLK_FREE(type_conv,bkg_buf); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_read() */ /*lint !e715 !e818 Make lint ignore type_id, coords and elem parameters */ +} /* end H5D_contig_read() */ /*------------------------------------------------------------------------- @@ -1173,6 +1174,7 @@ done: * *------------------------------------------------------------------------- */ +/* ARGSUSED */ static herr_t H5D_contig_write(hsize_t nelmts, H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space, const H5S_t *file_space, H5T_path_t *tpath, H5S_conv_t *sconv, H5P_genplist_t *dc_plist, @@ -1408,7 +1410,7 @@ done: H5FL_BLK_FREE(type_conv,bkg_buf); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_write() */ /*lint !e715 !e818 Make lint ignore type_id, coords and elem parameters */ +} /* end H5D_contig_write() */ /*------------------------------------------------------------------------- @@ -1427,6 +1429,7 @@ done: * *------------------------------------------------------------------------- */ +/* ARGSUSED */ static herr_t H5D_chunk_read(hsize_t #ifdef NDEBUG @@ -1720,7 +1723,7 @@ done: #endif xfer_mode = H5FD_MPIO_COLLECTIVE; if(H5P_set (dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode) < 0) - HDONE_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode"); + HDONE_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") } /* end if */ #endif /*H5_HAVE_PARALLEL*/ @@ -1746,10 +1749,10 @@ done: /* Release chunk mapping information */ if(H5D_destroy_chunk_map(&fm) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't release chunk mapping"); + HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't release chunk mapping") FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_chunk_read() */ /*lint !e715 !e818 Make lint ignore type_id, coords and elem parameters */ +} /* H5D_chunk_read() */ /*------------------------------------------------------------------------- @@ -1768,6 +1771,7 @@ done: * *------------------------------------------------------------------------- */ +/* ARGSUSED */ static herr_t H5D_chunk_write(hsize_t #ifdef NDEBUG @@ -2104,7 +2108,7 @@ done: #endif xfer_mode = H5FD_MPIO_COLLECTIVE; if(H5P_set (dx_plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode) < 0) - HDONE_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode"); + HDONE_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set transfer mode") } /* end if */ #endif /*H5_HAVE_PARALLEL*/ @@ -2130,10 +2134,10 @@ done: /* Release chunk mapping information */ if(H5D_destroy_chunk_map(&fm) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't release chunk mapping"); + HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't release chunk mapping") FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_chunk_write() */ /*lint !e715 !e818 Make lint ignore type_id, coords and elem parameters */ +} /* H5D_chunk_write() */ #ifdef H5_HAVE_PARALLEL @@ -2482,20 +2486,20 @@ done: if(ret_value<0) { if(tmp_mspace && !fm->mchunk_tmpl) { if(H5S_close(tmp_mspace)<0) - HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "can't release memory chunk dataspace template"); + HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "can't release memory chunk dataspace template") } /* end if */ if (H5D_destroy_chunk_map(fm)<0) - HDONE_ERROR (H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release chunk mapping"); + HDONE_ERROR (H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release chunk mapping") } /* end if */ if(equiv_mspace) { if(H5S_close(equiv_mspace)<0) - HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "can't release memory chunk dataspace template"); + HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "can't release memory chunk dataspace template") } /* end if */ if(iter_init) { if (H5S_select_iter_release(&(fm->mem_iter))<0) - HDONE_ERROR (H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection iterator"); + HDONE_ERROR (H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release selection iterator") } if(f_tid!=(-1)) { if(H5I_dec_ref(f_tid)<0) @@ -2772,7 +2776,7 @@ H5D_create_chunk_file_map_hyper(const fm_map *fm) done: if(tmp_fspace) if(H5S_close(tmp_fspace)<0) - HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "can't release file dataspace copy"); + HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "can't release file dataspace copy") FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_create_chunk_file_map_hyper() */ @@ -3062,6 +3066,7 @@ done: * *------------------------------------------------------------------------- */ +/* ARGSUSED */ static herr_t H5D_chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, hsize_t ndims, hssize_t *coords, void *_fm) { @@ -3132,4 +3137,4 @@ H5D_chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, hsize_t ndims, hssize_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_mem_cb() */ /*lint !e715 !e818 Make lint ignore type_id, coords and elem parameters */ +} /* end H5D_chunk_mem_cb() */ diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index ac8df08..2923bfb 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -157,6 +157,6 @@ H5_DLL herr_t H5D_xfer_create(hid_t dxpl_id, void *create_data); H5_DLL herr_t H5D_xfer_copy(hid_t new_plist_id, hid_t old_plist_id, void *copy_data); H5_DLL herr_t H5D_xfer_close(hid_t dxpl_id, void *close_data); -H5_DLL herr_t H5D_flush(H5F_t *f, hid_t dxpl_id); +H5_DLL herr_t H5D_flush(const H5F_t *f, hid_t dxpl_id); #endif @@ -511,6 +511,7 @@ H5F_term_interface(void) * *---------------------------------------------------------------------------- */ +/* ARGSUSED */ herr_t H5F_acs_create(hid_t fapl_id, void UNUSED *copy_data) { @@ -546,7 +547,7 @@ H5F_acs_create(hid_t fapl_id, void UNUSED *copy_data) done: FUNC_LEAVE_NOAPI(ret_value) -} /*lint !e715 !e818 Make lint ignore copy_data parameter */ +} /*-------------------------------------------------------------------------- @@ -567,6 +568,7 @@ done: * *--------------------------------------------------------------------------- */ +/* ARGSUSED */ herr_t H5F_acs_close(hid_t fapl_id, void UNUSED *close_data) { @@ -602,7 +604,7 @@ H5F_acs_close(hid_t fapl_id, void UNUSED *close_data) done: FUNC_LEAVE_NOAPI(ret_value) -} /*lint !e715 !e818 Make lint ignore close_data parameter */ +} /*-------------------------------------------------------------------------- @@ -621,6 +623,7 @@ done: * *-------------------------------------------------------------------------- */ +/* ARGSUSED */ herr_t H5F_acs_copy(hid_t new_fapl_id, hid_t old_fapl_id, void UNUSED *copy_data) { @@ -655,7 +658,7 @@ H5F_acs_copy(hid_t new_fapl_id, hid_t old_fapl_id, void UNUSED *copy_data) done: FUNC_LEAVE_NOAPI(ret_value) -} /*lint !e715 !e818 Make lint ignore copy_data parameter */ +} #ifdef NOT_YET @@ -1302,6 +1305,7 @@ done: * *------------------------------------------------------------------------- */ +/* ARGSUSED */ static int H5F_equal(void *_haystack, hid_t UNUSED id, void *_needle) { @@ -1314,7 +1318,7 @@ H5F_equal(void *_haystack, hid_t UNUSED id, void *_needle) retval = (0==H5FD_cmp(haystack->shared->lf, needle)); FUNC_LEAVE_NOAPI(retval) -} /*lint !e715 !e818 Make lint ignore id parameter */ +} /*------------------------------------------------------------------------- @@ -1429,7 +1433,7 @@ done: /* Close the file */ if (file) if(H5FD_close(file)<0 && ret_value>=0) - HDONE_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file"); + HDONE_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file") FUNC_LEAVE_API(ret_value) } @@ -3422,7 +3426,7 @@ H5F_unmount(H5G_entry_t *loc, const char *name, hid_t dxpl_id) done: if (mounted) if(H5G_close(mounted)<0 && ret_value>=0) - HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close group"); + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close group") FUNC_LEAVE_NOAPI(ret_value) } @@ -3709,7 +3713,7 @@ H5Freopen(hid_t file_id) done: if (ret_value<0 && new_file) if(H5F_close(new_file)<0) - HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close file"); + HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close file") FUNC_LEAVE_API(ret_value) } @@ -25,6 +25,10 @@ #define H5F_PACKAGE /*suppress error about including H5Fpkg */ +/* Pablo information */ +/* (Put before include files to avoid problems with inline functions) */ +#define PABLO_MASK H5FD_mask + /* Packages needed by this file */ #include "H5private.h" /*library functions */ #include "H5Dprivate.h" /*datasets */ @@ -42,7 +46,6 @@ #endif /* H5_HAVE_FPHDF5 */ /* Interface initialization */ -#define PABLO_MASK H5FD_mask #define INTERFACE_INIT H5FD_init_interface static int interface_initialize_g = 0; @@ -106,16 +109,16 @@ H5FD_init_interface(void) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOINIT(H5FD_init_interface); + FUNC_ENTER_NOINIT(H5FD_init_interface) if (H5I_init_group(H5I_VFL, H5I_VFL_HASHSIZE, 0, (H5I_free_t)H5FD_free_cls)<0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize interface"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize interface") /* Reset the file serial numbers */ file_serial_no=0; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -144,7 +147,7 @@ H5FD_term_interface(void) { int n = 0; - FUNC_ENTER_NOINIT(H5FD_term_interface); + FUNC_ENTER_NOINIT(H5FD_term_interface) if (interface_initialize_g) { if ((n=H5I_nmembers(H5I_VFL))) { @@ -155,7 +158,7 @@ H5FD_term_interface(void) n = 1; /*H5I*/ } } - FUNC_LEAVE_NOAPI(n); + FUNC_LEAVE_NOAPI(n) } @@ -180,11 +183,11 @@ H5FD_term_interface(void) static herr_t H5FD_free_cls(H5FD_class_t *cls) { - FUNC_ENTER_NOINIT(H5FD_free_cls); + FUNC_ENTER_NOINIT(H5FD_free_cls) H5MM_xfree(cls); - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -216,44 +219,44 @@ H5FDregister(const H5FD_class_t *cls) H5FD_class_t *saved=NULL; H5FD_mem_t type; - FUNC_ENTER_API(H5FDregister, FAIL); + FUNC_ENTER_API(H5FDregister, FAIL) H5TRACE1("i","x",cls); /* Check arguments */ if (!cls) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "null class pointer is disallowed"); + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "null class pointer is disallowed") if (!cls->open || !cls->close) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`open' and/or `close' methods are not defined"); + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`open' and/or `close' methods are not defined") if (!cls->get_eoa || !cls->set_eoa) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eoa' and/or `set_eoa' methods are not defined"); + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eoa' and/or `set_eoa' methods are not defined") if (!cls->get_eof) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eof' method is not defined"); + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`get_eof' method is not defined") if (!cls->read || !cls->write) - HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`read' and/or `write' method is not defined"); + HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, FAIL, "`read' and/or `write' method is not defined") for (type=H5FD_MEM_DEFAULT; type<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,type)) { if (cls->fl_map[type]<H5FD_MEM_NOLIST || cls->fl_map[type]>=H5FD_MEM_NTYPES) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid free-list mapping"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid free-list mapping") } /* Copy the class structure so the caller can reuse or free it */ if (NULL==(saved=H5MM_malloc(sizeof(H5FD_class_t)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for file driver class struct"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for file driver class struct") *saved = *cls; /* Create the new class ID */ if ((ret_value=H5I_register(H5I_VFL, saved))<0) - HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register file driver ID"); + HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register file driver ID") done: if(ret_value<0) if(saved) H5MM_xfree(saved); - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -281,19 +284,19 @@ H5FDunregister(hid_t driver_id) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDunregister, FAIL); + FUNC_ENTER_API(H5FDunregister, FAIL) H5TRACE1("e","i",driver_id); /* Check arguments */ if (NULL==H5I_object_verify(driver_id,H5I_VFL)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file driver"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file driver") /* The H5FD_class_t struct will be freed by this function */ if (H5I_dec_ref(driver_id)<0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to unregister file driver"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to unregister file driver") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -331,30 +334,30 @@ H5FD_get_class(hid_t id) H5FD_class_t *ret_value=NULL; hid_t driver_id = -1; - FUNC_ENTER_NOAPI(H5FD_get_class, NULL); + FUNC_ENTER_NOAPI(H5FD_get_class, NULL) if (H5I_VFL==H5I_get_type(id)) { ret_value = H5I_object(id); } else { /* Get the plist structure */ if(NULL == (plist = H5I_object(id))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID"); + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, NULL, "can't find object for ID") if (TRUE==H5P_isa_class(id,H5P_FILE_ACCESS)) { if(H5P_get(plist, H5F_ACS_FILE_DRV_ID_NAME, &driver_id) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get driver ID"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get driver ID") ret_value = H5FD_get_class(driver_id); } else if (TRUE==H5P_isa_class(id,H5P_DATASET_XFER)) { if(H5P_get(plist, H5D_XFER_VFL_ID_NAME, &driver_id) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get driver ID"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get driver ID") ret_value = H5FD_get_class(driver_id); } else { - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a driver id, file access property list or data transfer property list"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a driver id, file access property list or data transfer property list") } } /* end if */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -381,7 +384,7 @@ H5FD_sb_size(H5FD_t *file) { hsize_t ret_value=0; - FUNC_ENTER_NOAPI(H5FD_sb_size, 0); + FUNC_ENTER_NOAPI(H5FD_sb_size, 0) assert(file && file->cls); @@ -389,7 +392,7 @@ H5FD_sb_size(H5FD_t *file) ret_value = (file->cls->sb_size)(file); done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -419,15 +422,15 @@ H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_sb_encode, FAIL); + FUNC_ENTER_NOAPI(H5FD_sb_encode, FAIL) assert(file && file->cls); if (file->cls->sb_encode && (file->cls->sb_encode)(file, name/*out*/, buf/*out*/)<0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_encode request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_encode request failed") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -452,15 +455,15 @@ H5FD_sb_decode(H5FD_t *file, const char *name, const uint8_t *buf) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_sb_decode, FAIL); + FUNC_ENTER_NOAPI(H5FD_sb_decode, FAIL) assert(file && file->cls); if (file->cls->sb_decode && (file->cls->sb_decode)(file, name, buf)<0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_decode request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_decode request failed") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -495,7 +498,7 @@ H5FD_fapl_get(H5FD_t *file) { void *ret_value=NULL; - FUNC_ENTER_NOAPI(H5FD_fapl_get, NULL); + FUNC_ENTER_NOAPI(H5FD_fapl_get, NULL) assert(file); @@ -503,7 +506,7 @@ H5FD_fapl_get(H5FD_t *file) ret_value = (file->cls->fapl_get)(file); done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -534,11 +537,11 @@ H5FD_fapl_copy(hid_t driver_id, const void *old_fapl) H5FD_class_t *driver=NULL; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_fapl_copy, NULL); + FUNC_ENTER_NOAPI(H5FD_fapl_copy, NULL) /* Check args */ if (NULL==(driver=H5I_object(driver_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a driver ID"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a driver ID") if (!old_fapl) HGOTO_DONE(NULL); /*but no error*/ @@ -546,16 +549,17 @@ H5FD_fapl_copy(hid_t driver_id, const void *old_fapl) if (driver->fapl_copy) { new_fapl = (driver->fapl_copy)(old_fapl); } else if (driver->fapl_size>0) { - new_fapl = H5MM_malloc(driver->fapl_size); + if((new_fapl = H5MM_malloc(driver->fapl_size))==NULL) + HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, NULL, "fapl allocation failed") HDmemcpy(new_fapl, old_fapl, driver->fapl_size); } else - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, "no way to copy driver file access property list"); + HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, "no way to copy driver file access property list") /* Set return value */ ret_value=new_fapl; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -581,22 +585,22 @@ H5FD_fapl_free(hid_t driver_id, void *fapl) H5FD_class_t *driver=NULL; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_fapl_free, FAIL); + FUNC_ENTER_NOAPI(H5FD_fapl_free, FAIL) /* Check args */ if (NULL==(driver=H5I_object(driver_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a driver ID"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a driver ID") /* Allow driver to free or do it ourselves */ if (fapl && driver->fapl_free) { if ((driver->fapl_free)(fapl)<0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver fapl_free request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver fapl_free request failed") } else { H5MM_xfree(fapl); } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -627,11 +631,11 @@ H5FD_dxpl_copy(hid_t driver_id, const void *old_dxpl, void **copied_dxpl) H5FD_class_t *driver=NULL; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_dxpl_copy, FAIL); + FUNC_ENTER_NOAPI(H5FD_dxpl_copy, FAIL) /* Check args */ if (NULL==(driver=H5I_object(driver_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a driver ID"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a driver ID") /* Copy old dxpl, if one exists */ if (old_dxpl) { @@ -643,14 +647,14 @@ H5FD_dxpl_copy(hid_t driver_id, const void *old_dxpl, void **copied_dxpl) assert(new_dxpl); HDmemcpy(new_dxpl, old_dxpl, driver->dxpl_size); } else - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "no way to copy driver file access property list"); + HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, FAIL, "no way to copy driver file access property list") } /* end if */ /* Set copied value */ *copied_dxpl=new_dxpl; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -676,22 +680,22 @@ H5FD_dxpl_free(hid_t driver_id, void *dxpl) H5FD_class_t *driver=NULL; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_dxpl_free, FAIL); + FUNC_ENTER_NOAPI(H5FD_dxpl_free, FAIL) /* Check args */ if (NULL==(driver=H5I_object(driver_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a driver ID"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a driver ID") /* Allow driver to free or do it ourselves */ if (dxpl && driver->dxpl_free) { if ((driver->dxpl_free)(dxpl)<0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver dxpl_free request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver dxpl_free request failed") } else { H5MM_xfree(dxpl); } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -755,20 +759,20 @@ H5FDopen(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { H5FD_t *ret_value=NULL; - FUNC_ENTER_API(H5FDopen, NULL); + FUNC_ENTER_API(H5FDopen, NULL) /* Check arguments */ if(H5P_DEFAULT == fapl_id) fapl_id = H5P_FILE_ACCESS_DEFAULT; else if (TRUE!=H5P_isa_class(fapl_id,H5P_FILE_ACCESS)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") if (NULL==(ret_value=H5FD_open(name, flags, fapl_id, maxaddr))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "unable to open file"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "unable to open file") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -804,59 +808,60 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) H5P_genplist_t *plist; /* Property list pointer */ H5FD_t *ret_value; - FUNC_ENTER_NOAPI(H5FD_open, NULL); + FUNC_ENTER_NOAPI(H5FD_open, NULL) /* Get file access property list */ if(NULL == (plist = H5I_object(fapl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") if (0==maxaddr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "zero format address range"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "zero format address range") if(H5P_get(plist, H5F_ACS_FILE_DRV_ID_NAME, &driver_id) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get driver ID"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get driver ID") /* Get driver info */ if (NULL==(driver=H5I_object(driver_id))) - HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "invalid driver ID in file access property list"); + HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "invalid driver ID in file access property list") if (NULL==driver->open) - HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, "file driver has no `open' method"); + HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, "file driver has no `open' method") /* Dispatch to file driver */ if (HADDR_UNDEF==maxaddr) maxaddr = driver->maxaddr; if (NULL==(file=(driver->open)(name, flags, fapl_id, maxaddr))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "open failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "open failed") /* * Fill in public fields. We must increment the reference count on the * driver ID to prevent it from being freed while this file is open. */ file->driver_id = driver_id; - H5I_inc_ref(file->driver_id); + if(H5I_inc_ref(file->driver_id)<0) + HGOTO_ERROR(H5E_VFL, H5E_CANTINC, NULL, "unable to increment ref count on VFL driver") file->cls = driver; file->maxaddr = maxaddr; HDmemset(file->fl, 0, sizeof(file->fl)); if(H5P_get(plist, H5F_ACS_META_BLOCK_SIZE_NAME, &(meta_block_size)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get meta data block size"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get meta data block size") file->def_meta_block_size = meta_block_size; if(H5P_get(plist, H5F_ACS_SDATA_BLOCK_SIZE_NAME, &(sdata_block_size)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'small data' block size"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get 'small data' block size") file->def_sdata_block_size = sdata_block_size; file->accum_loc = HADDR_UNDEF; if(H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &(file->threshold)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get alignment threshold"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get alignment threshold") if(H5P_get(plist, H5F_ACS_ALIGN_NAME, &(file->alignment)) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get alignment"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get alignment") /* Retrieve the VFL driver feature flags */ if (H5FD_query(file, &(file->feature_flags))<0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "unable to query file driver"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "unable to query file driver") /* Increment the global serial number & assign it to this H5FD_t object */ if(++file_serial_no==0) { /* (Just error out if we wrap around for now...) */ - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "unable to get file serial number"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "unable to get file serial number") } /* end if */ file->fileno=file_serial_no; @@ -865,7 +870,7 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) done: /* Can't cleanup 'file' information, since we don't know what type it is */ - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -894,17 +899,17 @@ H5FDclose(H5FD_t *file) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDclose, FAIL); + FUNC_ENTER_API(H5FDclose, FAIL) H5TRACE1("e","x",file); if (!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") if (H5FD_close(file)<0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to close file"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to close file") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -938,17 +943,18 @@ H5FD_close(H5FD_t *file) const H5FD_class_t *driver; herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_close, FAIL); + FUNC_ENTER_NOAPI(H5FD_close, FAIL) /* check args */ assert(file && file->cls); /* Free the freelist (this call never fails) */ - H5FD_free_freelist(file); + (void)H5FD_free_freelist(file); /* Prepare to close file by clearing all public fields */ driver = file->cls; - H5I_dec_ref(file->driver_id); + if(H5I_dec_ref(file->driver_id)<0) + HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't close driver ID") /* * Dispatch to the driver for actual close. If the driver fails to @@ -957,10 +963,10 @@ H5FD_close(H5FD_t *file) assert(driver->close); if ((driver->close)(file) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "close failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "close failed") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -985,7 +991,7 @@ H5FD_free_freelist(H5FD_t *file) #endif /* H5F_DEBUG */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_free_freelist, FAIL); + FUNC_ENTER_NOAPI(H5FD_free_freelist, FAIL) /* check args */ assert(file && file->cls); @@ -1030,7 +1036,7 @@ H5FD_free_freelist(H5FD_t *file) } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -1063,13 +1069,13 @@ H5FDcmp(const H5FD_t *f1, const H5FD_t *f2) { int ret_value; - FUNC_ENTER_API(H5FDcmp, -1); /*return value is arbitrary*/ + FUNC_ENTER_API(H5FDcmp, -1) /*return value is arbitrary*/ H5TRACE2("Is","xx",f1,f2); ret_value = H5FD_cmp(f1, f2); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -1094,32 +1100,32 @@ H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2) { int ret_value; - FUNC_ENTER_NOAPI(H5FD_cmp, -1); /*return value is arbitrary*/ + FUNC_ENTER_NOAPI(H5FD_cmp, -1) /*return value is arbitrary*/ if ((!f1 || !f1->cls) && (!f2 || !f2->cls)) - HGOTO_DONE(0); + HGOTO_DONE(0) if (!f1 || !f1->cls) - HGOTO_DONE(-1); + HGOTO_DONE(-1) if (!f2 || !f2->cls) - HGOTO_DONE(1); + HGOTO_DONE(1) if (f1->cls < f2->cls) - HGOTO_DONE(-1); + HGOTO_DONE(-1) if (f1->cls > f2->cls) - HGOTO_DONE(1); + HGOTO_DONE(1) /* Files are same driver; no cmp callback */ if (!f1->cls->cmp) { if (f1<f2) - HGOTO_DONE(-1); + HGOTO_DONE(-1) if (f1>f2) - HGOTO_DONE(1); - HGOTO_DONE(0); + HGOTO_DONE(1) + HGOTO_DONE(0) } ret_value = (f1->cls->cmp)(f1, f2); done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -1144,7 +1150,7 @@ H5FDquery(const H5FD_t *f, unsigned long *flags/*out*/) { int ret_value; - FUNC_ENTER_API(H5FDquery, FAIL); + FUNC_ENTER_API(H5FDquery, FAIL) H5TRACE2("Is","xx",f,flags); assert(f); @@ -1153,7 +1159,7 @@ H5FDquery(const H5FD_t *f, unsigned long *flags/*out*/) ret_value = H5FD_query(f, flags); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -1178,7 +1184,7 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) { int ret_value=0; - FUNC_ENTER_NOAPI(H5FD_query, FAIL); + FUNC_ENTER_NOAPI(H5FD_query, FAIL) assert(f); assert(flags); @@ -1190,7 +1196,7 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) *flags=0; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -1240,28 +1246,28 @@ H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { haddr_t ret_value = HADDR_UNDEF; - FUNC_ENTER_API(H5FDalloc, HADDR_UNDEF); + FUNC_ENTER_API(H5FDalloc, HADDR_UNDEF) H5TRACE4("a","xMtih",file,type,dxpl_id,size); /* Check args */ if (!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer") if (type<0 || type>=H5FD_MEM_NTYPES) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid request type"); - if (size<=0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "zero-size request"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid request type") + if (size==0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "zero-size request") if (H5P_DEFAULT == dxpl_id) dxpl_id= H5P_DATASET_XFER_DEFAULT; else if (TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "not a data transfer property list"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "not a data transfer property list") /* Do the real work */ if (HADDR_UNDEF==(ret_value=H5FD_alloc(file, type, dxpl_id, size))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate file memory"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "unable to allocate file memory") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -1298,7 +1304,7 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) H5FD_mem_t mapped_type; haddr_t ret_value = HADDR_UNDEF; - FUNC_ENTER_NOAPI(H5FD_alloc, HADDR_UNDEF); + FUNC_ENTER_NOAPI(H5FD_alloc, HADDR_UNDEF) /* check args */ assert(file); @@ -1321,11 +1327,11 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) /* Get the data xfer property list */ if ((plist = H5I_object(dxpl_id)) == NULL) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, HADDR_UNDEF, "not a dataset transfer list"); + HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, HADDR_UNDEF, "not a dataset transfer list") if (H5P_exist_plist(plist, H5FD_FPHDF5_CAPTN_ALLOC_ONLY) > 0) if (H5P_get(plist, H5FD_FPHDF5_CAPTN_ALLOC_ONLY, &capt_only) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, HADDR_UNDEF, "can't retrieve FPHDF5 property"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, HADDR_UNDEF, "can't retrieve FPHDF5 property") HDmemset(&fp_alloc, 0, sizeof(fp_alloc)); @@ -1339,7 +1345,7 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) &fp_alloc.eoa, &req_id, &status) != SUCCEED) /* FIXME: Should we check the "status" variable here? */ HGOTO_ERROR(H5E_FPHDF5, H5E_CANTALLOC, HADDR_UNDEF, - "server couldn't allocate from file"); + "server couldn't allocate from file") } if (capt_only) { @@ -1356,7 +1362,7 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) file->cls->set_eoa(file, fp_alloc.eoa); /* We've succeeded -- return the value */ - HGOTO_DONE(fp_alloc.addr); + HGOTO_DONE(fp_alloc.addr) } #endif /* H5_HAVE_FPHDF5 */ @@ -1375,7 +1381,7 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) /* Try to allocate from the free list first */ if ((ret_value = H5FD_alloc_from_free_list(file, type, mapped_type, size)) != HADDR_UNDEF) - HGOTO_DONE(ret_value); + HGOTO_DONE(ret_value) #ifdef H5F_DEBUG if (H5DEBUG(F)) @@ -1385,15 +1391,15 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) if (type != H5FD_MEM_DRAW) { /* Handle metadata differently from "raw" data */ if ((ret_value = H5FD_alloc_metadata(file, type, dxpl_id, size)) == HADDR_UNDEF) - HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "can't allocate for metadata"); + HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "can't allocate for metadata") } else { /* Allocate "raw" data */ if ((ret_value = H5FD_alloc_raw(file, type, dxpl_id, size)) == HADDR_UNDEF) - HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "can't allocate for raw data"); + HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "can't allocate for raw data") } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -1416,7 +1422,7 @@ H5FD_alloc_from_free_list(H5FD_t *file, H5FD_mem_t type, { haddr_t ret_value = HADDR_UNDEF; - FUNC_ENTER_NOAPI(H5FD_alloc_from_free_list, HADDR_UNDEF); + FUNC_ENTER_NOAPI(H5FD_alloc_from_free_list, HADDR_UNDEF) assert(file); assert(type >= 0 && type < H5FD_MEM_NTYPES); @@ -1483,7 +1489,7 @@ H5FD_alloc_from_free_list(H5FD_t *file, H5FD_mem_t type, if (size == file->maxsize) file->maxsize = 0; /*unknown*/ - HGOTO_DONE(ret_value); + HGOTO_DONE(ret_value) } } @@ -1537,7 +1543,7 @@ H5FD_alloc_from_free_list(H5FD_t *file, H5FD_mem_t type, if (size == file->maxsize) file->maxsize = 0; /*unknown*/ - HGOTO_DONE(ret_value); + HGOTO_DONE(ret_value) } } else { if (cur->size > size && (!best || cur->size < best->size)) @@ -1571,7 +1577,7 @@ H5FD_alloc_from_free_list(H5FD_t *file, H5FD_mem_t type, } else { best->addr += size; /* Reduce size of block on free list */ best->size -= size; - HGOTO_DONE(ret_value); + HGOTO_DONE(ret_value) } } else { /* @@ -1590,48 +1596,31 @@ H5FD_alloc_from_free_list(H5FD_t *file, H5FD_mem_t type, */ if (type == H5FD_MEM_DRAW && (file->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && - H5F_addr_overlap(ret_value, size, file->accum_loc, - file->accum_size)) { + H5F_addr_overlap(ret_value, size, file->accum_loc, file->accum_size)) { ret_value = HADDR_UNDEF; } else { /* Attempt to allocate memory for temporary node */ - tmp = H5FL_MALLOC(H5FD_free_t); - -#ifdef H5F_DEBUG - if (H5DEBUG(F)) - HDfprintf(H5DEBUG(F), - "%s: 3 pieces, begin best->addr=%a, best->size=%Hd, " - "head=%Hd, size=%Hd\n", - FUNC, best->addr, best->size, head, size); -#endif /* H5F_DEBUG */ - - assert(tmp); /* bark in debug mode */ + if((tmp = H5FL_MALLOC(H5FD_free_t))==NULL) + HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "free block allocation failed") - if (tmp) { - if ((tmp->size = (best->size - head - size))) { - tmp->addr = best->addr + head + size; - tmp->next = best->next; - best->next = tmp; - } else { - /* no tail piece */ - H5FL_FREE(H5FD_free_t,tmp); - } + if ((tmp->size = (best->size - (head + size)))) { + tmp->addr = best->addr + (head + size); + tmp->next = best->next; + best->next = tmp; } else { - /* - * Cannot keep the tail piece. Leak file memory. - * (Only happens if memory allocation fails) - */ + /* no tail piece */ + H5FL_FREE(H5FD_free_t,tmp); } best->size = head; - HGOTO_DONE(ret_value); - } - } - } - } + HGOTO_DONE(ret_value) + } /* end else */ + } /* end else */ + } /* end if */ + } /* end if */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -1654,7 +1643,7 @@ H5FD_alloc_metadata(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { haddr_t ret_value = HADDR_UNDEF; - FUNC_ENTER_NOAPI(H5FD_alloc_metadata, HADDR_UNDEF); + FUNC_ENTER_NOAPI(H5FD_alloc_metadata, HADDR_UNDEF) /* check args */ assert(file); @@ -1724,8 +1713,7 @@ H5FD_alloc_metadata(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) if (file->eoma != 0) if (H5FD_free(file, H5FD_MEM_DEFAULT, dxpl_id, file->eoma, file->cur_meta_block_size) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, - "can't free metadata block"); + HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "can't free metadata block") /* Point the metadata block at the newly allocated block */ file->eoma = new_meta; @@ -1749,7 +1737,7 @@ H5FD_alloc_metadata(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -1770,7 +1758,7 @@ H5FD_alloc_raw(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { haddr_t ret_value = HADDR_UNDEF; - FUNC_ENTER_NOAPI(H5FD_alloc_raw, HADDR_UNDEF); + FUNC_ENTER_NOAPI(H5FD_alloc_raw, HADDR_UNDEF) /* check args */ assert(file); @@ -1832,8 +1820,7 @@ H5FD_alloc_raw(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) if (file->eosda != 0) if (H5FD_free(file, H5FD_MEM_DRAW, dxpl_id, file->eosda, file->cur_sdata_block_size) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, - "can't free 'small data' block"); + HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "can't free 'small data' block") /* * Point the "small data" block at the newly @@ -1860,7 +1847,7 @@ H5FD_alloc_raw(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -1887,7 +1874,7 @@ H5FD_real_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { haddr_t ret_value = HADDR_UNDEF; - FUNC_ENTER_NOINIT(H5FD_real_alloc); + FUNC_ENTER_NOINIT(H5FD_real_alloc) /* check args */ assert(file); @@ -1901,16 +1888,14 @@ H5FD_real_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) */ if (file->cls->alloc) { if ((ret_value = (file->cls->alloc)(file, type, dxpl_id, size)) == HADDR_UNDEF) - HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, - "driver allocation request failed"); + HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "driver allocation request failed") } else { if ((ret_value = H5FD_update_eoa(file, type, dxpl_id, size)) == HADDR_UNDEF) - HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, - "driver eoa update request failed"); + HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "driver eoa update request failed") } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_real_alloc() */ @@ -1935,7 +1920,7 @@ H5FD_update_eoa(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) hsize_t wasted; haddr_t ret_value = HADDR_UNDEF; - FUNC_ENTER_NOINIT(H5FD_update_eoa); + FUNC_ENTER_NOINIT(H5FD_update_eoa) /* check args */ assert(file); @@ -1964,29 +1949,29 @@ H5FD_update_eoa(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) /* Advance eoa to the next alignment by allocating the wasted */ if (H5F_addr_overflow(eoa, size) || eoa + wasted > file->maxaddr) - HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, - "file allocation request failed"); + HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "file allocation request failed") eoa += wasted; if (file->cls->set_eoa(file, eoa) < 0) - HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, - "file allocation request failed"); + HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "file allocation request failed") } /* allocate the aligned memory */ if (H5F_addr_overflow(eoa, size) || eoa + size > file->maxaddr) - HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "file allocation request failed"); + HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "file allocation request failed") ret_value = eoa; eoa += size; if (file->cls->set_eoa(file, eoa) < 0) - HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "file allocation request failed"); + HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "file allocation request failed") /* Free the wasted memory */ - if (wasted) - H5FD_free(file, type, dxpl_id, oldeoa, wasted); + if (wasted) { + if(H5FD_free(file, type, dxpl_id, oldeoa, wasted)<0) + HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "file deallocation request failed") + } /* end if */ #ifdef H5F_DEBUG if (file->alignment * file->threshold != 1 && H5DEBUG(F)) @@ -1996,7 +1981,7 @@ H5FD_update_eoa(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) #endif /* H5F_DEBUG */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -2026,26 +2011,26 @@ H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDfree, FAIL); + FUNC_ENTER_API(H5FDfree, FAIL) H5TRACE5("e","xMtiah",file,type,dxpl_id,addr,size); /* Check args */ if (!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") if (type<0 || type>=H5FD_MEM_NTYPES) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid request type"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid request type") if (H5P_DEFAULT == dxpl_id) dxpl_id= H5P_DATASET_XFER_DEFAULT; else if (TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") /* Do the real work */ if (H5FD_free(file, type, dxpl_id, addr, size)<0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file deallocation request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "file deallocation request failed") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -2075,7 +2060,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si H5FD_mem_t mapped_type; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_free, FAIL); + FUNC_ENTER_NOAPI(H5FD_free, FAIL) /* Check args */ assert(file); @@ -2095,21 +2080,20 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si /* Send the request to the SAP */ if (H5FP_request_free(file, type, addr, size, &req_id, &status) != SUCCEED) /* FIXME: Should we check the "status" variable here? */ - HGOTO_ERROR(H5E_FPHDF5, H5E_CANTFREE, FAIL, - "server couldn't free from file"); + HGOTO_ERROR(H5E_FPHDF5, H5E_CANTFREE, FAIL, "server couldn't free from file") /* We've succeeded -- return the value */ - HGOTO_DONE(ret_value); + HGOTO_DONE(ret_value) } #endif /* H5_HAVE_FPHDF5 */ if (!H5F_addr_defined(addr) || addr>file->maxaddr || H5F_addr_overflow(addr, size) || addr+size>file->maxaddr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid region"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid region") /* Allow 0-sized free's to occur without penalty */ if(0==size) - HGOTO_DONE(SUCCEED); + HGOTO_DONE(SUCCEED) /* Map request type to free list */ if (H5FD_MEM_DEFAULT==file->cls->fl_map[type]) { @@ -2176,7 +2160,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si /* Write out the part of the accumulator after the block to free */ /* (Use the driver's write call directly - to avoid looping back and writing to metadata accumulator) */ if ((file->cls->write)(file, H5FD_MEM_DEFAULT, dxpl_id, tail_addr, tail_size, file->meta_accum+(tail_addr-file->accum_loc))<0) - HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "file write request failed"); + HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "file write request failed") } /* end if */ /* Adjust the accumulator information */ @@ -2273,7 +2257,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si else { /* Allocate a new node to hold the free block's information */ if(NULL==(last = H5FL_MALLOC(H5FD_free_t))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate node for free space info"); + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, FAIL, "can't allocate node for free space info") last->addr = addr; last->size = size; @@ -2292,7 +2276,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si eoa = file->cls->get_eoa(file); if(eoa == (last->addr+last->size)) { if(file->cls->set_eoa(file, last->addr) < 0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "set end of space allocation request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "set end of space allocation request failed") /* Remove this free block from the list */ file->fl[mapped_type] = last->next; @@ -2303,7 +2287,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si } } else if (file->cls->free) { if ((file->cls->free)(file, type, dxpl_id, addr, size)<0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver free request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver free request failed") } else { /* leak memory */ #ifdef H5F_DEBUG @@ -2312,7 +2296,7 @@ HDfprintf(stderr, "%s: LEAKED MEMORY!!!!!!\n", FUNC); } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -2340,7 +2324,7 @@ H5FDrealloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsiz { haddr_t ret_value=HADDR_UNDEF; - FUNC_ENTER_API(H5FDrealloc, HADDR_UNDEF); + FUNC_ENTER_API(H5FDrealloc, HADDR_UNDEF) H5TRACE6("a","xMtiahh",file,type,dxpl_id,old_addr,old_size,new_size); /* Check args */ @@ -2348,13 +2332,13 @@ H5FDrealloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsiz dxpl_id= H5P_DATASET_XFER_DEFAULT; else if (TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "not a data transfer property list"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "not a data transfer property list") if (HADDR_UNDEF==(ret_value=H5FD_realloc(file, type, dxpl_id, old_addr, old_size, new_size))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file reallocation request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file reallocation request failed") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -2384,7 +2368,7 @@ H5FD_realloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsi uint8_t *buf=_buf; haddr_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_realloc, HADDR_UNDEF); + FUNC_ENTER_NOAPI(H5FD_realloc, HADDR_UNDEF) if (new_size==old_size) { /*nothing to do*/ @@ -2393,16 +2377,18 @@ H5FD_realloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsi /* allocate memory */ assert(!H5F_addr_defined(old_addr)); if (HADDR_UNDEF==(new_addr=H5FD_alloc(file, type, dxpl_id, new_size))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed"); + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed") } else if (0==new_size) { /* free memory */ assert(H5F_addr_defined(old_addr)); - H5FD_free(file, type, dxpl_id, old_addr, old_size); + if(H5FD_free(file, type, dxpl_id, old_addr, old_size)<0) + HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "file deallocation request failed") new_addr = HADDR_UNDEF; } else if (new_size<old_size) { /* free the end of the block */ - H5FD_free(file, type, dxpl_id, old_addr+old_size, old_size-new_size); + if(H5FD_free(file, type, dxpl_id, old_addr+old_size, old_size-new_size)<0) + HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "file deallocation request failed") } else { /* move memory to new location */ /* Note! This may fail if sizeof(hsize_t)>sizeof(size_t) and the @@ -2412,29 +2398,31 @@ H5FD_realloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsi * -QAK, 6/20/01 */ if (HADDR_UNDEF==(new_addr=H5FD_alloc(file, type, dxpl_id, new_size))) - HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed"); + HGOTO_ERROR(H5E_FILE, H5E_NOSPACE, HADDR_UNDEF, "file allocation failed") H5_CHECK_OVERFLOW(old_size,hsize_t,size_t); if (old_size>sizeof(_buf) && NULL==(buf=H5MM_malloc((size_t)old_size))) { - H5FD_free(file, type, dxpl_id, new_addr, new_size); - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed"); + (void)H5FD_free(file, type, dxpl_id, new_addr, new_size); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "memory allocation failed") } if (H5FD_read(file, type, dxpl_id, old_addr, (size_t)old_size, buf)<0 || H5FD_write(file, type, dxpl_id, new_addr, (size_t)old_size, buf)<0) { - H5FD_free(file, type, dxpl_id, new_addr, new_size); - H5MM_xfree(buf); - HGOTO_ERROR(H5E_FILE, H5E_READERROR, HADDR_UNDEF, "unable to move file block"); + (void)H5FD_free(file, type, dxpl_id, new_addr, new_size); + if (buf!=_buf) + H5MM_xfree(buf); + HGOTO_ERROR(H5E_FILE, H5E_READERROR, HADDR_UNDEF, "unable to move file block") } if (buf!=_buf) H5MM_xfree(buf); - H5FD_free(file, type, dxpl_id, old_addr, old_size); + if(H5FD_free(file, type, dxpl_id, old_addr, old_size)<0) + HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "file deallocation request failed") } /* Set return value */ ret_value=new_addr; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -2460,19 +2448,19 @@ H5FDget_eoa(H5FD_t *file) { haddr_t ret_value; - FUNC_ENTER_API(H5FDget_eoa, HADDR_UNDEF); + FUNC_ENTER_API(H5FDget_eoa, HADDR_UNDEF) H5TRACE1("a","x",file); /* Check args */ if (!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer") /* The real work */ if (HADDR_UNDEF==(ret_value=H5FD_get_eoa(file))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eoa request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eoa request failed") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -2497,15 +2485,15 @@ H5FD_get_eoa(H5FD_t *file) { haddr_t ret_value; - FUNC_ENTER_NOAPI(H5FD_get_eoa, HADDR_UNDEF); + FUNC_ENTER_NOAPI(H5FD_get_eoa, HADDR_UNDEF) assert(file && file->cls); /* Dispatch to driver */ if (HADDR_UNDEF==(ret_value=(file->cls->get_eoa)(file))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -2541,21 +2529,21 @@ H5FDset_eoa(H5FD_t *file, haddr_t addr) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDset_eoa, FAIL); + FUNC_ENTER_API(H5FDset_eoa, FAIL) H5TRACE2("e","xa",file,addr); /* Check args */ if (!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") if (!H5F_addr_defined(addr) || addr>file->maxaddr) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid end-of-address value"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid end-of-address value") /* The real work */ if (H5FD_set_eoa(file, addr)<0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file set eoa request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file set eoa request failed") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -2580,17 +2568,17 @@ H5FD_set_eoa(H5FD_t *file, haddr_t addr) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_set_eoa, FAIL); + FUNC_ENTER_NOAPI(H5FD_set_eoa, FAIL) assert(file && file->cls); assert(H5F_addr_defined(addr) && addr<=file->maxaddr); /* Dispatch to driver */ if ((file->cls->set_eoa)(file, addr)<0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver set_eoa request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver set_eoa request failed") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -2625,19 +2613,19 @@ H5FDget_eof(H5FD_t *file) { haddr_t ret_value; - FUNC_ENTER_API(H5FDget_eof, HADDR_UNDEF); + FUNC_ENTER_API(H5FDget_eof, HADDR_UNDEF) H5TRACE1("a","x",file); /* Check arguments */ if (!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer") /* The real work */ if (HADDR_UNDEF==(ret_value=H5FD_get_eof(file))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eof request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eof request failed") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -2662,20 +2650,20 @@ H5FD_get_eof(H5FD_t *file) { haddr_t ret_value; - FUNC_ENTER_NOAPI(H5FD_get_eof, HADDR_UNDEF); + FUNC_ENTER_NOAPI(H5FD_get_eof, HADDR_UNDEF) assert(file && file->cls); /* Dispatch to driver */ if (file->cls->get_eof) { if (HADDR_UNDEF==(ret_value=(file->cls->get_eof)(file))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eof request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eof request failed") } else { ret_value = file->maxaddr; } done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -2706,28 +2694,28 @@ H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDread, FAIL); + FUNC_ENTER_API(H5FDread, FAIL) H5TRACE6("e","xMtiazx",file,type,dxpl_id,addr,size,buf); /* Check args */ if (!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id= H5P_DATASET_XFER_DEFAULT; else if (TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") if (!buf) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null result buffer"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null result buffer") /* Do the real work */ if (H5FD_read(file, type, dxpl_id, addr, size, buf)<0) - HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "file read request failed"); + HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "file read request failed") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -2757,7 +2745,7 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_read, FAIL); + FUNC_ENTER_NOAPI(H5FD_read, FAIL) assert(file && file->cls); assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); @@ -2769,7 +2757,7 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz /* collective transfer. */ /* The no-op case */ if (0==size) - HGOTO_DONE(SUCCEED); + HGOTO_DONE(SUCCEED) #endif /* H5_HAVE_PARALLEL */ /* Check if this information is in the metadata accumulator */ @@ -2793,7 +2781,7 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz /* Dispatch to driver */ if ((file->cls->read)(file, type, dxpl_id, addr, amount_read, read_buf)<0) - HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed"); + HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed") /* Adjust the buffer, address & size */ read_buf+=amount_read; @@ -2828,7 +2816,7 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz if(size>0 && addr>=(file->accum_loc+file->accum_size)) { /* Dispatch to driver */ if ((file->cls->read)(file, type, dxpl_id, addr, size, read_buf)<0) - HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed"); + HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed") /* Adjust the buffer, address & size */ read_buf+=size; @@ -2849,7 +2837,7 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz /* Flush current contents, if dirty */ if(file->accum_dirty) { if ((file->cls->write)(file, H5FD_MEM_DEFAULT, dxpl_id, file->accum_loc, file->accum_size, file->meta_accum)<0) - HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write request failed"); + HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write request failed") /* Reset accumulator dirty flag */ file->accum_dirty=FALSE; @@ -2860,7 +2848,7 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz if(size>file->accum_buf_size) { /* Grow the metadata accumulator buffer */ if ((file->meta_accum=H5FL_BLK_REALLOC(meta_accum,file->meta_accum,size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer") /* Note the new buffer size */ file->accum_buf_size=size; @@ -2873,7 +2861,7 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz /* Shrink the accumulator buffer */ if ((file->meta_accum=H5FL_BLK_REALLOC(meta_accum,file->meta_accum,new_size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer") /* Note the new buffer size */ file->accum_buf_size=new_size; @@ -2887,7 +2875,7 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz /* Read into accumulator */ if ((file->cls->read)(file, H5FD_MEM_DEFAULT, dxpl_id, file->accum_loc, file->accum_size, file->meta_accum)<0) - HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed"); + HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed") /* Copy into buffer */ HDmemcpy(buf,file->meta_accum,size); @@ -2895,18 +2883,18 @@ H5FD_read(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz else { /* Dispatch to driver */ if ((file->cls->read)(file, type, dxpl_id, addr, size, buf)<0) - HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed"); + HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed") } /* end else */ } /* end else */ } /* end if */ else { /* Dispatch to driver */ if ((file->cls->read)(file, type, dxpl_id, addr, size, buf)<0) - HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed"); + HGOTO_ERROR(H5E_VFL, H5E_READERROR, FAIL, "driver read request failed") } /* end else */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -2935,27 +2923,27 @@ H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDwrite, FAIL); + FUNC_ENTER_API(H5FDwrite, FAIL) H5TRACE6("e","xMtiazx",file,type,dxpl_id,addr,size,buf); /* Check args */ if (!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id= H5P_DATASET_XFER_DEFAULT; else if (TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") if (!buf) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null buffer"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null buffer") /* The real work */ if (H5FD_write(file, type, dxpl_id, addr, size, buf)<0) - HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "file write request failed"); + HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "file write request failed") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -2987,7 +2975,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si size_t old_offset; /* Offset of old data within the accumulator buffer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_write, FAIL); + FUNC_ENTER_NOAPI(H5FD_write, FAIL) assert(file && file->cls); assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); @@ -2999,7 +2987,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si /* collective transfer. */ /* The no-op case */ if (0==size) - HGOTO_DONE(SUCCEED); + HGOTO_DONE(SUCCEED) #endif /* H5_HAVE_PARALLEL */ /* Check for accumulating metadata */ @@ -3020,7 +3008,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si /* Reallocate the metadata accumulator buffer */ if ((file->meta_accum=H5FL_BLK_REALLOC(meta_accum,file->meta_accum,file->accum_buf_size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer") } /* end if */ /* Move the existing metadata to the proper location */ @@ -3045,7 +3033,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si /* Reallocate the metadata accumulator buffer */ if ((file->meta_accum=H5FL_BLK_REALLOC(meta_accum,file->meta_accum,file->accum_buf_size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer") } /* end if */ /* Copy the new metadata to the end */ @@ -3077,7 +3065,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si /* Reallocate the metadata accumulator buffer */ if ((file->meta_accum=H5FL_BLK_REALLOC(meta_accum,file->meta_accum,file->accum_buf_size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer") } /* end if */ /* Calculate the proper offset of the existing metadata */ @@ -3108,7 +3096,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si /* Reallocate the metadata accumulator buffer */ if ((file->meta_accum=H5FL_BLK_REALLOC(meta_accum,file->meta_accum,file->accum_buf_size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer") } /* end if */ /* Copy the new metadata to the end */ @@ -3130,7 +3118,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si /* Write out the existing metadata accumulator, with dispatch to driver */ if(file->accum_dirty) { if ((file->cls->write)(file, H5FD_MEM_DEFAULT, dxpl_id, file->accum_loc, file->accum_size, file->meta_accum)<0) - HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write request failed"); + HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write request failed") /* Reset accumulator dirty flag */ file->accum_dirty=FALSE; } /* end if */ @@ -3140,7 +3128,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si if(size>file->accum_buf_size) { /* Grow the metadata accumulator buffer */ if ((file->meta_accum=H5FL_BLK_REALLOC(meta_accum,file->meta_accum,size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer") /* Note the new buffer size */ file->accum_buf_size=size; @@ -3153,7 +3141,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si /* Shrink the accumulator buffer */ if ((file->meta_accum=H5FL_BLK_REALLOC(meta_accum,file->meta_accum,tmp_size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer") /* Note the new buffer size */ file->accum_buf_size=tmp_size; @@ -3175,7 +3163,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si if(size>file->accum_buf_size) { /* Reallocate the metadata accumulator buffer */ if ((file->meta_accum=H5FL_BLK_REALLOC(meta_accum,file->meta_accum,size))==NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate metadata accumulator buffer") /* Note the new buffer size */ file->accum_buf_size=size; @@ -3193,11 +3181,11 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si else { /* Dispatch to driver */ if ((file->cls->write)(file, type, dxpl_id, addr, size, buf)<0) - HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write request failed"); + HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "driver write request failed") } /* end else */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -3225,24 +3213,24 @@ H5FDflush(H5FD_t *file, hid_t dxpl_id, unsigned closing) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5FDflush, FAIL); + FUNC_ENTER_API(H5FDflush, FAIL) H5TRACE3("e","xiIu",file,dxpl_id,closing); /* Check args */ if (!file || !file->cls) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") if (H5P_DEFAULT == dxpl_id) dxpl_id= H5P_DATASET_XFER_DEFAULT; else if (TRUE!=H5P_isa_class(dxpl_id,H5P_DATASET_XFER)) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") /* Do the real work */ if (H5FD_flush(file,dxpl_id,closing)<0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file flush request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "file flush request failed") done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -3269,7 +3257,7 @@ H5FD_flush(H5FD_t *file, hid_t dxpl_id, unsigned closing) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_flush, FAIL); + FUNC_ENTER_NOAPI(H5FD_flush, FAIL) assert(file && file->cls); @@ -3278,17 +3266,17 @@ H5FD_flush(H5FD_t *file, hid_t dxpl_id, unsigned closing) /* Flush the metadata contents */ /* Not certain if the type and dxpl should be the way they are... -QAK */ if ((file->cls->write)(file, H5FD_MEM_DEFAULT, dxpl_id, file->accum_loc, file->accum_size, file->meta_accum)<0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver write request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver write request failed") /* Reset the dirty flag */ file->accum_dirty=FALSE; } /* end if */ if (file->cls->flush && (file->cls->flush)(file,dxpl_id,closing)<0) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver flush request failed"); + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver flush request failed") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } @@ -3313,7 +3301,7 @@ H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5FD_get_fileno, FAIL); + FUNC_ENTER_NOAPI(H5FD_get_fileno, FAIL) assert(file); assert(filenum); @@ -3322,7 +3310,7 @@ H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum) HDmemcpy(filenum,&file->fileno,sizeof(file->fileno)); done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_get_fileno() */ @@ -3345,7 +3333,7 @@ herr_t H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle) { herr_t ret_value; - FUNC_ENTER_API(H5FDget_vfd_handle, FAIL); + FUNC_ENTER_API(H5FDget_vfd_handle, FAIL) /* Check arguments */ assert(file); @@ -3353,7 +3341,7 @@ herr_t H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle) ret_value=H5FD_get_vfd_handle(file, fapl, file_handle); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value) } @@ -3375,12 +3363,12 @@ herr_t H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle) { herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(H5FD_get_vfd_handle, FAIL); + FUNC_ENTER_NOAPI(H5FD_get_vfd_handle, FAIL) assert(file_handle); if(file->cls->get_handle && ((ret_value=file->cls->get_handle(file, fapl, file_handle)) < 0)) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file handle for file driver"); + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file handle for file driver") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c index 56129bf..1bf14f3 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -137,6 +137,7 @@ H5Z_filter_fletcher32_compute(void *_src, size_t len) * *------------------------------------------------------------------------- */ +/* ARGSUSED */ static size_t H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned UNUSED cd_values[], size_t nbytes, size_t *buf_size, void **buf) @@ -204,6 +205,6 @@ done: if(outbuf) H5MM_xfree(outbuf); FUNC_LEAVE_NOAPI(ret_value) -} /*lint !e715 Make lint ignore cd_nelmts and cd_values parameters */ +} #endif /* H5_HAVE_FILTER_FLETCHER32 */ diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index bc6e309..eb95f98 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -67,6 +67,7 @@ const H5Z_class_t H5Z_SHUFFLE[1] = {{ * *------------------------------------------------------------------------- */ +/* ARGSUSED */ static herr_t H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t UNUSED space_id) { @@ -95,7 +96,7 @@ H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t UNUSED space_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5Z_set_local_shuffle() */ /*lint !e715 Make lint ignore space_id parameter */ +} /* end H5Z_set_local_shuffle() */ /*------------------------------------------------------------------------- diff --git a/src/hdf5.lnt b/src/hdf5.lnt index edf8604..01043e8 100755 --- a/src/hdf5.lnt +++ b/src/hdf5.lnt @@ -77,6 +77,7 @@ H5Dio.c H5E.c H5F.c + H5FD.c H5V.c H5Z.c |