diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5A.c | 20 | ||||
-rw-r--r-- | src/H5B.c | 2 | ||||
-rw-r--r-- | src/H5Dint.c | 31 | ||||
-rw-r--r-- | src/H5E.c | 121 | ||||
-rw-r--r-- | src/H5Epublic.h | 2 | ||||
-rw-r--r-- | src/H5F.c | 17 | ||||
-rw-r--r-- | src/H5FD.c | 31 | ||||
-rw-r--r-- | src/H5G.c | 11 | ||||
-rw-r--r-- | src/H5Gint.c | 2 | ||||
-rw-r--r-- | src/H5Gname.c | 4 | ||||
-rw-r--r-- | src/H5Gtraverse.c | 2 | ||||
-rw-r--r-- | src/H5HG.c | 2 | ||||
-rw-r--r-- | src/H5I.c | 6 | ||||
-rw-r--r-- | src/H5Ipkg.h | 8 | ||||
-rw-r--r-- | src/H5Lpublic.h | 2 | ||||
-rw-r--r-- | src/H5PL.c | 1 | ||||
-rw-r--r-- | src/H5Pint.c | 36 | ||||
-rw-r--r-- | src/H5Ppublic.h | 3 | ||||
-rw-r--r-- | src/H5R.c | 23 | ||||
-rw-r--r-- | src/H5S.c | 14 | ||||
-rw-r--r-- | src/H5Spublic.h | 2 | ||||
-rw-r--r-- | src/H5T.c | 24 | ||||
-rw-r--r-- | src/H5Tbit.c | 16 | ||||
-rw-r--r-- | src/H5Z.c | 34 | ||||
-rw-r--r-- | src/H5Zszip.c | 2 | ||||
-rw-r--r-- | src/H5public.h | 3 | ||||
-rw-r--r-- | src/H5trace.c | 2 | ||||
-rw-r--r-- | src/H5version.h | 338 |
28 files changed, 381 insertions, 378 deletions
@@ -177,17 +177,23 @@ H5A_term_interface(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { - if((n = H5I_nmembers(H5I_ATTR))>0) { + if(H5I_nmembers(H5I_ATTR) > 0) { (void)H5I_clear_type(H5I_ATTR, FALSE, FALSE); - } else { + n++; /*H5I*/ + } /* end if */ + else { /* Close deprecated interface */ n += H5A__term_deprec_interface(); + /* Destroy the attribute object id group */ (void)H5I_dec_type_ref(H5I_ATTR); + n++; /*H5I*/ + + /* Mark closed */ H5_interface_initialize_g = 0; - n = 1; - } - } + } /* end else */ + } /* end if */ + FUNC_LEAVE_NOAPI(n) } /* H5A_term_interface() */ @@ -246,7 +252,7 @@ H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a type") if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") /* Go do the real work for attaching the attribute to the dataset */ if(NULL == (attr = H5A_create(&loc, attr_name, type, space, acpl_id, H5AC_dxpl_id))) @@ -329,7 +335,7 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a type") if(NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") /* Set up opened group location to fill in */ obj_loc.oloc = &obj_oloc; @@ -255,7 +255,7 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata, /* * Cache the new B-tree node. */ - if (H5AC_insert_entry(f, dxpl_id, H5AC_BT, *addr_p, bt, H5AC__NO_FLAGS_SET) < 0) + if(H5AC_insert_entry(f, dxpl_id, H5AC_BT, *addr_p, bt, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "can't add B-tree root node to cache") #ifdef H5B_DEBUG H5B_assert(f, dxpl_id, *addr_p, shared->type, udata); diff --git a/src/H5Dint.c b/src/H5Dint.c index dfad7d7..a354a16 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -224,12 +224,12 @@ done: int H5D_term_interface(void) { - int n=0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { - if((n=H5I_nmembers(H5I_DATASET))>0) { + if(H5I_nmembers(H5I_DATASET) > 0) { /* The dataset API uses the "force" flag set to true because it * is using the "file objects" (H5FO) API functions to track open * objects in the file. Using the H5FO code means that dataset @@ -252,19 +252,25 @@ H5D_term_interface(void) * * QAK - 5/13/03 */ - H5I_clear_type(H5I_DATASET, TRUE, FALSE); - } else { + (void)H5I_clear_type(H5I_DATASET, TRUE, FALSE); + n++; /*H5I*/ + } /* end if */ + else { /* Close public interface */ n += H5D__term_pub_interface(); /* Close deprecated interface */ n += H5D__term_deprec_interface(); - H5I_dec_type_ref(H5I_DATASET); + /* Destroy the dataset object id group */ + (void)H5I_dec_type_ref(H5I_DATASET); + n++; /*H5I*/ + + /* Mark closed */ H5_interface_initialize_g = 0; - n = 1; /*H5I*/ - } - } + } /* end else */ + } /* end if */ + FUNC_LEAVE_NOAPI(n) } /* end H5D_term_interface() */ @@ -458,7 +464,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D__get_space_status * - * Purpose: Returns the status of data space allocation. + * Purpose: Returns the status of dataspace allocation. * * Return: * Success: Non-negative @@ -2175,16 +2181,16 @@ H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) if(H5D__check_filters(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't apply filters") - /* Get the data space */ + /* Get the dataspace */ space = dset->shared->space; /* Check if we are shrinking or expanding any of the dimensions */ if((rank = H5S_get_simple_extent_dims(space, curr_dims, NULL)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions") - /* Modify the size of the data space */ + /* Modify the size of the dataspace */ if((changed = H5S_set_extent(space, size)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of data space") + HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to modify size of dataspace") /* Don't bother updating things, unless they've changed */ if(changed) { @@ -2382,7 +2388,6 @@ H5D__mark(const H5D_t *dataset, hid_t UNUSED dxpl_id, unsigned flags) if(flags & H5D_MARK_LAYOUT) dataset->shared->layout_dirty = TRUE; -done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D__mark() */ @@ -144,8 +144,7 @@ static const H5I_class_t H5I_ERRSTK_CLS[1] = {{ }}; - - + /*------------------------------------------------------------------------- * Function: H5E_init * @@ -172,8 +171,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5E_init() */ - - + /*-------------------------------------------------------------------------- * Function: H5E_set_default_auto * @@ -211,8 +209,7 @@ H5E_set_default_auto(H5E_t *stk) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5E_set_default_auto() */ - - + /*-------------------------------------------------------------------------- * Function: H5E_init_interface * @@ -267,8 +264,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5E_init_interface() */ - - + /*------------------------------------------------------------------------- * Function: H5E_term_interface * @@ -299,15 +295,14 @@ H5E_term_interface(void) nmsg = H5I_nmembers(H5I_ERROR_MSG); nstk = H5I_nmembers(H5I_ERROR_STACK); - n = ncls + nmsg + nstk; - if(n > 0) { + if((ncls + nmsg + nstk) > 0) { /* Clear any outstanding error stacks */ if(nstk > 0) - H5I_clear_type(H5I_ERROR_STACK, FALSE, FALSE); + (void)H5I_clear_type(H5I_ERROR_STACK, FALSE, FALSE); /* Clear all the error classes */ if(ncls > 0) { - H5I_clear_type(H5I_ERROR_CLASS, FALSE, FALSE); + (void)H5I_clear_type(H5I_ERROR_CLASS, FALSE, FALSE); /* Reset the HDF5 error class, if its been closed */ if(H5I_nmembers(H5I_ERROR_CLASS) == 0) @@ -316,7 +311,7 @@ H5E_term_interface(void) /* Clear all the error messages */ if(nmsg > 0) { - H5I_clear_type(H5I_ERROR_MSG, FALSE, FALSE); + (void)H5I_clear_type(H5I_ERROR_MSG, FALSE, FALSE); /* Reset the HDF5 error messages, if they've been closed */ if(H5I_nmembers(H5I_ERROR_MSG) == 0) { @@ -324,27 +319,28 @@ H5E_term_interface(void) #include "H5Eterm.h" } /* end if */ } /* end if */ + + n++; /*H5I*/ } /* end if */ else { /* Close deprecated interface */ n += H5E__term_deprec_interface(); /* Destroy the error class, message, and stack id groups */ - H5I_dec_type_ref(H5I_ERROR_STACK); - H5I_dec_type_ref(H5I_ERROR_CLASS); - H5I_dec_type_ref(H5I_ERROR_MSG); + (void)H5I_dec_type_ref(H5I_ERROR_STACK); + (void)H5I_dec_type_ref(H5I_ERROR_CLASS); + (void)H5I_dec_type_ref(H5I_ERROR_MSG); + n++; /*H5I*/ /* Mark closed */ H5_interface_initialize_g = 0; - n = 1; /*H5I*/ } /* end else */ } /* end if */ FUNC_LEAVE_NOAPI(n) } /* end H5E_term_interface() */ - - + #ifdef H5_HAVE_THREADSAFE /*------------------------------------------------------------------------- * Function: H5E_get_stack @@ -395,8 +391,7 @@ H5E_get_stack(void) } /* end H5E_get_stack() */ #endif /* H5_HAVE_THREADSAFE */ - - + /*------------------------------------------------------------------------- * Function: H5E_free_class * @@ -426,8 +421,7 @@ H5E_free_class(H5E_cls_t *cls) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5E_free_class() */ - - + /*------------------------------------------------------------------------- * Function: H5Eregister_class * @@ -465,8 +459,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Eregister_class() */ - - + /*------------------------------------------------------------------------- * Function: H5E_register_class * @@ -515,8 +508,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5E_register_class() */ - - + /*------------------------------------------------------------------------- * Function: H5Eunregister_class * @@ -552,8 +544,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Eunregister_class() */ - - + /*------------------------------------------------------------------------- * Function: H5E_unregister_class * @@ -588,8 +579,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5E_unregister_class() */ - - + /*------------------------------------------------------------------------- * Function: H5Eget_class_name * @@ -624,8 +614,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Eget_class_name() */ - - + /*------------------------------------------------------------------------- * Function: H5E_get_class_name * @@ -663,8 +652,7 @@ H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size) FUNC_LEAVE_NOAPI(len) } /* end H5E_get_class_name() */ - - + /*------------------------------------------------------------------------- * Function: H5E_close_msg_cb * @@ -702,8 +690,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5E_close_msg_cb() */ - - + /*------------------------------------------------------------------------- * Function: H5Eclose_msg * @@ -736,8 +723,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Eclose_msg() */ - - + /*------------------------------------------------------------------------- * Function: H5E_close_msg * @@ -766,8 +752,7 @@ H5E_close_msg(H5E_msg_t *err) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5E_close_msg() */ - - + /*------------------------------------------------------------------------- * Function: H5Ecreate_msg * @@ -858,8 +843,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5E_create_msg() */ - - + /*------------------------------------------------------------------------- * Function: H5Eget_msg * @@ -894,8 +878,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Eget_msg() */ - - + /*------------------------------------------------------------------------- * Function: H5Ecreate_stack * @@ -932,8 +915,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Ecreate_stack() */ - - + /*------------------------------------------------------------------------- * Function: H5Eget_current_stack * @@ -969,8 +951,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Eget_current_stack() */ - - + /*------------------------------------------------------------------------- * Function: H5E_get_current_stack * @@ -1047,8 +1028,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5E_get_current_stack() */ - - + /*------------------------------------------------------------------------- * Function: H5Eset_current_stack * @@ -1096,8 +1076,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Eset_current_stack() */ - - + /*------------------------------------------------------------------------- * Function: H5E_set_current_stack * @@ -1161,8 +1140,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5E_set_current_stack() */ - - + /*------------------------------------------------------------------------- * Function: H5Eclose_stack * @@ -1200,8 +1178,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Eclose_stack() */ - - + /*------------------------------------------------------------------------- * Function: H5E_close_stack * @@ -1231,8 +1208,7 @@ H5E_close_stack(H5E_t *estack) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5E_close_stack() */ - - + /*------------------------------------------------------------------------- * Function: H5Eget_num * @@ -1277,8 +1253,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Eget_num() */ - - + /*------------------------------------------------------------------------- * Function: H5E_get_num * @@ -1301,8 +1276,7 @@ H5E_get_num(const H5E_t *estack) FUNC_LEAVE_NOAPI((ssize_t)estack->nused) } /* end H5E_get_num() */ - - + /*------------------------------------------------------------------------- * Function: H5Epop * @@ -1351,8 +1325,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Epop() */ - - + /*------------------------------------------------------------------------- * Function: H5Epush2 * @@ -1466,8 +1439,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Epush2() */ - - + /*------------------------------------------------------------------------- * Function: H5Eclear2 * @@ -1509,8 +1481,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Eclear2() */ - - + /*------------------------------------------------------------------------- * Function: H5Eprint2 * @@ -1557,8 +1528,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Eprint2() */ - - + /*------------------------------------------------------------------------- * Function: H5Ewalk2 * @@ -1606,8 +1576,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Ewalk2() */ - - + /*------------------------------------------------------------------------- * Function: H5Eget_auto2 * @@ -1663,8 +1632,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Eget_auto2() */ - - + /*------------------------------------------------------------------------- * Function: H5Eset_auto2 * @@ -1733,8 +1701,7 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Eset_auto2() */ - - + /*------------------------------------------------------------------------- * Function: H5Eauto_is_v2 * diff --git a/src/H5Epublic.h b/src/H5Epublic.h index 932b857..17a35d9 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -26,7 +26,7 @@ #include "H5Ipublic.h" /* Value for the default error stack */ -#define H5E_DEFAULT 0 +#define H5E_DEFAULT (hid_t)0 /* Different kinds of error information */ typedef enum H5E_type_t { @@ -169,20 +169,25 @@ H5F_term_interface(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { - if((n = H5I_nmembers(H5I_FILE)) != 0) { - H5I_clear_type(H5I_FILE, FALSE, FALSE); - } else { + if(H5I_nmembers(H5I_FILE) > 0) { + (void)H5I_clear_type(H5I_FILE, FALSE, FALSE); + n++; /*H5I*/ + } /* end if */ + else { /* Make certain we've cleaned up all the shared file objects */ H5F_sfile_assert_num(0); - H5I_dec_type_ref(H5I_FILE); + /* Destroy the file object id group */ + (void)H5I_dec_type_ref(H5I_FILE); + n++; /*H5I*/ + + /* Mark closed */ H5_interface_initialize_g = 0; - n = 1; /*H5I*/ } /* end else */ } /* end if */ FUNC_LEAVE_NOAPI(n) -} /* H5F_term_interface() */ +} /* end H5F_term_interface() */ /*------------------------------------------------------------------------- @@ -111,7 +111,7 @@ static int H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*o * object and the file is closed and re-opened, the 'fileno' value will * be different. */ -static unsigned long file_serial_no; +static unsigned long H5FD_file_serial_no_g; /* File driver ID class */ static const H5I_class_t H5I_VFL_CLS[1] = {{ @@ -176,7 +176,7 @@ H5FD_init_interface(void) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "unable to initialize interface") /* Reset the file serial numbers */ - file_serial_no = 0; + H5FD_file_serial_no_g = 0; done: FUNC_LEAVE_NOAPI(ret_value) @@ -211,8 +211,8 @@ H5FD_term_interface(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { - if((n=H5I_nmembers(H5I_VFL))!=0) { - H5I_clear_type(H5I_VFL, FALSE, FALSE); + if(H5I_nmembers(H5I_VFL) > 0) { + (void)H5I_clear_type(H5I_VFL, FALSE, FALSE); /* Reset the VFL drivers, if they've been closed */ if(H5I_nmembers(H5I_VFL)==0) { @@ -232,14 +232,21 @@ H5FD_term_interface(void) H5FD_mpio_term(); #endif /* H5_HAVE_PARALLEL */ } /* end if */ - } else { - H5I_dec_type_ref(H5I_VFL); + + n++; /*H5I*/ + } /* end if */ + else { + /* Destroy the VFL driver id group */ + (void)H5I_dec_type_ref(H5I_VFL); + n++; /*H5I*/ + + /* Mark closed */ H5_interface_initialize_g = 0; - n = 1; /*H5I*/ - } - } + } /* end else */ + } /* end if */ + FUNC_LEAVE_NOAPI(n) -} +} /* end H5FD_term_interface() */ /*------------------------------------------------------------------------- @@ -1003,11 +1010,11 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) 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) { + if(++H5FD_file_serial_no_g == 0) { /* (Just error out if we wrap around for now...) */ HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "unable to get file serial number") } /* end if */ - file->fileno = file_serial_no; + file->fileno = H5FD_file_serial_no_g; /* Start with base address set to 0 */ /* (This will be changed later, when the superblock is located) */ @@ -224,18 +224,20 @@ H5G_term_interface(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { - if((n = H5I_nmembers(H5I_GROUP))) - H5I_clear_type(H5I_GROUP, FALSE, FALSE); + if(H5I_nmembers(H5I_GROUP) > 0) { + (void)H5I_clear_type(H5I_GROUP, FALSE, FALSE); + n++; /*H5I*/ + } /* end if */ else { /* Close deprecated interface */ n += H5G__term_deprec_interface(); /* Destroy the group object id group */ - H5I_dec_type_ref(H5I_GROUP); + (void)H5I_dec_type_ref(H5I_GROUP); + n++; /*H5I*/ /* Mark closed */ H5_interface_initialize_g = 0; - n = 1; /*H5I*/ } /* end else */ } /* end if */ @@ -514,7 +516,6 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Gget_create_plist() */ - /*------------------------------------------------------------------------- * Function: H5G_get_create_plist diff --git a/src/H5Gint.c b/src/H5Gint.c index fe8b995..6f42cc2 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -992,7 +992,7 @@ H5G_visit_cb(const H5O_link_t *lnk, void *_udata) /* Add the path separator to the current path */ HDassert(udata->path[udata->curr_path_len] == '\0'); - HDstrncpy(&(udata->path[udata->curr_path_len]), "/", 2); + HDstrncpy(&(udata->path[udata->curr_path_len]), "/", (size_t)2); udata->curr_path_len++; /* Attempt to get the link info for this group */ diff --git a/src/H5Gname.c b/src/H5Gname.c index 8e21109..277d08f 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -325,7 +325,7 @@ H5G_build_fullpath(const char *prefix, const char *name) /* Build full path */ HDstrncpy(full_path, prefix, orig_path_len + 1); if(need_sep) - HDstrncat(full_path, "/", 1); + HDstrncat(full_path, "/", (size_t)1); HDstrncat(full_path, name, name_len); /* Create reference counted string for path */ @@ -1331,7 +1331,7 @@ H5G_get_name_by_addr(hid_t file, hid_t lapl_id, hid_t dxpl_id, const H5O_loc_t * /* If there's a buffer provided, copy into it, up to the limit of its size */ if(name) { /* Copy the initial path separator */ - HDstrncpy(name, "/", 2); + HDstrncpy(name, "/", (size_t)2); /* Append the rest of the path */ /* (less one character, for the initial path separator) */ diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index 8ac6aab..dfe5172 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -276,7 +276,7 @@ H5G_traverse_ud(const H5G_loc_t *grp_loc/*in,out*/, const H5O_link_t *lnk, */ if(H5I_dec_ref(cb_return) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to close atom from UD callback") - cb_return = (-1); + cb_return = (hid_t)(-1); done: /* Close location given to callback. */ @@ -208,7 +208,7 @@ HDmemset(heap->chunk, 0, size); HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "unable to add global heap collection to file's CWFS") /* Add the heap to the cache */ - if(H5AC_insert_entry(f, dxpl_id, H5AC_GHEAP, addr, heap, H5AC__NO_FLAGS_SET)<0) + if(H5AC_insert_entry(f, dxpl_id, H5AC_GHEAP, addr, heap, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, HADDR_UNDEF, "unable to cache global heap collection") ret_value = addr; @@ -68,8 +68,8 @@ #define MAX_FREE_ID_STRUCTS 1000 /* Combine a Type number and an atom index into an atom */ -#define H5I_MAKE(g,i) ((((hid_t)(g)&TYPE_MASK)<<ID_BITS)| \ - ((hid_t)(i)&ID_MASK)) +#define H5I_MAKE(g,i) ((((hid_t)(g) & TYPE_MASK) << ID_BITS) | \ + ((hid_t)(i) & ID_MASK)) /* Local typedefs */ @@ -454,7 +454,7 @@ H5Inmembers(H5I_type_t type, hsize_t *num_members) if((members = H5I_nmembers(type)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTCOUNT, FAIL, "can't compute number of members") - *num_members = (hsize_t)members; + H5_ASSIGN_OVERFLOW(*num_members, members, int, hsize_t); } /* end if */ done: diff --git a/src/H5Ipkg.h b/src/H5Ipkg.h index dc8e867..1666b76 100644 --- a/src/H5Ipkg.h +++ b/src/H5Ipkg.h @@ -44,7 +44,7 @@ * field sizes and masks are calculated from TYPE_BITS. */ #define TYPE_BITS 7 -#define TYPE_MASK ((1<<TYPE_BITS)-1) +#define TYPE_MASK (((hid_t)1 << TYPE_BITS) - 1) #define H5I_MAX_NUM_TYPES TYPE_MASK @@ -52,11 +52,11 @@ * Number of bits to use for the Atom index in each atom (assumes 8-bit * bytes). We don't use the sign bit. */ -#define ID_BITS ((sizeof(hid_t)*8)-(TYPE_BITS+1)) -#define ID_MASK ((1<<ID_BITS)-1) +#define ID_BITS ((sizeof(hid_t) * 8) - (TYPE_BITS + 1)) +#define ID_MASK (((hid_t)1 << ID_BITS) - 1) /* Map an atom to an ID type number */ -#define H5I_TYPE(a) ((H5I_type_t)(((hid_t)(a)>>ID_BITS) & TYPE_MASK)) +#define H5I_TYPE(a) ((H5I_type_t)(((hid_t)(a) >> ID_BITS) & TYPE_MASK)) /****************************/ diff --git a/src/H5Lpublic.h b/src/H5Lpublic.h index 20b57e5..ff2322f 100644 --- a/src/H5Lpublic.h +++ b/src/H5Lpublic.h @@ -40,7 +40,7 @@ #define H5L_MAX_LINK_NAME_LEN ((uint32_t)(-1)) /* (4GB - 1) */ /* Macro to indicate operation occurs on same location */ -#define H5L_SAME_LOC 0 +#define H5L_SAME_LOC (hid_t)0 /* Current version of the H5L_class_t struct */ #define H5L_LINK_CLASS_T_VERS 0 @@ -19,6 +19,7 @@ /* Interface initialization */ #define H5_INTERFACE_INIT_FUNC H5PL__init_interface + /***********/ /* Headers */ /***********/ diff --git a/src/H5Pint.c b/src/H5Pint.c index 4858e80..d6ca6bc 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -513,28 +513,27 @@ done: int H5P_term_interface(void) { - int nlist=0; - int nclass=0; - int n=0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { + int nlist, nclass; + /* Destroy HDF5 library property classes & lists */ /* Check if there are any open property list classes or lists */ nclass = H5I_nmembers(H5I_GENPROP_CLS); nlist = H5I_nmembers(H5I_GENPROP_LST); - n=nclass+nlist; /* If there are any open classes or groups, attempt to get rid of them. */ - if(n) { + if((nclass + nlist) > 0) { /* Clear the lists */ - if(nlist>0) { - H5I_clear_type(H5I_GENPROP_LST, FALSE, FALSE); + if(nlist > 0) { + (void)H5I_clear_type(H5I_GENPROP_LST, FALSE, FALSE); /* Reset the default property lists, if they've been closed */ - if(H5I_nmembers(H5I_GENPROP_LST)==0) { + if(H5I_nmembers(H5I_GENPROP_LST) == 0) { H5P_LST_FILE_CREATE_ID_g = H5P_LST_FILE_ACCESS_ID_g = H5P_LST_DATASET_CREATE_ID_g = @@ -553,11 +552,11 @@ H5P_term_interface(void) } /* end if */ /* Only attempt to close the classes after all the lists are closed */ - if(nlist==0 && nclass>0) { - H5I_clear_type(H5I_GENPROP_CLS, FALSE, FALSE); + if(nlist == 0 && nclass > 0) { + (void)H5I_clear_type(H5I_GENPROP_CLS, FALSE, FALSE); /* Reset the default property lists, if they've been closed */ - if(H5I_nmembers(H5I_GENPROP_CLS)==0) { + if(H5I_nmembers(H5I_GENPROP_CLS) == 0) { H5P_CLS_ROOT_g = H5P_CLS_OBJECT_CREATE_g = H5P_CLS_FILE_CREATE_g = @@ -595,6 +594,8 @@ H5P_term_interface(void) H5P_CLS_FILE_MOUNT_ID_g = (-1); } /* end if */ } /* end if */ + + n++; /*H5I*/ } else { /* Close public interface */ n += H5P__term_pub_interface(); @@ -602,16 +603,19 @@ H5P_term_interface(void) /* Close deprecated interface */ n += H5P__term_deprec_interface(); - H5I_dec_type_ref(H5I_GENPROP_LST); + /* Destroy the property list and class id groups */ + (void)H5I_dec_type_ref(H5I_GENPROP_LST); n++; /*H5I*/ - H5I_dec_type_ref(H5I_GENPROP_CLS); + (void)H5I_dec_type_ref(H5I_GENPROP_CLS); n++; /*H5I*/ + /* Mark closed */ H5_interface_initialize_g = 0; - } - } + } /* end else */ + } /* end if */ + FUNC_LEAVE_NOAPI(n) -} +} /* end H5P_term_interface() */ /*-------------------------------------------------------------------------- diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 5c358ec..b47576c 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -92,6 +92,9 @@ #define H5P_CRT_ORDER_TRACKED 0x0001 #define H5P_CRT_ORDER_INDEXED 0x0002 +/* Default value for all property list classes */ +#define H5P_DEFAULT (hid_t)0 + #ifdef __cplusplus extern "C" { #endif @@ -159,25 +159,30 @@ done: int H5R_term_interface(void) { - int n=0; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR if (H5_interface_initialize_g) { - if ((n=H5I_nmembers(H5I_REFERENCE))) { - H5I_clear_type(H5I_REFERENCE, FALSE, FALSE); - } else { + if(H5I_nmembers(H5I_REFERENCE) > 0) { + (void)H5I_clear_type(H5I_REFERENCE, FALSE, FALSE); + n++; /*H5I*/ + } /* end if */ + else { /* Close deprecated interface */ n += H5R__term_deprec_interface(); - H5I_dec_type_ref(H5I_REFERENCE); + /* Destroy the reference id group */ + (void)H5I_dec_type_ref(H5I_REFERENCE); + n++; /*H5I*/ + + /* Mark closed */ H5_interface_initialize_g = 0; - n = 1; /*H5I*/ - } - } + } /* end else */ + } /* end if */ FUNC_LEAVE_NOAPI(n) -} +} /* end H5R_term_interface() */ /*-------------------------------------------------------------------------- @@ -145,16 +145,17 @@ H5S_term_interface(void) FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { - if((n = H5I_nmembers(H5I_DATASPACE))) { - H5I_clear_type(H5I_DATASPACE, FALSE, FALSE); + if(H5I_nmembers(H5I_DATASPACE) > 0) { + (void)H5I_clear_type(H5I_DATASPACE, FALSE, FALSE); + n++; /*H5I*/ } /* end if */ else { - /* Free data types */ - H5I_dec_type_ref(H5I_DATASPACE); + /* Destroy the dataspace object id group */ + (void)H5I_dec_type_ref(H5I_DATASPACE); + n++; /*H5I*/ /* Shut down interface */ H5_interface_initialize_g = 0; - n = 1; /*H5I*/ } /* end else */ } /* end if */ @@ -1303,8 +1304,7 @@ H5S_set_extent_simple(H5S_t *space, unsigned rank, const hsize_t *dims, /* Selection related cleanup */ /* Set offset to zeros */ - for(u = 0; u < space->extent.rank; u++) - space->select.offset[u] = 0; + HDmemset(space->select.offset, 0, sizeof(hsize_t) * space->extent.rank); space->select.offset_changed = FALSE; /* If the selection is 'all', update the number of elements selected */ diff --git a/src/H5Spublic.h b/src/H5Spublic.h index c62a7b7..097bf30 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -24,7 +24,7 @@ #include "H5Ipublic.h" /* Define atomic datatypes */ -#define H5S_ALL 0 +#define H5S_ALL (hid_t)0 #define H5S_UNLIMITED ((hsize_t)(hssize_t)(-1)) /* Define user-level maximum number of dimensions */ @@ -1048,11 +1048,9 @@ H5T_init_interface(void) status = 0; status |= H5T_register(H5T_PERS_SOFT, "i_i", fixedpt, fixedpt, H5T__conv_i_i, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "f_f", floatpt, floatpt, H5T__conv_f_f, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "i_f", fixedpt, floatpt, H5T__conv_i_f, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "f_f", floatpt, floatpt, H5T__conv_f_f, H5AC_dxpl_id, FALSE); status |= H5T_register(H5T_PERS_SOFT, "f_i", floatpt, fixedpt, H5T__conv_f_i, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "s_s", string, string, H5T__conv_s_s, H5AC_dxpl_id, FALSE); status |= H5T_register(H5T_PERS_SOFT, "b_b", bitfield, bitfield, H5T__conv_b_b, H5AC_dxpl_id, FALSE); status |= H5T_register(H5T_PERS_SOFT, "ibo", fixedpt, fixedpt, H5T__conv_order, H5AC_dxpl_id, FALSE); @@ -1440,20 +1438,23 @@ H5T_unlock_cb(void *_dt, hid_t UNUSED id, void UNUSED *key) int H5T_term_interface(void) { - int i, nprint=0, n=0; - H5T_path_t *path = NULL; + int n = 0; FUNC_ENTER_NOAPI_NOINIT_NOERR if(H5_interface_initialize_g) { + int i, nprint = 0; + /* Unregister all conversion functions */ for(i = 0; i < H5T_g.npaths; i++) { + H5T_path_t *path; + path = H5T_g.path[i]; HDassert(path); if(path->func) { H5T__print_stats(path, &nprint/*in,out*/); path->cdata.command = H5T_CONV_FREE; - if((path->func)(FAIL, FAIL, &(path->cdata), (size_t)0, + if((path->func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL,H5AC_dxpl_id) < 0) { #ifdef H5T_DEBUG if (H5DEBUG(T)) { @@ -1490,7 +1491,9 @@ H5T_term_interface(void) /* Close deprecated interface */ n += H5T__term_deprec_interface(); - H5I_dec_type_ref(H5I_DATATYPE); + /* Destroy the datatype object id group */ + (void)H5I_dec_type_ref(H5I_DATATYPE); + n++; /*H5I*/ /* Reset all the datatype IDs */ H5T_IEEE_F32BE_g = FAIL; @@ -1590,7 +1593,6 @@ H5T_term_interface(void) /* Mark interface as closed */ H5_interface_initialize_g = 0; - n = 1; /*H5I*/ } /* end if */ FUNC_LEAVE_NOAPI(n) @@ -2584,7 +2586,7 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, /* Shut down path */ H5T__print_stats(path, &nprint); path->cdata.command = H5T_CONV_FREE; - if((path->func)(FAIL, FAIL, &(path->cdata), + if((path->func)((hid_t)FAIL, (hid_t)FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { #ifdef H5T_DEBUG if(H5DEBUG(T)) { @@ -4398,7 +4400,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, HDsnprintf(H5T_g.path[0]->name, sizeof(H5T_g.path[0]->name), "no-op"); H5T_g.path[0]->func = H5T__conv_noop; H5T_g.path[0]->cdata.command = H5T_CONV_INIT; - if(H5T__conv_noop(FAIL, FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { + if(H5T__conv_noop((hid_t)FAIL, (hid_t)FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { #ifdef H5T_DEBUG if(H5DEBUG(T)) fprintf(H5DEBUG(T), "H5T: unable to initialize no-op conversion function (ignored)\n"); @@ -4557,7 +4559,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, HDassert(table == H5T_g.path[md]); H5T__print_stats(table, &nprint/*in,out*/); table->cdata.command = H5T_CONV_FREE; - if((table->func)(FAIL, FAIL, &(table->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { + if((table->func)((hid_t)FAIL, (hid_t)FAIL, &(table->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { #ifdef H5T_DEBUG if(H5DEBUG(T)) { fprintf(H5DEBUG(T), "H5T: conversion function 0x%08lx free " diff --git a/src/H5Tbit.c b/src/H5Tbit.c index 258a336..79cf3a6 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -46,9 +46,9 @@ void H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, size_t src_offset, size_t size) { - unsigned shift; - unsigned mask_lo, mask_hi; - unsigned s_idx, d_idx; + size_t shift; + size_t mask_lo, mask_hi; + size_t s_idx, d_idx; FUNC_ENTER_PACKAGE_NOERR @@ -78,8 +78,8 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, * dst[d_idx+1] dst[d_idx] */ while(src_offset && size > 0) { - unsigned nbits = MIN3(size, 8 - dst_offset, 8 - src_offset); - unsigned mask = ((unsigned)1 << nbits) - 1; + size_t nbits = MIN3(size, 8 - dst_offset, 8 - src_offset); + size_t mask = ((size_t)1 << nbits) - 1; dst[d_idx] &= (uint8_t)~(mask << dst_offset); dst[d_idx] |= (uint8_t)(((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset); @@ -121,7 +121,7 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, * to line up with the destination. */ shift = dst_offset; - mask_lo = ((unsigned)1 << (8 - shift)) - 1; + mask_lo = ((size_t)1 << (8 - shift)) - 1; mask_hi = (~mask_lo) & 0xff; for(/*void*/; size > 8; size -= 8, d_idx++, s_idx++) { @@ -137,8 +137,8 @@ H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, /* Finish up */ while(size > 0) { - unsigned nbits = (unsigned)MIN3 (size, 8 - dst_offset, 8 - src_offset); - unsigned mask = ((unsigned)1 << nbits) - 1; + size_t nbits = (size_t)MIN3 (size, 8 - dst_offset, 8 - src_offset); + size_t mask = ((size_t)1 << nbits) - 1; dst[d_idx] &= (uint8_t)(~(mask << dst_offset)); dst[d_idx] |= (uint8_t)(((src[s_idx] >> src_offset) & (uint8_t)mask) << dst_offset); @@ -408,27 +408,27 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Z_unregister(H5Z_filter_t id) +H5Z_unregister(H5Z_filter_t filter_id) { - size_t i; /* Local index variable */ + size_t filter_index; /* Local index variable for filter */ H5Z_object_t object; - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) - HDassert(id >= 0 && id <= H5Z_FILTER_MAX); + HDassert(filter_id>=0 && filter_id<=H5Z_FILTER_MAX); /* Is the filter already registered? */ - for (i=0; i<H5Z_table_used_g; i++) - if (H5Z_table_g[i].id==id) + for (filter_index=0; filter_index<H5Z_table_used_g; filter_index++) + if (H5Z_table_g[filter_index].id==filter_id) break; /* Fail if filter not found */ - if (i>=H5Z_table_used_g) + if (filter_index>=H5Z_table_used_g) HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter is not registered") /* Initialize the structure object for iteration */ - object.filter_id = id; + object.filter_id = filter_id; object.found = FALSE; /* Iterate through all opened datasets, returns a failure if any of them uses the filter */ @@ -451,9 +451,9 @@ H5Z_unregister(H5Z_filter_t id) /* Remove filter from table */ /* Don't worry about shrinking table size (for now) */ - HDmemmove(&H5Z_table_g[i],&H5Z_table_g[i+1],sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-i)); + HDmemmove(&H5Z_table_g[filter_index],&H5Z_table_g[filter_index+1],sizeof(H5Z_class2_t)*((H5Z_table_used_g-1)-filter_index)); #ifdef H5Z_DEBUG - HDmemmove(&H5Z_stat_table_g[i],&H5Z_stat_table_g[i+1],sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-i)); + HDmemmove(&H5Z_stat_table_g[filter_index],&H5Z_stat_table_g[filter_index+1],sizeof(H5Z_stats_t)*((H5Z_table_used_g-1)-filter_index)); #endif /* H5Z_DEBUG */ H5Z_table_used_g--; @@ -508,7 +508,7 @@ done: * FALSE otherwise. * * Programmer: Raymond Lu - * 13 May 2013 + * 6 May 2013 * *------------------------------------------------------------------------- */ @@ -612,7 +612,7 @@ done: * FAIL if there is an error * * Programmer: Raymond Lu - * 13 May 2013 + * 6 May 2013 * *------------------------------------------------------------------------- */ @@ -636,7 +636,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z__flush_file_cb() */ - /*------------------------------------------------------------------------- * Function: H5Zfilter_avail @@ -851,7 +850,7 @@ H5Z_prepare_prelude_callback_dcpl(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type H5S_t *space; /* Dataspace describing chunk */ size_t u; /* Local index variable */ - /* Create a data space for a chunk & set the extent */ + /* Create a dataspace for a chunk & set the extent */ for(u = 0; u < dcpl_layout.u.chunk.ndims; u++) chunk_dims[u] = dcpl_layout.u.chunk.dim[u]; if(NULL == (space = H5S_create_simple(dcpl_layout.u.chunk.ndims, chunk_dims, NULL))) @@ -972,7 +971,7 @@ H5Z_can_apply_direct(const H5O_pline_t *pline) HDassert(pline->nused > 0); /* Make "can apply" callbacks for filters in pipeline */ - if(H5Z_prelude_callback(pline, -1, -1, -1, H5Z_PRELUDE_CAN_APPLY) < 0) + if(H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_CAN_APPLY) < 0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter") done: @@ -1009,7 +1008,7 @@ H5Z_set_local_direct(const H5O_pline_t *pline) HDassert(pline->nused > 0); /* Make "set local" callbacks for filters in pipeline */ - if(H5Z_prelude_callback(pline, -1, -1, -1, H5Z_PRELUDE_SET_LOCAL) < 0) + if(H5Z_prelude_callback(pline, (hid_t)-1, (hid_t)-1, (hid_t)-1, H5Z_PRELUDE_SET_LOCAL) < 0) HGOTO_ERROR(H5E_PLINE, H5E_SETLOCAL, FAIL, "local filter parameters not set") done: @@ -1493,7 +1492,7 @@ done: * FAIL - error * * Programmer: Raymond Lu - * 14 May 2013 + * 26 April 2013 * * Modifications: * @@ -1523,6 +1522,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_filter_in_pline() */ + /*------------------------------------------------------------------------- * Function: H5Z_all_filters_avail diff --git a/src/H5Zszip.c b/src/H5Zszip.c index 9bcbb1a..589b27b 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -190,7 +190,7 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Get dataspace */ if(NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data space") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") /* Get dimensions for dataspace */ if((ndims = H5S_get_simple_extent_dims(ds, dims, NULL)) < 0) diff --git a/src/H5public.h b/src/H5public.h index e08bd73..4bfd1e0 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -282,9 +282,6 @@ H5_GCC_DIAG_ON(long-long) # error "nothing appropriate for uint64_t" #endif -/* Default value for all property list classes */ -#define H5P_DEFAULT 0 - /* Common iteration orders */ typedef enum { H5_ITER_UNKNOWN = -1, /* Unknown order */ diff --git a/src/H5trace.c b/src/H5trace.c index b8f0b6a..5e90ff6 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -1181,7 +1181,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) case H5I_DATASPACE: fprintf(out, "%ld (dspace)", (long)obj); - /* Save the rank of simple data spaces for arrays */ + /* Save the rank of simple dataspaces for arrays */ /* This may generate recursive call to the library... -QAK */ { H5S_t *space; diff --git a/src/H5version.h b/src/H5version.h index 58de2ab..02e4c36 100644 --- a/src/H5version.h +++ b/src/H5version.h @@ -22,7 +22,7 @@ /* Issue error if contradicting macros have been defined. */ #if defined(H5_USE_16_API) && defined(H5_NO_DEPRECATED_SYMBOLS) -#error "Can't choose old API versions when deprecated APIs are disabled" + #error "Can't choose old API versions when deprecated APIs are disabled" #endif /* defined(H5_USE_16_API) && defined(H5_NO_DEPRECATED_SYMBOLS) */ @@ -33,7 +33,7 @@ * API symbol, the individual API version macro takes priority. */ #if defined(H5_USE_16_API_DEFAULT) && !defined(H5_USE_16_API) -#define H5_USE_16_API 1 + #define H5_USE_16_API 1 #endif /* H5_USE_16_API_DEFAULT && !H5_USE_16_API */ #ifdef H5_USE_16_API @@ -43,87 +43,87 @@ /*************/ #if !defined(H5Acreate_vers) -#define H5Acreate_vers 1 + #define H5Acreate_vers 1 #endif /* !defined(H5Acreate_vers) */ #if !defined(H5Aiterate_vers) -#define H5Aiterate_vers 1 + #define H5Aiterate_vers 1 #endif /* !defined(H5Aiterate_vers) */ #if !defined(H5Dcreate_vers) -#define H5Dcreate_vers 1 + #define H5Dcreate_vers 1 #endif /* !defined(H5Dcreate_vers) */ #if !defined(H5Dopen_vers) -#define H5Dopen_vers 1 + #define H5Dopen_vers 1 #endif /* !defined(H5Dopen_vers) */ #if !defined(H5Eclear_vers) -#define H5Eclear_vers 1 + #define H5Eclear_vers 1 #endif /* !defined(H5Eclear_vers) */ #if !defined(H5Eget_auto_vers) -#define H5Eget_auto_vers 1 + #define H5Eget_auto_vers 1 #endif /* !defined(H5Eget_auto_vers) */ #if !defined(H5Eprint_vers) -#define H5Eprint_vers 1 + #define H5Eprint_vers 1 #endif /* !defined(H5Eprint_vers) */ #if !defined(H5Epush_vers) -#define H5Epush_vers 1 + #define H5Epush_vers 1 #endif /* !defined(H5Epush_vers) */ #if !defined(H5Eset_auto_vers) -#define H5Eset_auto_vers 1 + #define H5Eset_auto_vers 1 #endif /* !defined(H5Eset_auto_vers) */ #if !defined(H5Ewalk_vers) -#define H5Ewalk_vers 1 + #define H5Ewalk_vers 1 #endif /* !defined(H5Ewalk_vers) */ #if !defined(H5Gcreate_vers) -#define H5Gcreate_vers 1 + #define H5Gcreate_vers 1 #endif /* !defined(H5Gcreate_vers) */ #if !defined(H5Gopen_vers) -#define H5Gopen_vers 1 + #define H5Gopen_vers 1 #endif /* !defined(H5Gopen_vers) */ #if !defined(H5Pget_filter_vers) -#define H5Pget_filter_vers 1 + #define H5Pget_filter_vers 1 #endif /* !defined(H5Pget_filter_vers) */ #if !defined(H5Pget_filter_by_id_vers) -#define H5Pget_filter_by_id_vers 1 + #define H5Pget_filter_by_id_vers 1 #endif /* !defined(H5Pget_filter_by_id_vers) */ #if !defined(H5Pinsert_vers) -#define H5Pinsert_vers 1 + #define H5Pinsert_vers 1 #endif /* !defined(H5Pinsert_vers) */ #if !defined(H5Pregister_vers) -#define H5Pregister_vers 1 + #define H5Pregister_vers 1 #endif /* !defined(H5Pregister_vers) */ #if !defined(H5Rget_obj_type_vers) -#define H5Rget_obj_type_vers 1 + #define H5Rget_obj_type_vers 1 #endif /* !defined(H5Rget_obj_type_vers) */ #if !defined(H5Tarray_create_vers) -#define H5Tarray_create_vers 1 + #define H5Tarray_create_vers 1 #endif /* !defined(H5Tarray_create_vers) */ #if !defined(H5Tcommit_vers) -#define H5Tcommit_vers 1 + #define H5Tcommit_vers 1 #endif /* !defined(H5Tcommit_vers) */ #if !defined(H5Tget_array_dims_vers) -#define H5Tget_array_dims_vers 1 + #define H5Tget_array_dims_vers 1 #endif /* !defined(H5Tget_array_dims_vers) */ #if !defined(H5Topen_vers) -#define H5Topen_vers 1 + #define H5Topen_vers 1 #endif /* !defined(H5Topen_vers) */ /************/ @@ -131,11 +131,11 @@ /************/ #if !defined(H5E_auto_t_vers) -#define H5E_auto_t_vers 1 + #define H5E_auto_t_vers 1 #endif /* !defined(H5E_auto_t_vers) */ #if !defined(H5Z_class_t_vers) -#define H5Z_class_t_vers 1 + #define H5Z_class_t_vers 1 #endif /* !defined(H5Z_class_t_vers) */ #endif /* H5_USE_16_API */ @@ -152,240 +152,240 @@ /*************/ #if !defined(H5Acreate_vers) || H5Acreate_vers == 2 -#ifndef H5Acreate_vers -#define H5Acreate_vers 2 -#endif /* H5Acreate_vers */ -#define H5Acreate H5Acreate2 + #ifndef H5Acreate_vers + #define H5Acreate_vers 2 + #endif /* H5Acreate_vers */ + #define H5Acreate H5Acreate2 #elif H5Acreate_vers == 1 -#define H5Acreate H5Acreate1 + #define H5Acreate H5Acreate1 #else /* H5Acreate_vers */ -#error "H5Acreate_vers set to invalid value" + #error "H5Acreate_vers set to invalid value" #endif /* H5Acreate_vers */ #if !defined(H5Aiterate_vers) || H5Aiterate_vers == 2 -#ifndef H5Aiterate_vers -#define H5Aiterate_vers 2 -#endif /* H5Aiterate_vers */ -#define H5Aiterate H5Aiterate2 -#define H5A_operator_t H5A_operator2_t + #ifndef H5Aiterate_vers + #define H5Aiterate_vers 2 + #endif /* H5Aiterate_vers */ + #define H5Aiterate H5Aiterate2 + #define H5A_operator_t H5A_operator2_t #elif H5Aiterate_vers == 1 -#define H5Aiterate H5Aiterate1 -#define H5A_operator_t H5A_operator1_t + #define H5Aiterate H5Aiterate1 + #define H5A_operator_t H5A_operator1_t #else /* H5Aiterate_vers */ -#error "H5Aiterate_vers set to invalid value" + #error "H5Aiterate_vers set to invalid value" #endif /* H5Aiterate_vers */ #if !defined(H5Dcreate_vers) || H5Dcreate_vers == 2 -#ifndef H5Dcreate_vers -#define H5Dcreate_vers 2 -#endif /* H5Dcreate_vers */ -#define H5Dcreate H5Dcreate2 + #ifndef H5Dcreate_vers + #define H5Dcreate_vers 2 + #endif /* H5Dcreate_vers */ + #define H5Dcreate H5Dcreate2 #elif H5Dcreate_vers == 1 -#define H5Dcreate H5Dcreate1 + #define H5Dcreate H5Dcreate1 #else /* H5Dcreate_vers */ -#error "H5Dcreate_vers set to invalid value" + #error "H5Dcreate_vers set to invalid value" #endif /* H5Dcreate_vers */ #if !defined(H5Dopen_vers) || H5Dopen_vers == 2 -#ifndef H5Dopen_vers -#define H5Dopen_vers 2 -#endif /* H5Dopen_vers */ -#define H5Dopen H5Dopen2 + #ifndef H5Dopen_vers + #define H5Dopen_vers 2 + #endif /* H5Dopen_vers */ + #define H5Dopen H5Dopen2 #elif H5Dopen_vers == 1 -#define H5Dopen H5Dopen1 + #define H5Dopen H5Dopen1 #else /* H5Dopen_vers */ -#error "H5Dopen_vers set to invalid value" + #error "H5Dopen_vers set to invalid value" #endif /* H5Dopen_vers */ #if !defined(H5Eclear_vers) || H5Eclear_vers == 2 -#ifndef H5Eclear_vers -#define H5Eclear_vers 2 -#endif /* H5Eclear_vers */ -#define H5Eclear H5Eclear2 + #ifndef H5Eclear_vers + #define H5Eclear_vers 2 + #endif /* H5Eclear_vers */ + #define H5Eclear H5Eclear2 #elif H5Eclear_vers == 1 -#define H5Eclear H5Eclear1 + #define H5Eclear H5Eclear1 #else /* H5Eclear_vers */ -#error "H5Eclear_vers set to invalid value" + #error "H5Eclear_vers set to invalid value" #endif /* H5Eclear_vers */ #if !defined(H5Eget_auto_vers) || H5Eget_auto_vers == 2 -#ifndef H5Eget_auto_vers -#define H5Eget_auto_vers 2 -#endif /* H5Eget_auto_vers */ -#define H5Eget_auto H5Eget_auto2 + #ifndef H5Eget_auto_vers + #define H5Eget_auto_vers 2 + #endif /* H5Eget_auto_vers */ + #define H5Eget_auto H5Eget_auto2 #elif H5Eget_auto_vers == 1 -#define H5Eget_auto H5Eget_auto1 + #define H5Eget_auto H5Eget_auto1 #else /* H5Eget_auto_vers */ -#error "H5Eget_auto_vers set to invalid value" + #error "H5Eget_auto_vers set to invalid value" #endif /* H5Eget_auto_vers */ #if !defined(H5Eprint_vers) || H5Eprint_vers == 2 -#ifndef H5Eprint_vers -#define H5Eprint_vers 2 -#endif /* H5Eprint_vers */ -#define H5Eprint H5Eprint2 + #ifndef H5Eprint_vers + #define H5Eprint_vers 2 + #endif /* H5Eprint_vers */ + #define H5Eprint H5Eprint2 #elif H5Eprint_vers == 1 -#define H5Eprint H5Eprint1 + #define H5Eprint H5Eprint1 #else /* H5Eprint_vers */ -#error "H5Eprint_vers set to invalid value" + #error "H5Eprint_vers set to invalid value" #endif /* H5Eprint_vers */ #if !defined(H5Epush_vers) || H5Epush_vers == 2 -#ifndef H5Epush_vers -#define H5Epush_vers 2 -#endif /* H5Epush_vers */ -#define H5Epush H5Epush2 + #ifndef H5Epush_vers + #define H5Epush_vers 2 + #endif /* H5Epush_vers */ + #define H5Epush H5Epush2 #elif H5Epush_vers == 1 -#define H5Epush H5Epush1 + #define H5Epush H5Epush1 #else /* H5Epush_vers */ -#error "H5Epush_vers set to invalid value" + #error "H5Epush_vers set to invalid value" #endif /* H5Epush_vers */ #if !defined(H5Eset_auto_vers) || H5Eset_auto_vers == 2 -#ifndef H5Eset_auto_vers -#define H5Eset_auto_vers 2 -#endif /* H5Eset_auto_vers */ -#define H5Eset_auto H5Eset_auto2 + #ifndef H5Eset_auto_vers + #define H5Eset_auto_vers 2 + #endif /* H5Eset_auto_vers */ + #define H5Eset_auto H5Eset_auto2 #elif H5Eset_auto_vers == 1 -#define H5Eset_auto H5Eset_auto1 + #define H5Eset_auto H5Eset_auto1 #else /* H5Eset_auto_vers */ -#error "H5Eset_auto_vers set to invalid value" + #error "H5Eset_auto_vers set to invalid value" #endif /* H5Eset_auto_vers */ #if !defined(H5Ewalk_vers) || H5Ewalk_vers == 2 -#ifndef H5Ewalk_vers -#define H5Ewalk_vers 2 -#endif /* H5Ewalk_vers */ -#define H5Ewalk H5Ewalk2 -#define H5E_error_t H5E_error2_t -#define H5E_walk_t H5E_walk2_t + #ifndef H5Ewalk_vers + #define H5Ewalk_vers 2 + #endif /* H5Ewalk_vers */ + #define H5Ewalk H5Ewalk2 + #define H5E_error_t H5E_error2_t + #define H5E_walk_t H5E_walk2_t #elif H5Ewalk_vers == 1 -#define H5Ewalk H5Ewalk1 -#define H5E_error_t H5E_error1_t -#define H5E_walk_t H5E_walk1_t + #define H5Ewalk H5Ewalk1 + #define H5E_error_t H5E_error1_t + #define H5E_walk_t H5E_walk1_t #else /* H5Ewalk_vers */ -#error "H5Ewalk_vers set to invalid value" + #error "H5Ewalk_vers set to invalid value" #endif /* H5Ewalk_vers */ #if !defined(H5Gcreate_vers) || H5Gcreate_vers == 2 -#ifndef H5Gcreate_vers -#define H5Gcreate_vers 2 -#endif /* H5Gcreate_vers */ -#define H5Gcreate H5Gcreate2 + #ifndef H5Gcreate_vers + #define H5Gcreate_vers 2 + #endif /* H5Gcreate_vers */ + #define H5Gcreate H5Gcreate2 #elif H5Gcreate_vers == 1 -#define H5Gcreate H5Gcreate1 + #define H5Gcreate H5Gcreate1 #else /* H5Gcreate_vers */ -#error "H5Gcreate_vers set to invalid value" + #error "H5Gcreate_vers set to invalid value" #endif /* H5Gcreate_vers */ #if !defined(H5Gopen_vers) || H5Gopen_vers == 2 -#ifndef H5Gopen_vers -#define H5Gopen_vers 2 -#endif /* H5Gopen_vers */ -#define H5Gopen H5Gopen2 + #ifndef H5Gopen_vers + #define H5Gopen_vers 2 + #endif /* H5Gopen_vers */ + #define H5Gopen H5Gopen2 #elif H5Gopen_vers == 1 -#define H5Gopen H5Gopen1 + #define H5Gopen H5Gopen1 #else /* H5Gopen_vers */ -#error "H5Gopen_vers set to invalid value" + #error "H5Gopen_vers set to invalid value" #endif /* H5Gopen_vers */ #if !defined(H5Pget_filter_vers) || H5Pget_filter_vers == 2 -#ifndef H5Pget_filter_vers -#define H5Pget_filter_vers 2 -#endif /* H5Pget_filter_vers */ -#define H5Pget_filter H5Pget_filter2 + #ifndef H5Pget_filter_vers + #define H5Pget_filter_vers 2 + #endif /* H5Pget_filter_vers */ + #define H5Pget_filter H5Pget_filter2 #elif H5Pget_filter_vers == 1 -#define H5Pget_filter H5Pget_filter1 + #define H5Pget_filter H5Pget_filter1 #else /* H5Pget_filter_vers */ -#error "H5Pget_filter_vers set to invalid value" + #error "H5Pget_filter_vers set to invalid value" #endif /* H5Pget_filter_vers */ #if !defined(H5Pget_filter_by_id_vers) || H5Pget_filter_by_id_vers == 2 -#ifndef H5Pget_filter_by_id_vers -#define H5Pget_filter_by_id_vers 2 -#endif /* H5Pget_filter_by_id_vers */ -#define H5Pget_filter_by_id H5Pget_filter_by_id2 + #ifndef H5Pget_filter_by_id_vers + #define H5Pget_filter_by_id_vers 2 + #endif /* H5Pget_filter_by_id_vers */ + #define H5Pget_filter_by_id H5Pget_filter_by_id2 #elif H5Pget_filter_by_id_vers == 1 -#define H5Pget_filter_by_id H5Pget_filter_by_id1 + #define H5Pget_filter_by_id H5Pget_filter_by_id1 #else /* H5Pget_filter_by_id_vers */ -#error "H5Pget_filter_by_id_vers set to invalid value" + #error "H5Pget_filter_by_id_vers set to invalid value" #endif /* H5Pget_filter_by_id_vers */ #if !defined(H5Pinsert_vers) || H5Pinsert_vers == 2 -#ifndef H5Pinsert_vers -#define H5Pinsert_vers 2 -#endif /* H5Pinsert_vers */ -#define H5Pinsert H5Pinsert2 + #ifndef H5Pinsert_vers + #define H5Pinsert_vers 2 + #endif /* H5Pinsert_vers */ + #define H5Pinsert H5Pinsert2 #elif H5Pinsert_vers == 1 -#define H5Pinsert H5Pinsert1 + #define H5Pinsert H5Pinsert1 #else /* H5Pinsert_vers */ -#error "H5Pinsert_vers set to invalid value" + #error "H5Pinsert_vers set to invalid value" #endif /* H5Pinsert_vers */ #if !defined(H5Pregister_vers) || H5Pregister_vers == 2 -#ifndef H5Pregister_vers -#define H5Pregister_vers 2 -#endif /* H5Pregister_vers */ -#define H5Pregister H5Pregister2 + #ifndef H5Pregister_vers + #define H5Pregister_vers 2 + #endif /* H5Pregister_vers */ + #define H5Pregister H5Pregister2 #elif H5Pregister_vers == 1 -#define H5Pregister H5Pregister1 + #define H5Pregister H5Pregister1 #else /* H5Pregister_vers */ -#error "H5Pregister_vers set to invalid value" + #error "H5Pregister_vers set to invalid value" #endif /* H5Pregister_vers */ #if !defined(H5Rget_obj_type_vers) || H5Rget_obj_type_vers == 2 -#ifndef H5Rget_obj_type_vers -#define H5Rget_obj_type_vers 2 -#endif /* H5Rget_obj_type_vers */ -#define H5Rget_obj_type H5Rget_obj_type2 + #ifndef H5Rget_obj_type_vers + #define H5Rget_obj_type_vers 2 + #endif /* H5Rget_obj_type_vers */ + #define H5Rget_obj_type H5Rget_obj_type2 #elif H5Rget_obj_type_vers == 1 -#define H5Rget_obj_type H5Rget_obj_type1 + #define H5Rget_obj_type H5Rget_obj_type1 #else /* H5Rget_obj_type_vers */ -#error "H5Rget_obj_type_vers set to invalid value" + #error "H5Rget_obj_type_vers set to invalid value" #endif /* H5Rget_obj_type_vers */ #if !defined(H5Tarray_create_vers) || H5Tarray_create_vers == 2 -#ifndef H5Tarray_create_vers -#define H5Tarray_create_vers 2 -#endif /* H5Tarray_create_vers */ -#define H5Tarray_create H5Tarray_create2 + #ifndef H5Tarray_create_vers + #define H5Tarray_create_vers 2 + #endif /* H5Tarray_create_vers */ + #define H5Tarray_create H5Tarray_create2 #elif H5Tarray_create_vers == 1 -#define H5Tarray_create H5Tarray_create1 + #define H5Tarray_create H5Tarray_create1 #else /* H5Tarray_create_vers */ -#error "H5Tarray_create_vers set to invalid value" + #error "H5Tarray_create_vers set to invalid value" #endif /* H5Tarray_create_vers */ #if !defined(H5Tcommit_vers) || H5Tcommit_vers == 2 -#ifndef H5Tcommit_vers -#define H5Tcommit_vers 2 -#endif /* H5Tcommit_vers */ -#define H5Tcommit H5Tcommit2 + #ifndef H5Tcommit_vers + #define H5Tcommit_vers 2 + #endif /* H5Tcommit_vers */ + #define H5Tcommit H5Tcommit2 #elif H5Tcommit_vers == 1 -#define H5Tcommit H5Tcommit1 + #define H5Tcommit H5Tcommit1 #else /* H5Tcommit_vers */ -#error "H5Tcommit_vers set to invalid value" + #error "H5Tcommit_vers set to invalid value" #endif /* H5Tcommit_vers */ #if !defined(H5Tget_array_dims_vers) || H5Tget_array_dims_vers == 2 -#ifndef H5Tget_array_dims_vers -#define H5Tget_array_dims_vers 2 -#endif /* H5Tget_array_dims_vers */ -#define H5Tget_array_dims H5Tget_array_dims2 + #ifndef H5Tget_array_dims_vers + #define H5Tget_array_dims_vers 2 + #endif /* H5Tget_array_dims_vers */ + #define H5Tget_array_dims H5Tget_array_dims2 #elif H5Tget_array_dims_vers == 1 -#define H5Tget_array_dims H5Tget_array_dims1 + #define H5Tget_array_dims H5Tget_array_dims1 #else /* H5Tget_array_dims_vers */ -#error "H5Tget_array_dims_vers set to invalid value" + #error "H5Tget_array_dims_vers set to invalid value" #endif /* H5Tget_array_dims_vers */ #if !defined(H5Topen_vers) || H5Topen_vers == 2 -#ifndef H5Topen_vers -#define H5Topen_vers 2 -#endif /* H5Topen_vers */ -#define H5Topen H5Topen2 + #ifndef H5Topen_vers + #define H5Topen_vers 2 + #endif /* H5Topen_vers */ + #define H5Topen H5Topen2 #elif H5Topen_vers == 1 -#define H5Topen H5Topen1 + #define H5Topen H5Topen1 #else /* H5Topen_vers */ -#error "H5Topen_vers set to invalid value" + #error "H5Topen_vers set to invalid value" #endif /* H5Topen_vers */ /************/ @@ -393,26 +393,26 @@ /************/ #if !defined(H5E_auto_t_vers) || H5E_auto_t_vers == 2 -#ifndef H5E_auto_t_vers -#define H5E_auto_t_vers 2 -#endif /* H5E_auto_t_vers */ -#define H5E_auto_t H5E_auto2_t + #ifndef H5E_auto_t_vers + #define H5E_auto_t_vers 2 + #endif /* H5E_auto_t_vers */ + #define H5E_auto_t H5E_auto2_t #elif H5E_auto_t_vers == 1 -#define H5E_auto_t H5E_auto1_t + #define H5E_auto_t H5E_auto1_t #else /* H5E_auto_t_vers */ -#error "H5E_auto_t_vers set to invalid value" + #error "H5E_auto_t_vers set to invalid value" #endif /* H5E_auto_t_vers */ #if !defined(H5Z_class_t_vers) || H5Z_class_t_vers == 2 -#ifndef H5Z_class_t_vers -#define H5Z_class_t_vers 2 -#endif /* H5Z_class_t_vers */ -#define H5Z_class_t H5Z_class2_t + #ifndef H5Z_class_t_vers + #define H5Z_class_t_vers 2 + #endif /* H5Z_class_t_vers */ + #define H5Z_class_t H5Z_class2_t #elif H5Z_class_t_vers == 1 -#define H5Z_class_t H5Z_class1_t + #define H5Z_class_t H5Z_class1_t #else /* H5Z_class_t_vers */ -#error "H5Z_class_t_vers set to invalid value" + #error "H5Z_class_t_vers set to invalid value" #endif /* H5Z_class_t_vers */ #endif /* H5version_H */ |