summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-10-30 15:58:46 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-10-30 15:58:46 (GMT)
commit25f3bf9011ad0876998a1db37f21eb7a214b93d4 (patch)
tree912ed6ade37d6b190b6e2b989125e331ba43e27b /test
parent87411d7b2d845d52bdbde7fcc473220c22936a47 (diff)
downloadhdf5-25f3bf9011ad0876998a1db37f21eb7a214b93d4.zip
hdf5-25f3bf9011ad0876998a1db37f21eb7a214b93d4.tar.gz
hdf5-25f3bf9011ad0876998a1db37f21eb7a214b93d4.tar.bz2
[svn-r12828] Description:
Clean up compiler warnings... Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'test')
-rw-r--r--test/cache_common.c10
-rw-r--r--test/gen_filters.c48
-rw-r--r--test/gen_new_fill.c81
-rw-r--r--test/gen_noencoder.c74
-rw-r--r--test/gen_udlinks.c4
-rw-r--r--test/theap.c31
6 files changed, 128 insertions, 120 deletions
diff --git a/test/cache_common.c b/test/cache_common.c
index dc19ac2..8cec96c 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -711,7 +711,11 @@ herr_t
flush(H5F_t *f,
hid_t UNUSED dxpl_id,
hbool_t dest,
- haddr_t addr,
+ haddr_t
+#ifdef NDEBUG
+ UNUSED
+#endif /* NDEBUG */
+ addr,
void *thing,
unsigned * flags_ptr)
{
@@ -1336,7 +1340,7 @@ dirty_entry(H5C_t * cache_ptr,
} else {
- mark_pinned_entry_dirty(cache_ptr, type, idx, FALSE, 0);
+ mark_pinned_entry_dirty(cache_ptr, type, idx, FALSE, (size_t)0);
}
}
@@ -1793,7 +1797,7 @@ verify_entry_status(H5C_t * cache_ptr,
struct expected_entry_status expected[])
{
static char msg[128];
- hbool_t in_cache;
+ hbool_t in_cache = FALSE; /* will set to TRUE if necessary */
int i;
test_entry_t * entry_ptr;
test_entry_t * base_addr;
diff --git a/test/gen_filters.c b/test/gen_filters.c
index b1e9e38..fa9cc58 100644
--- a/test/gen_filters.c
+++ b/test/gen_filters.c
@@ -29,48 +29,47 @@
static herr_t
test_filters_endianess(void)
{
- hid_t fid; /* file ID */
- hid_t dsid; /* dataset ID */
- hid_t sid; /* dataspace ID */
- hid_t dcpl; /* dataset creation property list ID */
- hsize_t dims[1]={20}; /* dataspace dimensions */
- hsize_t chunk_dims[1]={10}; /* chunk dimensions */
+#if defined H5_HAVE_FILTER_FLETCHER32
+ hid_t fid = -1; /* file ID */
+ hid_t dsid = -1; /* dataset ID */
+ hid_t sid = -1; /* dataspace ID */
+ hid_t dcpl = -1; /* dataset creation property list ID */
+ hsize_t dims[1] = {20}; /* dataspace dimensions */
+ hsize_t chunk_dims[1] = {10}; /* chunk dimensions */
int buf[20];
- int rank=1;
+ int rank = 1;
int i;
- for (i=0; i<20; i++){
- buf[i]=1;
- }
+ for(i = 0; i < 20; i++)
+ buf[i] = 1;
-#if defined H5_HAVE_FILTER_FLETCHER32
/* create a file using default properties */
- fid=H5Fcreate(TESTFILE,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT);
+ if((fid = H5Fcreate(TESTFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
/* create a data space */
- if ((sid = H5Screate_simple(rank,dims,NULL))<0) goto error;
+ if((sid = H5Screate_simple(rank, dims, NULL)) < 0) goto error;
/* create dcpl */
- if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if(H5Pset_chunk(dcpl,rank,chunk_dims)<0) goto error;
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
+ if(H5Pset_chunk(dcpl, rank, chunk_dims) < 0) goto error;
- if (H5Pset_fletcher32 (dcpl)<0) goto error;
+ if(H5Pset_fletcher32(dcpl) < 0) goto error;
/* create a dataset */
- if ((dsid = H5Dcreate(fid,"dset",H5T_NATIVE_INT,sid,dcpl)) <0) goto error;
+ if((dsid = H5Dcreate(fid, "dset", H5T_NATIVE_INT, sid, dcpl)) < 0) goto error;
- if(H5Dwrite(dsid,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
- goto error;
+ if(H5Dwrite(dsid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error;
/* close */
- if (H5Pclose (dcpl)<0) goto error;
- if (H5Dclose (dsid)<0) goto error;
- if (H5Sclose (sid)<0) goto error;
- if (H5Fclose (fid)<0) goto error;
+ if(H5Pclose(dcpl) < 0) goto error;
+ if(H5Dclose(dsid) < 0) goto error;
+ if(H5Sclose(sid) < 0) goto error;
+ if(H5Fclose(fid) < 0) goto error;
-#endif
+#endif /* H5_HAVE_FILTER_FLETCHER32 */
return 0;
+#if defined H5_HAVE_FILTER_FLETCHER32
error:
H5E_BEGIN_TRY {
H5Pclose(dcpl);
@@ -79,6 +78,7 @@ error:
H5Fclose(fid);
} H5E_END_TRY;
return -1;
+#endif /* H5_HAVE_FILTER_FLETCHER32 */
} /* end test_filters_endianess() */
diff --git a/test/gen_new_fill.c b/test/gen_new_fill.c
index fc7c246..b688d44 100644
--- a/test/gen_new_fill.c
+++ b/test/gen_new_fill.c
@@ -29,53 +29,53 @@
#define FILENAME "fill_new.h5"
-int main()
+int
+main(void)
{
- hid_t file=-1, dcpl=-1, space=-1, dset1=-1, dset2=-1;
- hsize_t cur_size[2]={8, 8};
- H5D_space_status_t allocation;
- int fill_val1 = 4444, fill_val2=5555;
+ hid_t file=-1, dcpl=-1, space=-1, dset1=-1, dset2=-1;
+ hsize_t cur_size[2]={8, 8};
+ H5D_space_status_t allocation;
+ int fill_val1 = 4444, fill_val2=5555;
- if((file=H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))
- <0) goto error;
- if((space=H5Screate_simple(2, cur_size, cur_size))<0) goto error;
- if((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
+ if((file=H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) <0) goto error;
+ if((space=H5Screate_simple(2, cur_size, cur_size))<0) goto error;
+ if((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- /* Create a dataset with space being allocated and fill value written */
- if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) goto error;
- if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error;
- if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill_val1)<0) goto error;
- if((dset1 = H5Dcreate(file, "dset1", H5T_NATIVE_INT, space, dcpl))<0)
- goto error;
- if (H5Dget_space_status(dset1, &allocation)<0) goto error;
- if (allocation == H5D_SPACE_STATUS_NOT_ALLOCATED) {
- puts(" Got unallocated space instead of allocated.");
- printf(" Got %d\n", allocation);
- goto error;
- }
- if(H5Dclose(dset1)<0) goto error;
+ /* Create a dataset with space being allocated and fill value written */
+ if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) goto error;
+ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error;
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill_val1)<0) goto error;
+ if((dset1 = H5Dcreate(file, "dset1", H5T_NATIVE_INT, space, dcpl))<0)
+ goto error;
+ if (H5Dget_space_status(dset1, &allocation)<0) goto error;
+ if (allocation == H5D_SPACE_STATUS_NOT_ALLOCATED) {
+ puts(" Got unallocated space instead of allocated.");
+ printf(" Got %d\n", allocation);
+ goto error;
+ }
+ if(H5Dclose(dset1)<0) goto error;
- /* Create a dataset with space allocation being delayed */
- if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) goto error;
- if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error;
- if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill_val2)<0) goto error;
- if((dset2 = H5Dcreate(file, "dset2", H5T_NATIVE_INT, space, dcpl))<0)
- goto error;
- if (H5Dget_space_status(dset2, &allocation)<0) goto error;
- if (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED) {
- puts(" Got allocated space instead of unallocated.");
- printf(" Got %d\n", allocation);
- goto error;
- }
- if(H5Dclose(dset2)<0) goto error;
+ /* Create a dataset with space allocation being delayed */
+ if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE) < 0) goto error;
+ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error;
+ if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill_val2)<0) goto error;
+ if((dset2 = H5Dcreate(file, "dset2", H5T_NATIVE_INT, space, dcpl))<0)
+ goto error;
+ if (H5Dget_space_status(dset2, &allocation)<0) goto error;
+ if (allocation != H5D_SPACE_STATUS_NOT_ALLOCATED) {
+ puts(" Got allocated space instead of unallocated.");
+ printf(" Got %d\n", allocation);
+ goto error;
+ }
+ if(H5Dclose(dset2)<0) goto error;
- if(H5Sclose(space)<0) goto error;
- if(H5Pclose(dcpl)<0) goto error;
- if(H5Fclose(file)<0) goto error;
+ if(H5Sclose(space)<0) goto error;
+ if(H5Pclose(dcpl)<0) goto error;
+ if(H5Fclose(file)<0) goto error;
- return 0;
+ return 0;
- error:
+error:
H5E_BEGIN_TRY {
H5Pclose(dcpl);
H5Sclose(space);
@@ -85,3 +85,4 @@ int main()
} H5E_END_TRY;
return 1;
}
+
diff --git a/test/gen_noencoder.c b/test/gen_noencoder.c
index 05a2ff1..8c85df3 100644
--- a/test/gen_noencoder.c
+++ b/test/gen_noencoder.c
@@ -30,51 +30,53 @@
*
*-------------------------------------------------------------------------
*/
-main()
+int
+main(void)
{
- hid_t file_id;
- hid_t dset_id;
- hid_t dcpl_id;
- hid_t space_id;
- hsize_t dims, maxdims;
- int fill = 0;
- int write_buf[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ hid_t file_id;
+ hid_t dset_id;
+ hid_t dcpl_id;
+ hid_t space_id;
+ hsize_t dims, maxdims;
+ int fill = 0;
+ int write_buf[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
- file_id = H5Fcreate("noencoder.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ file_id = H5Fcreate("noencoder.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- dims = 10;
- maxdims = H5S_UNLIMITED;
- space_id = H5Screate_simple(1, &dims, &maxdims);
+ dims = 10;
+ maxdims = H5S_UNLIMITED;
+ space_id = H5Screate_simple(1, &dims, &maxdims);
- dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
- H5Pset_chunk(dcpl_id, 1, &dims);
- H5Pset_szip(dcpl_id, H5_SZIP_NN_OPTION_MASK, 4);
- H5Pset_fill_value(dcpl_id, H5T_NATIVE_INT, &fill);
- H5Pset_fill_time(dcpl_id, H5D_FILL_TIME_ALLOC);
+ dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
+ H5Pset_chunk(dcpl_id, 1, &dims);
+ H5Pset_szip(dcpl_id, H5_SZIP_NN_OPTION_MASK, 4);
+ H5Pset_fill_value(dcpl_id, H5T_NATIVE_INT, &fill);
+ H5Pset_fill_time(dcpl_id, H5D_FILL_TIME_ALLOC);
- /* Create dataset noencoder_szip_dset.h5 */
- dset_id = H5Dcreate(file_id, "noencoder_szip_dset.h5", H5T_NATIVE_INT, space_id, dcpl_id);
+/* Create dataset noencoder_szip_dset.h5 */
+ dset_id = H5Dcreate(file_id, "noencoder_szip_dset.h5", H5T_NATIVE_INT, space_id, dcpl_id);
- H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, write_buf);
+ H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, write_buf);
- H5Pclose(dcpl_id);
- H5Dclose(dset_id);
+ H5Pclose(dcpl_id);
+ H5Dclose(dset_id);
- dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
- H5Pset_chunk(dcpl_id, 1, &dims);
- H5Pset_szip(dcpl_id, H5_SZIP_NN_OPTION_MASK, 4);
- H5Pset_shuffle(dcpl_id);
- H5Pset_fletcher32(dcpl_id);
- H5Pset_fill_value(dcpl_id, H5T_NATIVE_INT, &fill);
- H5Pset_fill_time(dcpl_id, H5D_FILL_TIME_ALLOC);
+ dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
+ H5Pset_chunk(dcpl_id, 1, &dims);
+ H5Pset_szip(dcpl_id, H5_SZIP_NN_OPTION_MASK, 4);
+ H5Pset_shuffle(dcpl_id);
+ H5Pset_fletcher32(dcpl_id);
+ H5Pset_fill_value(dcpl_id, H5T_NATIVE_INT, &fill);
+ H5Pset_fill_time(dcpl_id, H5D_FILL_TIME_ALLOC);
- /* Create dataset noencoder_szip_shuffle_fletcher_dset.h5 */
- dset_id = H5Dcreate(file_id, "noencoder_szip_shuffle_fletcher_dset.h5", H5T_NATIVE_INT, space_id, dcpl_id);
+/* Create dataset noencoder_szip_shuffle_fletcher_dset.h5 */
+ dset_id = H5Dcreate(file_id, "noencoder_szip_shuffle_fletcher_dset.h5", H5T_NATIVE_INT, space_id, dcpl_id);
- H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, write_buf);
+ H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, write_buf);
- H5Pclose(dcpl_id);
- H5Dclose(dset_id);
- H5Sclose(space_id);
- H5Fclose(file_id);
+ H5Pclose(dcpl_id);
+ H5Dclose(dset_id);
+ H5Sclose(space_id);
+ H5Fclose(file_id);
}
+
diff --git a/test/gen_udlinks.c b/test/gen_udlinks.c
index d479797..dad7d27 100644
--- a/test/gen_udlinks.c
+++ b/test/gen_udlinks.c
@@ -61,9 +61,9 @@ main (void)
if((fid2 = H5Fcreate(filename2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
/* Create two groups in the second file */
- if((gid = H5Gcreate(fid2, "group", 0)) < 0) goto error;
+ if((gid = H5Gcreate(fid2, "group", (size_t)0)) < 0) goto error;
if((H5Gclose(gid)) < 0) goto error;
- if((gid = H5Gcreate(fid2, "group/subgroup", 0)) < 0) goto error;
+ if((gid = H5Gcreate(fid2, "group/subgroup", (size_t)0)) < 0) goto error;
if((H5Gclose(gid)) < 0) goto error;
/* Create an external link in the first file pointing to the group in the second file */
diff --git a/test/theap.c b/test/theap.c
index 3ceb167..bfead3c 100644
--- a/test/theap.c
+++ b/test/theap.c
@@ -99,11 +99,11 @@ test_heap_init(void)
/* Sort random numbers into increasing order */
HDmemcpy(inc_sort_num,rand_num,sizeof(test_obj)*NUM_ELEMS);
- HDqsort(inc_sort_num,NUM_ELEMS,sizeof(test_obj),tst_inc_sort);
+ HDqsort(inc_sort_num, (size_t)NUM_ELEMS, sizeof(test_obj), tst_inc_sort);
/* Sort random numbers into decreasing order */
HDmemcpy(dec_sort_num,rand_num,sizeof(test_obj)*NUM_ELEMS);
- HDqsort(dec_sort_num,NUM_ELEMS,sizeof(test_obj),tst_dec_sort);
+ HDqsort(dec_sort_num, (size_t)NUM_ELEMS, sizeof(test_obj), tst_dec_sort);
} /* end test_tst_init() */
/****************************************************************
@@ -310,7 +310,8 @@ test_heap_insert(void)
** "Core" routine called by test_heap_insert_many() routine.
**
****************************************************************/
-static void test_heap_insert_many_core(H5HP_type_t heap_type, test_obj *arr, size_t nelem, int top_val)
+static void
+test_heap_insert_many_core(H5HP_type_t heap_type, test_obj *arr, size_t nelem, int top_val)
{
H5HP_t *heap; /* Heap created */
ssize_t num; /* Number of elements in heap */
@@ -360,22 +361,22 @@ test_heap_insert_many(void)
MESSAGE(6, ("Testing Inserting Many Objects Into Heaps\n"));
/* Test creating a heap from random elements */
- test_heap_insert_many_core(H5HP_MAX_HEAP, rand_num,NUM_ELEMS,dec_sort_num[0].val);
+ test_heap_insert_many_core(H5HP_MAX_HEAP, rand_num, (size_t)NUM_ELEMS, dec_sort_num[0].val);
/* Test creating a heap from elements in increasing order */
- test_heap_insert_many_core(H5HP_MAX_HEAP, inc_sort_num,NUM_ELEMS,dec_sort_num[0].val);
+ test_heap_insert_many_core(H5HP_MAX_HEAP, inc_sort_num, (size_t)NUM_ELEMS, dec_sort_num[0].val);
/* Test creating a heap from elements in decreasing order */
- test_heap_insert_many_core(H5HP_MAX_HEAP, dec_sort_num,NUM_ELEMS,dec_sort_num[0].val);
+ test_heap_insert_many_core(H5HP_MAX_HEAP, dec_sort_num, (size_t)NUM_ELEMS, dec_sort_num[0].val);
/* Test creating a heap from random elements */
- test_heap_insert_many_core(H5HP_MIN_HEAP, rand_num,NUM_ELEMS,inc_sort_num[0].val);
+ test_heap_insert_many_core(H5HP_MIN_HEAP, rand_num, (size_t)NUM_ELEMS, inc_sort_num[0].val);
/* Test creating a heap from elements in increasing order */
- test_heap_insert_many_core(H5HP_MIN_HEAP, inc_sort_num,NUM_ELEMS,inc_sort_num[0].val);
+ test_heap_insert_many_core(H5HP_MIN_HEAP, inc_sort_num, (size_t)NUM_ELEMS, inc_sort_num[0].val);
/* Test creating a heap from elements in decreasing order */
- test_heap_insert_many_core(H5HP_MIN_HEAP, dec_sort_num,NUM_ELEMS,inc_sort_num[0].val);
+ test_heap_insert_many_core(H5HP_MIN_HEAP, dec_sort_num, (size_t)NUM_ELEMS, inc_sort_num[0].val);
} /* end test_heap_insert_many() */
@@ -670,22 +671,22 @@ test_heap_remove_many(void)
MESSAGE(6, ("Testing Removing Many Objects From Heaps\n"));
/* Test removing objects from maximum heap with random elements */
- test_heap_remove_many_core(H5HP_MAX_HEAP, rand_num,NUM_ELEMS);
+ test_heap_remove_many_core(H5HP_MAX_HEAP, rand_num, (size_t)NUM_ELEMS);
/* Test removing objects from maximum heap with elements already sorted in increasing order */
- test_heap_remove_many_core(H5HP_MAX_HEAP, inc_sort_num,NUM_ELEMS);
+ test_heap_remove_many_core(H5HP_MAX_HEAP, inc_sort_num, (size_t)NUM_ELEMS);
/* Test removing objects from maximum heap with elements already sorted in decreasing order */
- test_heap_remove_many_core(H5HP_MAX_HEAP, dec_sort_num,NUM_ELEMS);
+ test_heap_remove_many_core(H5HP_MAX_HEAP, dec_sort_num, (size_t)NUM_ELEMS);
/* Test removing objects from minimum heap with random elements */
- test_heap_remove_many_core(H5HP_MIN_HEAP, rand_num,NUM_ELEMS);
+ test_heap_remove_many_core(H5HP_MIN_HEAP, rand_num, (size_t)NUM_ELEMS);
/* Test removing objects from minimum heap with elements already sorted in increasing order */
- test_heap_remove_many_core(H5HP_MIN_HEAP, inc_sort_num,NUM_ELEMS);
+ test_heap_remove_many_core(H5HP_MIN_HEAP, inc_sort_num, (size_t)NUM_ELEMS);
/* Test removing objects from minimum heap with elements already sorted in decreasing order */
- test_heap_remove_many_core(H5HP_MIN_HEAP, dec_sort_num,NUM_ELEMS);
+ test_heap_remove_many_core(H5HP_MIN_HEAP, dec_sort_num, (size_t)NUM_ELEMS);
} /* end test_heap_remove_many() */