From ec1b0dfda6ac7049f1eeb32fbb93ebd92ccfd342 Mon Sep 17 00:00:00 2001 From: James Laird Date: Fri, 5 Jan 2007 12:59:04 -0500 Subject: [svn-r13108] Cleaned up some warnings. Tested on kagiso; I have another checkin coming, after which I'll run more extensive tests. Changes are pretty minor. --- hl/src/H5PT.c | 5 ++++ hl/test/test_packet.c | 2 ++ src/H5Pfcpl.c | 72 --------------------------------------------------- src/H5SMtest.c | 2 +- test/objcopy.c | 10 +++---- test/tsohm.c | 58 +++++++++++++++++++++++++---------------- 6 files changed, 49 insertions(+), 100 deletions(-) diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c index d1bb1fc..cf400a1 100644 --- a/hl/src/H5PT.c +++ b/hl/src/H5PT.c @@ -148,6 +148,7 @@ hid_t H5PTcreate_fl ( hid_t loc_id, return H5I_INVALID_HID; } +#ifdef H5_VLPT_ENABLED /*------------------------------------------------------------------------- * Function: H5PTcreate_vl * @@ -195,6 +196,7 @@ out: H5PTclose(ret_value); return H5I_BADID; } +#endif /* H%_VLPT_ENABLED */ /*------------------------------------------------------------------------- * Function: H5PTopen @@ -713,6 +715,7 @@ herr_t H5PTis_valid(hid_t table_id) return 0; } +#ifdef H5_VLPT_ENABLED /*------------------------------------------------------------------------- * Function: H5PTis_varlen * @@ -815,3 +818,5 @@ out: H5E_END_TRY return -1; } + +#endif /* H5_VLPT_ENABLED */ diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index 3445163..4268a08 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -63,6 +63,8 @@ static particle_t testPart[NRECORDS] = { /*------------------------------------------------------------------------- * function that compares one particle + * Comparing floating point should be safe here; HDF5 should store the + * fields verbatim and not lose any bits. -JML *------------------------------------------------------------------------- */ static int cmp_par(size_t i, size_t j, particle_t *rbuf, particle_t *wbuf ) diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index 1b49360..35171e6 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -683,78 +683,6 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pset_shared_mesgs - * - * Purpose: Configure implicity shared object header message settings - * for this file. - * - * NINDEXES is the number of indexes for this file; it should - * be between 0 and H5SM_MAX_NINDEXES. If nindexes is 0, - * SOHMs will be disabled for this file. - * - * MESG_TYPE_FLAGS is an array of message type flags (using - * the values defined in H5SMpublic.h) with NINDEXES entries. - * These flags determine which types of message are stored in - * which index. Any types of message that are not assigned - * to an index will not be shared in this file. Each message - * type should be assigned to only one index, though each - * index can store more than one type of message. - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: James Laird - * Wednesday, April 5, 2006 - * - *------------------------------------------------------------------------- - */ -herr_t -H5Pset_shared_mesgs(hid_t plist_id, unsigned nindexes, const unsigned mesg_type_flags[]) -{ - unsigned i; - unsigned type_flags[H5SM_MAX_NINDEXES]; /* Full-sized array */ - H5P_genplist_t *plist; /* Property list pointer */ - unsigned flags_used; /* type flags already specified. - * Used to make sure a flag isn't used twice. - */ - herr_t ret_value = SUCCEED; /* return value */ - - FUNC_ENTER_API(H5Pset_shared_mesgs, FAIL) - H5TRACE3("e", "iIu*Iu", plist_id, nindexes, mesg_type_flags); - - /* Check arguments */ - if(nindexes > H5SM_MAX_NINDEXES) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "number of indexes is too large"); - if(nindexes > 0 && !mesg_type_flags) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no type flags specified"); - - /* Get the plist structure */ - if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE))) - HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - - flags_used = H5O_MESG_NONE_FLAG; - for(i = 0; i < nindexes; i++) { - if(mesg_type_flags[i] == H5O_MESG_NONE_FLAG) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "at least one flag must be set"); - if(mesg_type_flags[i] != (mesg_type_flags[i] & H5O_MESG_ALL_FLAG)) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid mesg type flag set"); - if(mesg_type_flags[i] & flags_used) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "flag set for two different indexes"); - type_flags[i] = mesg_type_flags[i]; /* Store message types dimensions */ - flags_used |= mesg_type_flags[i]; /* Make sure the user doesn't re-use a flag */ - } /* end for */ - - /* Set properties in property list */ - if(H5P_set(plist, H5F_CRT_SHMSG_NINDEXES_NAME, &nindexes) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set number of SOHM indexes"); - if(H5P_set(plist, H5F_CRT_SHMSG_INDEX_TYPES_NAME, type_flags) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set type flags for indexes"); - -done: - FUNC_LEAVE_API(ret_value) -} /* end H5Pset_shared_mesgs() */ - - -/*------------------------------------------------------------------------- * Function: H5Pset_shared_mesg_nindexes * * Purpose: Set the number of Shared Object Header Message (SOHM) diff --git a/src/H5SMtest.c b/src/H5SMtest.c index 03526bb..d2ca5d3 100644 --- a/src/H5SMtest.c +++ b/src/H5SMtest.c @@ -114,7 +114,7 @@ H5SM_get_refcount_test(H5F_t *f, hid_t dxpl_id, unsigned type_id, H5HF_t *fheap = NULL; /* Fractal heap that contains shared messages */ H5SM_master_table_t *table = NULL; /* SOHM master table */ H5SM_list_t *list = NULL; /* SOHM index list for message type (if in list form) */ - H5SM_index_header_t *header; /* Index header for message type */ + H5SM_index_header_t *header=NULL; /* Index header for message type */ H5SM_mesg_key_t key; /* Key for looking up message */ H5SM_fh_ud_gh_t udata; /* User data for fractal heap 'op' callback */ H5SM_sohm_t message; /* Record for shared message */ diff --git a/test/objcopy.c b/test/objcopy.c index 767535a..f321a25 100755 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -5448,7 +5448,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_same_file_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_same_file_named_datatype(hid_t fcpl_src, hid_t fapl) { hid_t fid = -1; /* File ID */ hid_t tid = -1, tid2 = -1; /* Datatype IDs */ @@ -5463,7 +5463,7 @@ test_copy_same_file_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) addr_reset(); /* create source file */ - if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_src, fapl)) < 0) TEST_ERROR /* create datatype */ if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR @@ -5521,7 +5521,7 @@ error: *------------------------------------------------------------------------- */ static int -test_copy_old_layout(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) +test_copy_old_layout(hid_t fcpl_dst, hid_t fapl) { hid_t fid_src = -1, fid_dst = -1; /* File IDs */ hid_t did = -1, did2 = -1; /* Dataset IDs */ @@ -7196,8 +7196,8 @@ main(void) #endif /* H5_CANNOT_OPEN_TWICE */ nerrors += test_copy_exist(fcpl_src, fcpl_dst, my_fapl); nerrors += test_copy_path(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_same_file_named_datatype(fcpl_src, fcpl_dst, my_fapl); - nerrors += test_copy_old_layout(fcpl_src, fcpl_dst, my_fapl); + nerrors += test_copy_same_file_named_datatype(fcpl_src, my_fapl); + nerrors += test_copy_old_layout(fcpl_dst, my_fapl); nerrors += test_copy_option(fcpl_src, fcpl_dst, my_fapl, H5O_COPY_WITHOUT_ATTR_FLAG, FALSE, "H5Ocopy(): without attributes"); nerrors += test_copy_option(fcpl_src, fcpl_dst, my_fapl, 0, TRUE, "H5Ocopy(): with missing groups"); nerrors += test_copy_option(fcpl_src, fcpl_dst, my_fapl, H5O_COPY_EXPAND_SOFT_LINK_FLAG, FALSE, "H5Ocopy(): expand soft link"); diff --git a/test/tsohm.c b/test/tsohm.c index e38cbbd..a6e38ad 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -143,6 +143,18 @@ typedef struct size2_helper_struct { #define HALF_DELETE_NUM_MESGS 3 #define DELETE_DIMS {1,1,1,1,1,1,1} +/* Helper function prototypes */ +static hid_t make_dtype_1(void); +static hid_t make_dtype_2(void); +static hid_t close_reopen_file(hid_t file, const char* filename); +static void test_sohm_attrs(void); +static void size2_verify(void); +static void test_sohm_delete(void); +static void test_sohm_delete_revert(void); +static void test_sohm_extlink(void); + + + /**************************************************************** ** ** check_fcpl_values(): Helper function for test_sohm_fcpl. @@ -390,13 +402,13 @@ static void test_sohm_fcpl(void) * *------------------------------------------------------------------------- */ -hid_t -make_dtype_1() +static hid_t +make_dtype_1(void) { hid_t dtype1_id = -1; hid_t str_id = -1; - /* Create compound datatype. If the user asked for it, check hash value at each step */ + /* Create compound datatype. */ if((dtype1_id = H5Tcreate( H5T_COMPOUND, sizeof(struct dtype1_struct)))<0) TEST_ERROR if(H5Tinsert(dtype1_id,"i1",HOFFSET(struct dtype1_struct,i1),H5T_NATIVE_INT)<0) TEST_ERROR @@ -433,10 +445,6 @@ error: * shared object header messages. The important thing is that * the datatypes must take a lot of space to store on disk. * - * If record_hash is true, uses fid to record hash values - * of the intermediate datatypes in the global hash history - * table. Otherwise, fid is ignored. - * * Return: Success: datatype ID (should be closed by calling function) * Failure: negative * @@ -447,8 +455,8 @@ error: * *------------------------------------------------------------------------- */ -hid_t -make_dtype_2() +static hid_t +make_dtype_2(void) { hid_t dtype2_id = -1; hid_t enum_id= -1; @@ -512,7 +520,7 @@ error: * *------------------------------------------------------------------------- */ -hid_t +static hid_t close_reopen_file(hid_t file, const char* filename) { if(H5Fclose(file) < 0) goto error; @@ -544,13 +552,15 @@ error: *------------------------------------------------------------------------- */ static hid_t -size1_helper(hid_t file, char* filename, int test_file_closing) +size1_helper(hid_t file, const char* filename, int test_file_closing) { dtype1_struct wdata = {11, "string", 22, 33, 44, 55, 66, 77, 88, 0.0}; dtype1_struct rdata; - hid_t dtype1_id, dup_tid, type_id; - hid_t space_id; - hid_t dset_id; + hid_t dtype1_id = -1; + hid_t dup_tid = -1; + hid_t type_id = -1; + hid_t space_id = -1; + hid_t dset_id = -1; hsize_t dim1[1]; int x; @@ -1045,7 +1055,7 @@ static void sohm_attr_helper(hid_t fcpl_id) * *------------------------------------------------------------------------- */ -static void test_sohm_attrs() +static void test_sohm_attrs(void) { hid_t fcpl_id; herr_t ret; @@ -1290,7 +1300,8 @@ static void size2_verify_plist2(hid_t plist) * *------------------------------------------------------------------------- */ -static size2_helper_struct size2_helper(hid_t fcpl_id, int test_file_closing) +static size2_helper_struct +size2_helper(hid_t fcpl_id, int test_file_closing) { hid_t file_id = -1; hid_t dtype1_id=-1; @@ -1336,8 +1347,8 @@ static size2_helper_struct size2_helper(hid_t fcpl_id, int test_file_closing) /* Create two large datatype messages */ dtype1_id=make_dtype_1(); CHECK_I(dtype1_id, "make_dtype_1"); - dtype2_id=make_dtype_2(0, file_id); - CHECK_I(dtype2_id, "make_dtype_1"); + dtype2_id=make_dtype_2(); + CHECK_I(dtype2_id, "make_dtype_2"); /* Create some large dataspaces */ dspace1_id=H5Screate_simple(rank1, dims, dims); @@ -1667,7 +1678,7 @@ static size2_helper_struct size2_helper(hid_t fcpl_id, int test_file_closing) * *------------------------------------------------------------------------- */ -static void size2_verify() +static void size2_verify(void) { hid_t file_id = -1; hid_t dset_id=-1; @@ -2654,7 +2665,8 @@ static void delete_helper(hid_t fcpl_id, hid_t *dspace_id, hid_t *dcpl_id) * *------------------------------------------------------------------------- */ -static void test_sohm_delete() +static void +test_sohm_delete(void) { hid_t fcpl_id; /* We'll use dataspaces, filter pipelines, and attributes for this @@ -2878,7 +2890,8 @@ static void test_sohm_delete_revert_helper(hid_t fcpl_id) * *------------------------------------------------------------------------- */ -static void test_sohm_delete_revert() +static void +test_sohm_delete_revert(void) { hid_t fcpl_id; herr_t ret; @@ -3009,7 +3022,8 @@ static void test_sohm_extlink_helper(hid_t src_fcpl_id, hid_t dst_fcpl_id) * *------------------------------------------------------------------------- */ -static void test_sohm_extlink() +static void +test_sohm_extlink(void) { hid_t fcpl_id = -1; herr_t ret; -- cgit v0.12