From 31d70fb3841c928c96b2118eccfd6c92b3753844 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 14 Sep 2005 02:52:29 -0500 Subject: [svn-r11412] Purpose: bug fix. Description: The test would seg-fault in filter test. This happened only if the test code is compiled with -O2, not if it is compiled with -O0. The problem was because the array index varialbe i, j were defined as type hsize_t which is unsigned long long. The optimization seemed to make some mistake here. Solution: Since the data range of the index variables aren't that big. Changed them to int should be sufficient. (I had tested it by setting them to type long and it passed all tests. So, it is safe to use long IF the data ranges need it.) Platforms tested: Tflops(janus). Misc. update: --- test/dsets.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/dsets.c b/test/dsets.c index 1810148..b5cace3 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -1306,7 +1306,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */ const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */ void *tconv_buf = NULL; /* Temporary conversion buffer */ - hsize_t i, j, n; /* Local index variables */ + int i, j, n; /* Local index variables */ herr_t status; /* Error status */ /* Create the data space */ @@ -2161,7 +2161,7 @@ test_missing_filter(hid_t file) const hsize_t dims[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ const hsize_t chunk_dims[2] = {2, 25}; /* Chunk dimensions */ hsize_t dset_size; /* Dataset size */ - hsize_t i,j; /* Local index variables */ + int i,j; /* Local index variables */ herr_t ret; /* Generic return value */ char testfile[512]=""; /* Buffer to hold name of existing test file */ char *srcdir = HDgetenv("srcdir"); /* The source directory, if we are using the --srcdir configure option */ @@ -2413,7 +2413,7 @@ test_onebyte_shuffle(hid_t file) const hsize_t chunk_size[2] = {10, 20}; unsigned char orig_data[10][20]; unsigned char new_data[10][20]; - hsize_t i, j; + int i, j; #else /* H5_HAVE_FILTER_SHUFFLE */ const char *not_supported= " Data shuffling is not enabled."; #endif /* H5_HAVE_FILTER_SHUFFLE */ @@ -2707,7 +2707,7 @@ test_can_apply(hid_t file) const hsize_t dims[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ const hsize_t chunk_dims[2] = {2, 25}; /* Chunk dimensions */ hsize_t dset_size; /* Dataset size */ - hsize_t i,j; /* Local index variables */ + int i,j; /* Local index variables */ TESTING("dataset filter 'can apply' callback"); @@ -3068,7 +3068,7 @@ test_set_local(hid_t fapl) const hsize_t chunk_dims[2] = {2, 25}; /* Chunk dimensions */ hsize_t dset_size; /* Dataset size */ unsigned cd_values[2]={BOGUS2_PARAM_1, BOGUS2_PARAM_2}; /* Parameters for Bogus2 filter */ - hsize_t i,j; /* Local index variables */ + int i,j; /* Local index variables */ double n; /* Local index variables */ TESTING("dataset filter 'set local' callback"); -- cgit v0.12