From 0001a136175eb59c3c2ff778c67e763bae73f473 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 3 Nov 2001 17:27:54 -0500 Subject: [svn-r4589] Purpose: Code cleanup Description: Clean up various compiler warnings from generic property updates. Platforms tested: FreeBSD 4.4 (hawkwind) --- perform/iopipe.c | 32 +------------------------------- src/H5F.c | 5 ++--- src/H5FDcore.c | 5 +++-- src/H5FDdpss.c | 1 + src/H5FDfamily.c | 9 +++++---- src/H5FDgass.c | 5 +++-- src/H5FDlog.c | 5 +++-- src/H5FDmpio.c | 5 +++-- src/H5FDmulti.c | 6 ++++-- src/H5FDsec2.c | 7 ++++--- src/H5FDsrb.c | 1 + src/H5FDstdio.c | 6 ++++-- src/H5Fprivate.h | 6 +++--- src/H5P.c | 14 +++++--------- src/H5Ppublic.h | 1 - src/H5Tvlen.c | 2 +- src/H5Vprivate.h | 4 ++-- test/tfile.c | 6 ++++-- 18 files changed, 49 insertions(+), 71 deletions(-) diff --git a/perform/iopipe.c b/perform/iopipe.c index aa76369..9c3e256 100644 --- a/perform/iopipe.c +++ b/perform/iopipe.c @@ -7,7 +7,6 @@ */ /* See H5private.h for how to include headers */ -#undef NDEBUG #include "hdf5.h" #ifdef H5_HAVE_WINSOCK_H @@ -17,36 +16,6 @@ /*Winsock.h includes windows.h, due to the different value of WINVER, windows.h should be put before H5private.h. Kent yang 6/21/2001*/ -#include "H5private.h" - -#ifdef H5_STDC_HEADERS -# include -# include -# include -# include -# include -#endif - -#ifdef H5_HAVE_UNISTD_H -# include -# include -#endif - -#if defined(H5_TIME_WITH_SYS_TIME) -# include -# include -#elif defined(H5_HAVE_SYS_TIME_H) -# include -#else -# include -#endif - -#ifdef H5_HAVE_SYS_RESOURCE_H -# include -#endif - - - #if defined (__MWERKS__) #ifdef H5_HAVE_SYS_TIMEB #undef H5_HAVE_SYS_TIMEB @@ -56,6 +25,7 @@ WINVER, windows.h should be put before H5private.h. Kent yang 6/21/2001*/ #endif #endif /* __MWERKS__*/ +#include "H5private.h" #ifdef H5_HAVE_SYS_TIMEB #include diff --git a/src/H5F.c b/src/H5F.c index a29ecf6..b9c3c68 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -1034,7 +1034,9 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id) { H5F_t *f=NULL, *ret_value=NULL; int n; +#ifdef H5_HAVE_PARALLEL hid_t driver_id = -1; +#endif /* H5_HAVE_PARALLEL */ FUNC_ENTER(H5F_new, NULL); @@ -1774,9 +1776,6 @@ H5Fcreate(const char *filename, unsigned flags, hid_t fcpl_id, H5F_t *new_file = NULL; /*file struct for new file */ hid_t ret_value = FAIL; /*return value */ - size_t meta_block_size = 0; - hid_t driver_id=-1; - FUNC_ENTER(H5Fcreate, FAIL); H5TRACE4("i","sIuii",filename,flags,fcpl_id,fapl_id); diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 6072d38..f83cb74 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -13,8 +13,9 @@ #include "H5Eprivate.h" /*error handling */ #include "H5Fprivate.h" /*files */ #include "H5FDprivate.h" /*file driver */ -#include "H5FDcore.h" /* Core file driver */ -#include "H5MMprivate.h" /* Memory allocation */ +#include "H5FDcore.h" /* Core file driver */ +#include "H5Iprivate.h" /*object IDs */ +#include "H5MMprivate.h" /* Memory allocation */ #include "H5Pprivate.h" /*property lists */ #undef MAX diff --git a/src/H5FDdpss.c b/src/H5FDdpss.c index f42f471..13da176 100644 --- a/src/H5FDdpss.c +++ b/src/H5FDdpss.c @@ -14,6 +14,7 @@ #include "H5Eprivate.h" /* error handling */ #include "H5FDprivate.h" /*file driver */ #include "H5FDdpss.h" +#include "H5Iprivate.h" /*object IDs */ #include "H5MMprivate.h" /* memory management */ #ifdef COALESCE_READS diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 5162163..9a3160e 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -25,8 +25,9 @@ #include "H5Eprivate.h" /*error handling */ #include "H5Fprivate.h" /*files */ #include "H5FDprivate.h" /*file driver */ -#include "H5FDfamily.h" /* Family file driver */ -#include "H5MMprivate.h" /* Memory allocation */ +#include "H5FDfamily.h" /* Family file driver */ +#include "H5Iprivate.h" /*object IDs */ +#include "H5MMprivate.h" /* Memory allocation */ #include "H5Pprivate.h" /*property lists */ @@ -181,7 +182,7 @@ H5Pset_fapl_family(hid_t fapl_id, hsize_t memb_size, hid_t memb_fapl_id) H5TRACE3("e","ihi",fapl_id,memb_size,memb_fapl_id); /* Check arguments */ - if(H5I_GENPROP_LST != H5I_get_type(fapl_id) || + if(H5I_GENPROP_LST != H5Iget_type(fapl_id) || TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); @@ -233,7 +234,7 @@ H5Pget_fapl_family(hid_t fapl_id, hsize_t *memb_size/*out*/, FUNC_ENTER(H5Pget_fapl_family, FAIL); H5TRACE3("e","ixx",fapl_id,memb_size,memb_fapl_id); - if(H5I_GENPROP_LST != H5I_get_type(fapl_id) || + if(H5I_GENPROP_LST != H5Iget_type(fapl_id) || TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) HRETURN_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access list"); if (H5FD_FAMILY!=H5P_get_driver(fapl_id)) diff --git a/src/H5FDgass.c b/src/H5FDgass.c index 8cd000a..7d334bd 100644 --- a/src/H5FDgass.c +++ b/src/H5FDgass.c @@ -12,8 +12,9 @@ #include "H5Eprivate.h" /*error handling */ #include "H5Fprivate.h" /*files */ #include "H5FDprivate.h" /*file driver */ -#include "H5FDgass.h" /* Core file driver */ -#include "H5MMprivate.h" /* Memory allocation */ +#include "H5FDgass.h" /* Core file driver */ +#include "H5Iprivate.h" /*object IDs */ +#include "H5MMprivate.h" /* Memory allocation */ #include "H5Pprivate.h" /*property lists */ diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 873b44c..29bfc51 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -18,9 +18,10 @@ #include "H5Eprivate.h" /*error handling */ #include "H5Fprivate.h" /*files */ #include "H5FDprivate.h" /*file driver */ -#include "H5FDlog.h" /* logging file driver */ +#include "H5FDlog.h" /* logging file driver */ #include "H5FLprivate.h" /*Free Lists */ -#include "H5MMprivate.h" /* Memory allocation */ +#include "H5Iprivate.h" /*object IDs */ +#include "H5MMprivate.h" /* Memory allocation */ #include "H5Pprivate.h" /*property lists */ diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 2846d4a..4419b84 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -24,8 +24,9 @@ #include "H5Eprivate.h" /*error handling */ #include "H5Fprivate.h" /*files */ #include "H5FDprivate.h" /*file driver */ -#include "H5FDmpio.h" /* MPI I/O file driver */ -#include "H5MMprivate.h" /* Memory allocation */ +#include "H5FDmpio.h" /* MPI I/O file driver */ +#include "H5Iprivate.h" /*object IDs */ +#include "H5MMprivate.h" /* Memory allocation */ #include "H5Pprivate.h" /*property lists */ /* diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 8398470..8d4d886 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -14,7 +14,9 @@ #include #include "hdf5.h" +#ifdef QAK #include "H5private.h" /* library function */ +#endif /* QAK */ /* * Define H5FD_MULTI_DEBUG if you want the ability to print debugging @@ -402,7 +404,7 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, H5Eclear(); /* Check arguments and supply default values */ - if(H5I_GENPROP_LST != H5I_get_type(fapl_id) || + if(H5I_GENPROP_LST != H5Iget_type(fapl_id) || TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "not an access list", -1); if (!memb_map) { @@ -499,7 +501,7 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, /* Clear the error stack */ H5Eclear(); - if(H5I_GENPROP_LST != H5I_get_type(fapl_id) || + if(H5I_GENPROP_LST != H5Iget_type(fapl_id) || TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not an access list", -1); if (H5FD_MULTI!=H5Pget_driver(fapl_id)) diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index ea963e7..fcf1ab6 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -16,9 +16,10 @@ #include "H5Eprivate.h" /*error handling */ #include "H5Fprivate.h" /*files */ #include "H5FDprivate.h" /*file driver */ -#include "H5FDsec2.h" /* Sec2 file driver */ +#include "H5FDsec2.h" /* Sec2 file driver */ #include "H5FLprivate.h" /*Free Lists */ -#include "H5MMprivate.h" /* Memory allocation */ +#include "H5Iprivate.h" /*object IDs */ +#include "H5MMprivate.h" /* Memory allocation */ #include "H5Pprivate.h" /*property lists */ #ifdef MAX @@ -204,7 +205,7 @@ H5FD_sec2_init(void) { FUNC_ENTER(H5FD_sec2_init, FAIL); - if (H5I_VFL!=H5Iget_type(H5FD_SEC2_g)) + if (H5I_VFL!=H5I_get_type(H5FD_SEC2_g)) H5FD_SEC2_g = H5FDregister(&H5FD_sec2_g); FUNC_LEAVE(H5FD_SEC2_g); diff --git a/src/H5FDsrb.c b/src/H5FDsrb.c index 792c008..fb15d88 100644 --- a/src/H5FDsrb.c +++ b/src/H5FDsrb.c @@ -12,6 +12,7 @@ #include "H5Fprivate.h" /*files */ #include "H5FDprivate.h" /*file driver */ #include "H5FDsrb.h" /* Core file driver */ +#include "H5Iprivate.h" /*object IDs */ #include "H5MMprivate.h" /* Memory allocation */ #include "H5Pprivate.h" /*property lists */ diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 3082f96..50828c6 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -15,7 +15,9 @@ #include #include "hdf5.h" +#ifdef QAK #include "H5private.h" /* library function */ +#endif /* QAK */ #ifdef H5_HAVE_STDIO_H #include @@ -228,8 +230,8 @@ H5Pset_fapl_stdio(hid_t fapl_id) /* Clear the error stack */ H5Eclear(); - if(H5I_GENPROP_LST != H5I_get_type(fapl_id) || - TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) { + if(H5I_GENPROP_LST != H5Iget_type(fapl_id) || + 0 == H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) { H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1); } diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 15c1ec9..7aab749 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -436,9 +436,9 @@ __DLL__ herr_t H5F_addr_pack(H5F_t *f, haddr_t *addr_p /*out*/, const unsigned long objno[2]); /* callback Functions for file access class */ -__DLL__ herr_t H5F_acs_create(hid_t fapl_id, void UNUSED *close_data); -__DLL__ herr_t H5F_acs_close(hid_t fapl_id, void UNUSED *close_data); +__DLL__ herr_t H5F_acs_create(hid_t fapl_id, void *close_data); +__DLL__ herr_t H5F_acs_close(hid_t fapl_id, void *close_data); __DLL__ herr_t H5F_acs_copy(hid_t new_fapl_id, hid_t old_fapl_id, - void UNUSED *close_data); + void *close_data); #endif diff --git a/src/H5P.c b/src/H5P.c index 182cc6f..8c396d5 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -158,16 +158,13 @@ H5P_init_interface(void) { H5P_genclass_t *root_class; /* Pointer to root property list class created */ H5P_genclass_t *pclass; /* Pointer to property list class to create */ - herr_t ret_value = SUCCEED; - int i; - herr_t status; + herr_t ret_value = SUCCEED; FUNC_ENTER(H5P_init_interface, FAIL); - if (ret_value < 0) { - HRETURN_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, - "unable to initialize atom group"); - } + /* Make certain IDs are initialized */ + if (ret_value < 0) + HRETURN_ERROR(H5E_ATOM, H5E_CANTINIT, FAIL, "unable to initialize atom group"); /* * Initialize the Generic Property class & object groups. @@ -231,7 +228,6 @@ H5P_init_interface(void) if ((H5P_CLS_MOUNT_g = H5I_register (H5I_GENPROP_CLS, pclass))<0) HRETURN_ERROR (H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't register property list class"); - FUNC_LEAVE(ret_value); } @@ -255,7 +251,7 @@ H5P_init_interface(void) int H5P_term_interface(void) { - int i, n=0; + int n=0; if (interface_initialize_g) { /* Destroy HDF5 library property classes & lists */ diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 92df805..9385859 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -140,7 +140,6 @@ __DLL__ herr_t H5Pcopy_prop(hid_t dst_id, hid_t src_id, const char *name); __DLL__ herr_t H5Premove(hid_t plist_id, const char *name); __DLL__ herr_t H5Punregister(hid_t pclass_id, const char *name); __DLL__ herr_t H5Pclose_class(hid_t plist_id); -__DLL__ hid_t H5Pcreate(hid_t type); __DLL__ herr_t H5Pclose(hid_t plist_id); __DLL__ hid_t H5Pcopy(hid_t plist_id); __DLL__ herr_t H5Pget_version(hid_t plist_id, int *boot/*out*/, diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 4d31903..d355c47 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -449,7 +449,7 @@ herr_t H5T_vlen_disk_read(H5F_t *f, void *vl_addr, void *buf, size_t UNUSED len) * *------------------------------------------------------------------------- */ -herr_t H5T_vlen_disk_write(hid_t plist_id, H5F_t *f, void *vl_addr, void *buf, hsize_t seq_len, hsize_t base_size) +herr_t H5T_vlen_disk_write(hid_t UNUSED plist_id, H5F_t *f, void *vl_addr, void *buf, hsize_t seq_len, hsize_t base_size) { uint8_t *vl=(uint8_t *)vl_addr; /* Pointer to the user's hvl_t information */ H5HG_t hobjid; diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h index 37143ff..063d92a 100644 --- a/src/H5Vprivate.h +++ b/src/H5Vprivate.h @@ -95,10 +95,10 @@ __DLL__ hsize_t H5V_array_offset(unsigned n, const hsize_t *total_size, * *------------------------------------------------------------------------- */ -static H5_inline hsize_t UNUSED +static H5_inline hsize_t H5V_vector_reduce_product(unsigned n, const hsize_t *v) { - size_t ans = 1; + hsize_t ans = 1; if (n && !v) return 0; while (n--) ans *= *v++; diff --git a/test/tfile.c b/test/tfile.c index d3d5b87..b75fa96 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -63,7 +63,8 @@ test_file_create(void) hsize_t ublock; /*sizeof userblock */ size_t parm; /*file-creation parameters */ size_t parm2; /*file-creation parameters */ - int iparm, iparm2; + int iparm; + unsigned iparm2; herr_t ret; /*generic return value */ /* Output message about test being performed */ @@ -295,7 +296,8 @@ test_file_open(void) hsize_t ublock; /*sizeof user block */ size_t parm; /*file-creation parameters */ size_t parm2; /*file-creation parameters */ - int iparm, iparm2; + int iparm; + unsigned iparm2; herr_t ret; /*generic return value */ /* Output message about test being performed */ -- cgit v0.12