From 2e333eef246daaa4651fbf423517b6f3b86f85c0 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 30 Oct 2006 15:00:57 -0500 Subject: [svn-r12829] Description: Clean up more compiler warnings, esp. on Linux/64 platform. Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2) --- test/tid.c | 18 +-- test/titerate.c | 32 ++--- test/tmisc.c | 104 +++++++-------- test/trefer.c | 26 ++-- test/tselect.c | 142 ++++++++++----------- test/tskiplist.c | 44 +++---- test/tunicode.c | 378 +++++++++++++++++++++++++++---------------------------- 7 files changed, 372 insertions(+), 372 deletions(-) diff --git a/test/tid.c b/test/tid.c index b9ed9c3..52ec8fc 100644 --- a/test/tid.c +++ b/test/tid.c @@ -71,7 +71,7 @@ static int basic_id_test(void) goto out; /* Register a type */ - myType = H5Iregister_type(64, 0, (H5I_free_t) free ); + myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); CHECK(myType, H5I_BADID, "H5Iregister_type"); if(myType == H5I_BADID) @@ -107,7 +107,7 @@ static int basic_id_test(void) goto out; H5E_BEGIN_TRY - testSize = H5Iget_name(arrayID, nameString, 9); + testSize = H5Iget_name(arrayID, nameString, (size_t)9); H5E_END_TRY VERIFY(testSize, -1, "H5Iget_name"); @@ -164,7 +164,7 @@ static int basic_id_test(void) H5E_END_TRY /* Register another type and another object in that type */ - myType = H5Iregister_type(64, 0, (H5I_free_t) free ); + myType = H5Iregister_type((size_t)64, 0, (H5I_free_t) free ); CHECK(myType, H5I_BADID, "H5Iregister_type"); if(myType == H5I_BADID) @@ -293,7 +293,7 @@ static int id_predefined_test(void ) goto out; /* Create a datatype ID and try to perform illegal functions on it */ - typeID = H5Tcreate(H5T_OPAQUE, 42); + typeID = H5Tcreate(H5T_OPAQUE, (size_t)42); CHECK(typeID, H5I_INVALID_HID, "H5Tcreate"); if(typeID == H5I_INVALID_HID) goto out; @@ -353,7 +353,7 @@ static int test_id_type_list(void) H5I_type_t testType; int i; /* Just a counter variable */ - startType = H5Iregister_type(8, 0, (H5I_free_t) free ); + startType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); CHECK(startType, H5I_BADID, "H5Iregister_type"); if(startType == H5I_BADID) goto out; @@ -368,7 +368,7 @@ static int test_id_type_list(void) /* Create types up to MAX_NUM_TYPES */ for(i = startType + 1; i < MAX_NUM_TYPES; i++) { - currentType = H5Iregister_type(8, 0, (H5I_free_t) free ); + currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); CHECK(currentType, H5I_BADID, "H5Iregister_type"); if(currentType == H5I_BADID) goto out; @@ -377,7 +377,7 @@ static int test_id_type_list(void) /* Wrap around to low type ID numbers */ for(i = H5I_NTYPES; i < startType; i++) { - currentType = H5Iregister_type(8, 0, (H5I_free_t) free ); + currentType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); CHECK(currentType, H5I_BADID, "H5Iregister_type"); if(currentType == H5I_BADID) goto out; @@ -385,7 +385,7 @@ static int test_id_type_list(void) /* There should be no room at the inn for a new ID type*/ H5E_BEGIN_TRY - testType = H5Iregister_type(8, 0, (H5I_free_t) free ); + testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); H5E_END_TRY VERIFY(testType, H5I_BADID, "H5Iregister_type"); @@ -394,7 +394,7 @@ static int test_id_type_list(void) /* Now delete a type and try to insert again */ H5Idestroy_type(H5I_NTYPES); - testType = H5Iregister_type(8, 0, (H5I_free_t) free ); + testType = H5Iregister_type((size_t)8, 0, (H5I_free_t) free ); VERIFY(testType, H5I_NTYPES, "H5Iregister_type"); if(testType != H5I_NTYPES) diff --git a/test/titerate.c b/test/titerate.c index 3241901..df77dea 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -164,7 +164,7 @@ static void test_iter_group(hid_t fapl, hbool_t new_format) /* Create a group and named datatype under root group for testing * H5Gget_objtype_by_idx. */ - grp = H5Gcreate(file, "grp", 0); + grp = H5Gcreate(file, "grp", (size_t)0); CHECK(ret, FAIL, "H5Gcreate"); lnames[NDATASETS] = HDstrdup("grp"); @@ -190,7 +190,7 @@ static void test_iter_group(hid_t fapl, hbool_t new_format) CHECK(ret, FAIL, "H5Fclose"); /* Sort the dataset names */ - HDqsort(lnames, NDATASETS + 2, sizeof(char *), iter_strcmp); + HDqsort(lnames, (size_t)(NDATASETS + 2), sizeof(char *), iter_strcmp); /* Iterate through the datasets in the root group in various ways */ @@ -211,7 +211,7 @@ static void test_iter_group(hid_t fapl, hbool_t new_format) for(i = 0; i< (int)num_membs; i++) { H5G_obj_t obj_type; /* Type of object in file */ - ret = (herr_t)H5Gget_objname_by_idx(root_group, (hsize_t)i, dataset_name, NAMELEN); + ret = (herr_t)H5Gget_objname_by_idx(root_group, (hsize_t)i, dataset_name, (size_t)NAMELEN); CHECK(ret, FAIL, "H5Gget_objname_by_idx"); obj_type = H5Gget_objtype_by_idx(root_group, (hsize_t)i); @@ -219,7 +219,7 @@ static void test_iter_group(hid_t fapl, hbool_t new_format) } /* end for */ H5E_BEGIN_TRY { - ret = (herr_t)H5Gget_objname_by_idx(root_group, (hsize_t)(NDATASETS+3), dataset_name, NAMELEN); + ret = (herr_t)H5Gget_objname_by_idx(root_group, (hsize_t)(NDATASETS+3), dataset_name, (size_t)NAMELEN); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Gget_objname_by_idx"); @@ -239,7 +239,7 @@ static void test_iter_group(hid_t fapl, hbool_t new_format) for(i = 0; i< (int)num_membs; i++) { H5G_obj_t obj_type; /* Type of object in file */ - ret = (herr_t)H5Gget_objname_by_idx(file, (hsize_t)i, dataset_name, NAMELEN); + ret = (herr_t)H5Gget_objname_by_idx(file, (hsize_t)i, dataset_name, (size_t)NAMELEN); CHECK(ret, FAIL, "H5Gget_objname_by_idx"); obj_type = H5Gget_objtype_by_idx(file, (hsize_t)i); @@ -247,7 +247,7 @@ static void test_iter_group(hid_t fapl, hbool_t new_format) } H5E_BEGIN_TRY { - ret = (herr_t)H5Gget_objname_by_idx(file, (hsize_t)(NDATASETS + 3), dataset_name, NAMELEN); + ret = (herr_t)H5Gget_objname_by_idx(file, (hsize_t)(NDATASETS + 3), dataset_name, (size_t)NAMELEN); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Gget_objname_by_idx"); } @@ -604,7 +604,7 @@ static void test_iter_group_large(hid_t fapl) names[i].type = H5G_GROUP; /* Create a group */ - group = H5Gcreate(file, gname, 0); + group = H5Gcreate(file, gname, (size_t)0); CHECK(group, FAIL, "H5Gcreate"); /* Close a group */ @@ -655,7 +655,7 @@ static void test_iter_group_large(hid_t fapl) CHECK(ret, FAIL, "H5Tclose"); /* Need to sort the names in the root group, cause that's what the library does */ - HDqsort(names, (ITER_NGROUPS + 2), sizeof(iter_info), iter_strcmp2); + HDqsort(names, (size_t)(ITER_NGROUPS + 2), sizeof(iter_info), iter_strcmp2); /* Iterate through the file to see members of the root group */ curr_name = &names[0]; @@ -723,7 +723,7 @@ static void test_grp_memb_funcs(hid_t fapl) /* Create a group and named datatype under root group for testing * H5Gget_objtype_by_idx. */ - grp = H5Gcreate(file, "grp", 0); + grp = H5Gcreate(file, "grp", (size_t)0); CHECK(ret, FAIL, "H5Gcreate"); dnames[NDATASETS] = HDstrdup("grp"); @@ -749,7 +749,7 @@ static void test_grp_memb_funcs(hid_t fapl) CHECK(ret, FAIL, "H5Fclose"); /* Sort the dataset names */ - HDqsort(dnames, (NDATASETS + 2), sizeof(char *), iter_strcmp); + HDqsort(dnames, (size_t)(NDATASETS + 2), sizeof(char *), iter_strcmp); /* Iterate through the datasets in the root group in various ways */ file = H5Fopen(DATAFILE, H5F_ACC_RDONLY, fapl); @@ -769,7 +769,7 @@ static void test_grp_memb_funcs(hid_t fapl) H5G_obj_t obj_type; /* Type of object in file */ /* Test with NULL for name, to query length */ - name_len = H5Gget_objname_by_idx(root_group, (hsize_t)i, NULL, NAMELEN); + name_len = H5Gget_objname_by_idx(root_group, (hsize_t)i, NULL, (size_t)NAMELEN); CHECK(name_len, FAIL, "H5Gget_objname_by_idx"); ret = (herr_t)H5Gget_objname_by_idx(root_group, (hsize_t)i, dataset_name, (size_t)(name_len + 1)); @@ -794,12 +794,12 @@ static void test_grp_memb_funcs(hid_t fapl) } /* end for */ H5E_BEGIN_TRY { - ret = (herr_t)H5Gget_objname_by_idx(root_group, (hsize_t)(NDATASETS+3), dataset_name, NAMELEN); + ret = (herr_t)H5Gget_objname_by_idx(root_group, (hsize_t)(NDATASETS+3), dataset_name, (size_t)NAMELEN); } H5E_END_TRY; VERIFY(ret, FAIL, "H5Gget_objname_by_idx"); /* Sort the dataset names */ - HDqsort(obj_names, (NDATASETS + 2), sizeof(char *), iter_strcmp); + HDqsort(obj_names, (size_t)(NDATASETS + 2), sizeof(char *), iter_strcmp); /* Compare object names */ for(i = 0; i< (int)num_membs; i++) { @@ -845,10 +845,10 @@ static void test_links(hid_t fapl) CHECK(file, FAIL, "H5Fcreate"); /* create groups */ - gid = H5Gcreate (file, "/g1", 0); + gid = H5Gcreate(file, "/g1", (size_t)0); CHECK(gid, FAIL, "H5Gcreate"); - gid1 = H5Gcreate (file, "/g1/g1.1", 0); + gid1 = H5Gcreate(file, "/g1/g1.1", (size_t)0); CHECK(gid1, FAIL, "H5Gcreate"); /* create soft and hard links to the group "/g1". */ @@ -865,7 +865,7 @@ static void test_links(hid_t fapl) /* Test these two functions, H5Gget_num_objs and H5Gget_objname_by_idx */ for(i = 0; i < nobjs; i++) { /* Get object name */ - name_len = H5Gget_objname_by_idx(gid, i, obj_name, NAMELEN); + name_len = H5Gget_objname_by_idx(gid, i, obj_name, (size_t)NAMELEN); CHECK(name_len, FAIL, "H5Gget_objname_by_idx"); obj_type = H5Gget_objtype_by_idx(gid, i); diff --git a/test/tmisc.c b/test/tmisc.c index db1605e..8bb3374 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -375,13 +375,13 @@ static hid_t misc2_create_type(void) type_tmp = H5Tcopy (H5T_C_S1); CHECK(type_tmp, FAIL, "H5Tcopy"); - ret = H5Tset_size (type_tmp, H5T_VARIABLE); + ret = H5Tset_size(type_tmp, H5T_VARIABLE); CHECK(ret, FAIL, "H5Tset_size"); - type = H5Tcreate (H5T_COMPOUND, sizeof(misc2_struct)); + type = H5Tcreate(H5T_COMPOUND, sizeof(misc2_struct)); CHECK(type, FAIL, "H5Tcreate"); - ret = H5Tinsert (type, "string", offsetof(misc2_struct, string), type_tmp); + ret = H5Tinsert(type, "string", offsetof(misc2_struct, string), type_tmp); CHECK(ret, FAIL, "H5Tinsert"); ret = H5Tclose(type_tmp); @@ -615,18 +615,18 @@ test_misc4(void) CHECK(file1, FAIL, "H5Fcreate"); /* Create the first group */ - group1 = H5Gcreate(file1, MISC4_GROUP_1, 0); + group1 = H5Gcreate(file1, MISC4_GROUP_1, (size_t)0); CHECK(group1, FAIL, "H5Gcreate"); /* Create the second group */ - group2 = H5Gcreate(file1, MISC4_GROUP_2, 0); + group2 = H5Gcreate(file1, MISC4_GROUP_2, (size_t)0); CHECK(group2, FAIL, "H5Gcreate"); file2 = H5Fcreate(MISC4_FILE_2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(file2, FAIL, "H5Fcreate"); /* Create the first group */ - group3 = H5Gcreate(file2, MISC4_GROUP_1, 0); + group3 = H5Gcreate(file2, MISC4_GROUP_1, (size_t)0); CHECK(group3, FAIL, "H5Gcreate"); /* Get the stat information for each group */ @@ -677,13 +677,13 @@ create_struct3(void) misc5_struct3_hndl *str3hndl; /* New 'struct3' created */ herr_t ret; /* For error checking */ - str3hndl=malloc(sizeof(misc5_struct3_hndl)); + str3hndl = HDmalloc(sizeof(misc5_struct3_hndl)); CHECK(str3hndl,NULL,"malloc"); - str3hndl->st3h_base=H5Tcreate( H5T_COMPOUND, sizeof(misc5_struct3)); - CHECK(str3hndl->st3h_base,FAIL,"H5Tcreate"); + str3hndl->st3h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct3)); + CHECK(str3hndl->st3h_base, FAIL, "H5Tcreate"); - ret=H5Tinsert(str3hndl->st3h_base, "st3_el1", HOFFSET( misc5_struct3, st3_el1), H5T_NATIVE_INT); + ret = H5Tinsert(str3hndl->st3h_base, "st3_el1", HOFFSET( misc5_struct3, st3_el1), H5T_NATIVE_INT); CHECK(ret,FAIL,"H5Tinsert"); str3hndl->st3h_id=H5Tvlen_create(str3hndl->st3h_base); @@ -720,14 +720,14 @@ create_struct2(void) misc5_struct2_hndl *str2hndl; /* New 'struct2' created */ herr_t ret; /* For error checking */ - str2hndl=malloc(sizeof(misc5_struct2_hndl)); - CHECK(str2hndl,NULL,"malloc"); + str2hndl = HDmalloc(sizeof(misc5_struct2_hndl)); + CHECK(str2hndl, NULL, "malloc"); - str2hndl->st2h_base=H5Tcreate( H5T_COMPOUND, sizeof(misc5_struct2)); - CHECK(str2hndl->st2h_base,FAIL,"H5Tcreate"); + str2hndl->st2h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct2)); + CHECK(str2hndl->st2h_base, FAIL, "H5Tcreate"); - ret=H5Tinsert(str2hndl->st2h_base, "st2_el1", HOFFSET( misc5_struct2, st2_el1), H5T_NATIVE_INT); - CHECK(ret,FAIL,"H5Tinsert"); + ret = H5Tinsert(str2hndl->st2h_base, "st2_el1", HOFFSET(misc5_struct2, st2_el1), H5T_NATIVE_INT); + CHECK(ret, FAIL, "H5Tinsert"); str2hndl->st2h_st3hndl=create_struct3(); CHECK(str2hndl->st2h_st3hndl,NULL,"create_struct3"); @@ -786,14 +786,14 @@ create_struct1(void) misc5_struct1_hndl *str1hndl; /* New 'struct1' created */ herr_t ret; /* For error checking */ - str1hndl=malloc(sizeof(misc5_struct1_hndl)); - CHECK(str1hndl,NULL,"malloc"); + str1hndl = HDmalloc(sizeof(misc5_struct1_hndl)); + CHECK(str1hndl, NULL, "malloc"); - str1hndl->st1h_base=H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct1)); - CHECK(str1hndl->st1h_base,FAIL,"H5Tcreate"); + str1hndl->st1h_base = H5Tcreate(H5T_COMPOUND, sizeof(misc5_struct1)); + CHECK(str1hndl->st1h_base, FAIL, "H5Tcreate"); - ret=H5Tinsert(str1hndl->st1h_base, "st1_el1", HOFFSET(misc5_struct1, st1_el1), H5T_NATIVE_INT); - CHECK(ret,FAIL,"H5Tinsert"); + ret = H5Tinsert(str1hndl->st1h_base, "st1_el1", HOFFSET(misc5_struct1, st1_el1), H5T_NATIVE_INT); + CHECK(ret, FAIL, "H5Tinsert"); str1hndl->st1h_st2hndl=create_struct2(); CHECK(str1hndl->st1h_st2hndl,NULL,"create_struct2"); @@ -1100,8 +1100,8 @@ test_misc7(void) CHECK(sid,FAIL,"H5Screate"); /* Create the compound datatype to commit*/ - tid=H5Tcreate(H5T_COMPOUND,32); - CHECK(tid,FAIL,"H5Tcreate"); + tid = H5Tcreate(H5T_COMPOUND, (size_t)32); + CHECK(tid, FAIL, "H5Tcreate"); /* Attempt to commit an empty compound datatype */ ret=H5Tcommit(fid,MISC7_TYPENAME1,tid); @@ -1112,8 +1112,8 @@ test_misc7(void) VERIFY(ret,FAIL,"H5Dcreate"); /* Add a field to the compound datatype */ - ret=H5Tinsert(tid,"a",0,H5T_NATIVE_INT); - CHECK(ret,FAIL,"H5Tinsert"); + ret = H5Tinsert(tid, "a", (size_t)0, H5T_NATIVE_INT); + CHECK(ret, FAIL, "H5Tinsert"); /* Attempt to commit the compound datatype now - should work */ ret=H5Tcommit(fid,MISC7_TYPENAME1,tid); @@ -1673,7 +1673,7 @@ test_misc9(void) fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(fapl, FAIL, "H5Pcreate"); - ret=H5Pset_fapl_core(fapl, 1024, 0); + ret = H5Pset_fapl_core(fapl, (size_t)1024, 0); CHECK(ret, FAIL, "H5Pset_fapl_core"); fid = H5Fopen(MISC9_FILE, H5F_ACC_RDWR, fapl); @@ -1826,7 +1826,7 @@ test_misc11(void) ret=H5Pset_userblock(fcpl,(hsize_t)MISC11_USERBLOCK); CHECK(ret, FAIL, "H5Pset_userblock"); - ret=H5Pset_sizes(fcpl,MISC11_SIZEOF_OFF,MISC11_SIZEOF_LEN); + ret = H5Pset_sizes(fcpl, (size_t)MISC11_SIZEOF_OFF, (size_t)MISC11_SIZEOF_LEN); CHECK(ret, FAIL, "H5Pset_sizes"); ret=H5Pset_sym_k(fcpl,MISC11_SYM_IK,MISC11_SYM_LK); @@ -1964,13 +1964,13 @@ test_misc12(void) CHECK(sid1, FAIL, "H5Screate_simple"); /* Create a datatype to refer to */ - tid1 = H5Tcopy (H5T_C_S1); + tid1 = H5Tcopy(H5T_C_S1); CHECK(tid1, FAIL, "H5Tcopy"); - ret = H5Tset_size (tid1,H5T_VARIABLE); + ret = H5Tset_size(tid1, H5T_VARIABLE); CHECK(ret, FAIL, "H5Tset_size"); - cparms = H5Pcreate (H5P_DATASET_CREATE); + cparms = H5Pcreate(H5P_DATASET_CREATE); CHECK(cparms, FAIL, "H5Pcreate"); ret = H5Pset_chunk ( cparms, 1, chkdims1); @@ -2160,11 +2160,11 @@ create_hdf_file(const char *name) CHECK(ret, FAIL, "H5Tclose"); /* Create a group in the root group */ - gid = H5Gcreate(fid, MISC13_GROUP1_NAME, 0); + gid = H5Gcreate(fid, MISC13_GROUP1_NAME, (size_t)0); CHECK(gid, FAIL, "H5Gcreate"); /* Create another group in the new group */ - gid2 = H5Gcreate(gid, MISC13_GROUP2_NAME, 0); + gid2 = H5Gcreate(gid, MISC13_GROUP2_NAME, (size_t)0); CHECK(gid2, FAIL, "H5Gcreate"); /* Close the second group */ @@ -2214,7 +2214,7 @@ insert_user_block(const char *old_name, const char *new_name,const char *str,siz int ret; /* Generic status value */ /* Allocate space for the user block */ - user_block=HDcalloc(size,1); + user_block = HDcalloc(size, (size_t)1); CHECK(user_block, NULL, "HDcalloc"); /* Copy in the user block data */ @@ -2225,7 +2225,7 @@ insert_user_block(const char *old_name, const char *new_name,const char *str,siz CHECK(new_fp, NULL, "HDfopen"); /* Write the user block to the new file */ - written=HDfwrite(user_block,1,size,new_fp); + written = HDfwrite(user_block, (size_t)1, size, new_fp); VERIFY(written, size, "HDfwrite"); /* Open the old file */ @@ -2233,13 +2233,13 @@ insert_user_block(const char *old_name, const char *new_name,const char *str,siz CHECK(old_fp, NULL, "HDfopen"); /* Allocate space for the copy buffer */ - copy_buf=malloc(MISC13_COPY_BUF_SIZE); + copy_buf = HDmalloc((size_t)MISC13_COPY_BUF_SIZE); CHECK(copy_buf, NULL, "HDmalloc"); /* Copy data from the old file to the new file */ - while((read_in=fread(copy_buf,1,MISC13_COPY_BUF_SIZE,old_fp))>0) { + while((read_in = HDfread(copy_buf, (size_t)1, (size_t)MISC13_COPY_BUF_SIZE, old_fp)) > 0) { /* Write the data to the new file */ - written=fwrite(copy_buf,1,read_in,new_fp); + written = HDfwrite(copy_buf, (size_t)1, read_in, new_fp); VERIFY(written, read_in, "HDfwrite"); } /* end while */ @@ -2383,7 +2383,7 @@ test_misc13(void) verify_file(MISC13_FILE_1,(hsize_t)0,0); /* Create a new file by inserting a user block in front of the first file */ - insert_user_block(MISC13_FILE_1,MISC13_FILE_2,"Test String",MISC13_USERBLOCK_SIZE); + insert_user_block(MISC13_FILE_1, MISC13_FILE_2, "Test String", (size_t)MISC13_USERBLOCK_SIZE); /* Verify file contents are still correct */ verify_file(MISC13_FILE_2,(hsize_t)MISC13_USERBLOCK_SIZE,0); @@ -2684,13 +2684,13 @@ test_misc16(void) CHECK(sid, FAIL, "H5Screate_simple"); /* Create a datatype to refer to */ - tid = H5Tcopy (H5T_C_S1); + tid = H5Tcopy(H5T_C_S1); CHECK(tid, FAIL, "H5Tcopy"); - ret = H5Tset_size (tid,MISC16_STR_SIZE); + ret = H5Tset_size(tid, (size_t)MISC16_STR_SIZE); CHECK(ret, FAIL, "H5Tset_size"); - /*ret = H5Tset_strpad (tid,H5T_STR_NULLPAD); + /*ret = H5Tset_strpad(tid,H5T_STR_NULLPAD); CHECK(ret, FAIL, "H5Tset_strpad");*/ /* Create a dataset */ @@ -3062,7 +3062,7 @@ test_misc19(void) /* Check H5I operations on datatypes */ /* Create a datatype */ - tid = H5Tcreate(H5T_OPAQUE,16); + tid = H5Tcreate(H5T_OPAQUE, (size_t)16); CHECK(tid, FAIL, "H5Tcreate"); /* Check the reference count */ @@ -3234,7 +3234,7 @@ test_misc19(void) CHECK(fid, FAIL, "H5Fcreate"); /* Create a group */ - gid = H5Gcreate(fid,MISC19_GROUP_NAME,0); + gid = H5Gcreate(fid, MISC19_GROUP_NAME, (size_t)0); CHECK(gid, FAIL, "H5Gcreate"); /* Check the reference count */ @@ -3792,7 +3792,7 @@ test_misc23(void) /* Build some infrastructure */ - group_id = H5Gcreate(file_id, "/A", 0); + group_id = H5Gcreate(file_id, "/A", (size_t)0); CHECK(group_id, FAIL, "H5Gcreate"); space_id = H5Screate_simple(1, dims, NULL); @@ -3807,12 +3807,12 @@ test_misc23(void) **********************************************************************/ H5E_BEGIN_TRY { - tmp_id = H5Gcreate(file_id, "/A/B00a/grp", 0); + tmp_id = H5Gcreate(file_id, "/A/B00a/grp", (size_t)0); } H5E_END_TRY; VERIFY(tmp_id, FAIL, "H5Gcreate"); - tmp_id = H5Gcreate(file_id, "/A/grp", 0); + tmp_id = H5Gcreate(file_id, "/A/grp", (size_t)0); CHECK(tmp_id, FAIL, "H5Gcreate"); status = H5Gclose(tmp_id); @@ -4349,7 +4349,7 @@ test_misc25a(void) /* Create dataype for attribute */ tid = H5Tcopy(H5T_C_S1); CHECK(tid, FAIL, "H5Tcopy"); - ret = H5Tset_size(tid, MISC25A_ATTR1_LEN); + ret = H5Tset_size(tid, (size_t)MISC25A_ATTR1_LEN); CHECK(ret, FAIL, "H5Tset_size"); /* Add 1st attribute on first group */ @@ -4375,7 +4375,7 @@ test_misc25a(void) /* Create dataype for attribute */ tid = H5Tcopy(H5T_C_S1); CHECK(tid, FAIL, "H5Tcopy"); - ret = H5Tset_size(tid, MISC25A_ATTR2_LEN); + ret = H5Tset_size(tid, (size_t)MISC25A_ATTR2_LEN); CHECK(ret, FAIL, "H5Tset_size"); /* Add 2nd attribute on first group */ @@ -4448,7 +4448,7 @@ test_misc25a(void) /* Create dataype for attribute */ tid = H5Tcopy(H5T_C_S1); CHECK(tid, FAIL, "H5Tcopy"); - ret = H5Tset_size(tid, MISC25A_ATTR3_LEN); + ret = H5Tset_size(tid, (size_t)MISC25A_ATTR3_LEN); CHECK(ret, FAIL, "H5Tset_size"); /* Add 3rd attribute on first group (smaller than 2nd attribute) */ @@ -4496,7 +4496,7 @@ test_misc25a(void) /* Create dataype for attribute */ tid = H5Tcopy(H5T_C_S1); CHECK(tid, FAIL, "H5Tcopy"); - ret = H5Tset_size(tid, MISC25A_ATTR2_LEN); + ret = H5Tset_size(tid, (size_t)MISC25A_ATTR2_LEN); CHECK(ret, FAIL, "H5Tset_size"); /* Re-create 2nd attribute on first group */ @@ -4560,7 +4560,7 @@ test_misc25a(void) /* Create dataype for attribute */ tid = H5Tcopy(H5T_C_S1); CHECK(tid, FAIL, "H5Tcopy"); - ret = H5Tset_size(tid, MISC25A_ATTR2_LEN); + ret = H5Tset_size(tid, (size_t)MISC25A_ATTR2_LEN); CHECK(ret, FAIL, "H5Tset_size"); /* Re-create 2nd attribute on first group */ diff --git a/test/trefer.c b/test/trefer.c index 614539f..24911be 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -243,11 +243,11 @@ test_reference_obj(void) CHECK(group, FAIL, "H5Rdereference"); /* Get group's comment */ - ret=H5Gget_comment(group,".",10,read_comment); + ret = H5Gget_comment(group, ".", (size_t)10, read_comment); CHECK(ret, FAIL, "H5Gget_comment"); /* Check for correct comment value */ - if(HDstrcmp(write_comment,read_comment)!=0) + if(HDstrcmp(write_comment, read_comment) != 0) TestErrPrintf("Error! Incorrect group comment, wanted: %s, got: %s\n",write_comment,read_comment); /* Close group */ @@ -323,10 +323,10 @@ test_reference_region(void) MESSAGE(5, ("Testing Dataset Region Reference Functions\n")); /* Allocate write & read buffers */ - wbuf=calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf=malloc(sizeof(hdset_reg_ref_t)*SPACE1_DIM1); - dwbuf=malloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); - drbuf=calloc(sizeof(uint8_t),SPACE2_DIM1*SPACE2_DIM2); + wbuf = HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); + rbuf = HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + dwbuf = HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + drbuf = HDcalloc(sizeof(uint8_t),(size_t)(SPACE2_DIM1 * SPACE2_DIM2)); /* Create file */ fid1 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -389,7 +389,7 @@ test_reference_region(void) coord1[7][0]=9; coord1[7][1]=0; coord1[8][0]=7; coord1[8][1]=1; coord1[9][0]=3; coord1[9][1]=3; - ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord1); + ret = H5Sselect_elements(sid2, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t **)coord1); CHECK(ret, FAIL, "H5Sselect_elements"); ret = (int)H5Sget_select_npoints(sid2); @@ -584,10 +584,10 @@ test_reference_region_1D(void) MESSAGE(5, ("Testing 1-D Dataset Region Reference Functions\n")); /* Allocate write & read buffers */ - wbuf=calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); - rbuf=malloc(sizeof(hdset_reg_ref_t)*SPACE1_DIM1); - dwbuf=malloc(sizeof(uint8_t)*SPACE3_DIM1); - drbuf=calloc(sizeof(uint8_t),SPACE3_DIM1); + wbuf = HDcalloc(sizeof(hdset_reg_ref_t), (size_t)SPACE1_DIM1); + rbuf = HDmalloc(sizeof(hdset_reg_ref_t) * SPACE1_DIM1); + dwbuf = HDmalloc(sizeof(uint8_t) * SPACE3_DIM1); + drbuf = HDcalloc(sizeof(uint8_t), (size_t)SPACE3_DIM1); /* Create file */ fid1 = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -650,7 +650,7 @@ test_reference_region_1D(void) coord1[7][0]=89; coord1[8][0]=97; coord1[9][0]=03; - ret = H5Sselect_elements(sid3,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord1); + ret = H5Sselect_elements(sid3, H5S_SELECT_SET, (size_t)POINT1_NPOINTS, (const hsize_t **)coord1); CHECK(ret, FAIL, "H5Sselect_elements"); ret = (int)H5Sget_select_npoints(sid3); @@ -1054,7 +1054,7 @@ test_reference_group(void) VERIFY(nobjs, 3, "H5Gget_num_objs"); - ret = H5Gget_objname_by_idx(gid, (hsize_t)0, objname, NAME_SIZE); + ret = H5Gget_objname_by_idx(gid, (hsize_t)0, objname, (size_t)NAME_SIZE); CHECK(ret, FAIL, "H5Gget_objname_by_idx"); VERIFY_STR(objname, DSETNAME2, "H5Gget_objname_by_idx"); diff --git a/test/tselect.c b/test/tselect.c index 030d8b7..43299cc 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -221,8 +221,8 @@ test_select_hyper(hid_t xfer_plist) MESSAGE(5, ("Testing Hyperslab Selection Functions\n")); /* Allocate write & read buffers */ - wbuf=malloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); - rbuf=calloc(sizeof(uint8_t),SPACE3_DIM1*SPACE3_DIM2); + wbuf = HDmalloc(sizeof(uint8_t) * SPACE2_DIM1 * SPACE2_DIM2); + rbuf = HDcalloc(sizeof(uint8_t), (size_t)(SPACE3_DIM1 * SPACE3_DIM2)); /* Initialize write buffer */ for(i=0, tbuf=wbuf; i