summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2016-06-28 21:53:48 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2016-06-28 21:53:48 (GMT)
commit83724bd7873e3e199a94ba9c3526732d8117e996 (patch)
treeb724d9adeb1130e81bbf3afa8ec705b63067affe /test
parentb8f809981bb6c378e2a942aad551620feaa47125 (diff)
downloadhdf5-83724bd7873e3e199a94ba9c3526732d8117e996.zip
hdf5-83724bd7873e3e199a94ba9c3526732d8117e996.tar.gz
hdf5-83724bd7873e3e199a94ba9c3526732d8117e996.tar.bz2
[svn-r30113] Description:
Clean up warnings (from 2774 -> 1560, with my standard debug build) Tested on: MacOSX/64 10.11.5 (amazon) w/serial, parallel & production (h5committest forthcoming)
Diffstat (limited to 'test')
-rw-r--r--test/cache_common.c2
-rw-r--r--test/dt_arith.c96
-rw-r--r--test/fheap.c2
-rw-r--r--test/freespace.c2
-rw-r--r--test/h5test.c6
-rw-r--r--test/tcheck_version.c2
-rw-r--r--test/tchecksum.c2
-rw-r--r--test/tconfig.c6
-rw-r--r--test/testframe.c10
-rw-r--r--test/titerate.c4
-rw-r--r--test/tmeta.c2
-rw-r--r--test/tselect.c2
-rw-r--r--test/ttsafe.c2
-rw-r--r--test/ttsafe_acreate.c4
14 files changed, 71 insertions, 71 deletions
diff --git a/test/cache_common.c b/test/cache_common.c
index b92a7b0..21f0366 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -6237,7 +6237,7 @@ check_and_validate_cache_size(hid_t file_id,
} /* check_and_validate_cache_size() */
-hbool_t
+H5_ATTR_PURE hbool_t
resize_configs_are_equal(const H5C_auto_size_ctl_t *a,
const H5C_auto_size_ctl_t *b,
hbool_t compare_init)
diff --git a/test/dt_arith.c b/test/dt_arith.c
index bd8babe..639ad52 100644
--- a/test/dt_arith.c
+++ b/test/dt_arith.c
@@ -127,39 +127,39 @@ static int without_hardware_g = 0;
/*positive values, ascending order. VALUE1 starts from 00000001, to 00000010, until 10000000*/ \
/*VALUE2 ascends from 00000000, to 00000011, 00000111,..., until 11111111.*/ \
for(n=0; n<SRC_PREC; n++) { \
- if(value1<=SRC_MAX && value1>=SRC_MIN) { \
- memcpy(buf_p, &value1, SRC_SIZE); \
- memcpy(saved_p, &value1, SRC_SIZE); \
+ { \
+ HDmemcpy(buf_p, &value1, SRC_SIZE); \
+ HDmemcpy(saved_p, &value1, SRC_SIZE); \
buf_p += SRC_SIZE; \
saved_p += SRC_SIZE; \
} \
- if(value2<=SRC_MAX && value2>=SRC_MIN) { \
- memcpy(buf_p, &value2, SRC_SIZE); \
- memcpy(saved_p, &value2, SRC_SIZE); \
+ { \
+ HDmemcpy(buf_p, &value2, SRC_SIZE); \
+ HDmemcpy(saved_p, &value2, SRC_SIZE); \
buf_p += SRC_SIZE; \
saved_p += SRC_SIZE; \
} \
\
if(n<SRC_PREC-2) { \
- value1 <<= 1; \
- value2 = (value1 - 1) | value1; \
+ value1 = (TYPE)(value1 << 1); \
+ value2 = (TYPE)((value1 - 1) | value1); \
} else if(n==SRC_PREC-2) { /*to avoid overflow of negative values for signed integer*/ \
- value1 <<= 1; \
- value2 = (~value1) | value1; \
+ value1 = (TYPE)(value1 << 1); \
+ value2 = (TYPE)((~value1) | value1); \
} \
} \
\
/* negative values for signed; descending positive values for unsigned */ \
/* VALUE2 descends from 11111111 to 11111110, 11111100, ..., until 10000000. */ \
for(n=0; n<SRC_PREC-1; n++) { \
- if(value2<=SRC_MAX && value2>=SRC_MIN) { \
- memcpy(buf_p, &value2, SRC_SIZE); \
- memcpy(saved_p, &value2, SRC_SIZE); \
+ { \
+ HDmemcpy(buf_p, &value2, SRC_SIZE); \
+ HDmemcpy(saved_p, &value2, SRC_SIZE); \
buf_p += SRC_SIZE; \
saved_p += SRC_SIZE; \
} \
if(n<SRC_PREC-1) \
- value2 <<= 1; \
+ value2 = (TYPE)(value2 << 1); \
} \
}
@@ -242,15 +242,15 @@ static int without_hardware_g = 0;
value2 = -SRC_MIN; \
for(n=0; n<num_norm; n++) { \
if(value1<SRC_MAX) { /*positive*/ \
- memcpy(buf_p, &value1, SRC_SIZE); \
- memcpy(saved_p, &value1, SRC_SIZE); \
+ HDmemcpy(buf_p, &value1, SRC_SIZE); \
+ HDmemcpy(saved_p, &value1, SRC_SIZE); \
value1 *= multiply; \
buf_p += SRC_SIZE; \
saved_p += SRC_SIZE; \
} \
if(value2>-SRC_MAX) { /*negative*/ \
- memcpy(buf_p, &value2, SRC_SIZE); \
- memcpy(saved_p, &value2, SRC_SIZE); \
+ HDmemcpy(buf_p, &value2, SRC_SIZE); \
+ HDmemcpy(saved_p, &value2, SRC_SIZE); \
value2 *= multiply; \
buf_p += SRC_SIZE; \
saved_p += SRC_SIZE; \
@@ -258,14 +258,14 @@ static int without_hardware_g = 0;
} \
\
value1 = SRC_MAX; /*maximal value*/ \
- memcpy(buf_p, &value1, SRC_SIZE); \
- memcpy(saved_p, &value1, SRC_SIZE); \
+ HDmemcpy(buf_p, &value1, SRC_SIZE); \
+ HDmemcpy(saved_p, &value1, SRC_SIZE); \
buf_p += SRC_SIZE; \
saved_p += SRC_SIZE; \
\
value2 = -SRC_MAX; /*negative value*/ \
- memcpy(buf_p, &value2, SRC_SIZE); \
- memcpy(saved_p, &value2, SRC_SIZE); \
+ HDmemcpy(buf_p, &value2, SRC_SIZE); \
+ HDmemcpy(saved_p, &value2, SRC_SIZE); \
buf_p += SRC_SIZE; \
saved_p += SRC_SIZE; \
}
@@ -290,37 +290,37 @@ static int without_hardware_g = 0;
HDmemset(BUF, 0, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \
HDmemset(SAVED, 0, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \
\
- tmp1 = (unsigned char*)HDcalloc((size_t)1, (size_t)SRC_SIZE); \
- tmp2 = (unsigned char*)HDcalloc((size_t)1, (size_t)SRC_SIZE); \
+ tmp1 = (unsigned char*)HDcalloc((size_t)1, (size_t)SRC_SIZE); \
+ tmp2 = (unsigned char*)HDcalloc((size_t)1, (size_t)SRC_SIZE); \
\
buf_p = BUF; \
saved_p = SAVED; \
\
/*Denormalized values. Exponent is 0. Let mantissa starts from 00000001, 00000011, \
*00000111,..., until 11111111.*/ \
- memset(tmp1, 0, SRC_SIZE); \
- memset(tmp2, 0, SRC_SIZE); \
- H5T__bit_set (tmp2, SRC_PREC-1, (size_t)1, TRUE); /*the negative value*/ \
+ HDmemset(tmp1, 0, SRC_SIZE); \
+ HDmemset(tmp2, 0, SRC_SIZE); \
+ H5T__bit_set (tmp2, SRC_PREC-1, (size_t)1, TRUE); /*the negative value*/ \
for(n=0; n<SRC_MANT_DIG-1; n++) { \
- H5T__bit_set (tmp1, n, (size_t)1, TRUE); /*turn on 1 bit each time*/ \
+ H5T__bit_set (tmp1, n, (size_t)1, TRUE); /*turn on 1 bit each time*/ \
CHANGE_ORDER(tmp1, SRC_ORDR, SRC_SIZE); /*change order for big endian*/ \
- memcpy(buf_p, tmp1, SRC_SIZE); \
- memcpy(saved_p, tmp1, SRC_SIZE); \
+ HDmemcpy(buf_p, tmp1, SRC_SIZE); \
+ HDmemcpy(saved_p, tmp1, SRC_SIZE); \
CHANGE_ORDER(tmp1, SRC_ORDR, SRC_SIZE); /*change back the order for bit operation*/ \
buf_p += SRC_SIZE; \
saved_p += SRC_SIZE; \
\
/*negative values*/ \
- H5T__bit_set (tmp2, n, (size_t)1, TRUE); \
+ H5T__bit_set (tmp2, n, (size_t)1, TRUE); \
CHANGE_ORDER(tmp2, SRC_ORDR, SRC_SIZE); \
- memcpy(buf_p, tmp2, SRC_SIZE); \
- memcpy(saved_p, tmp2, SRC_SIZE); \
+ HDmemcpy(buf_p, tmp2, SRC_SIZE); \
+ HDmemcpy(saved_p, tmp2, SRC_SIZE); \
CHANGE_ORDER(tmp2, SRC_ORDR, SRC_SIZE); \
buf_p += SRC_SIZE; \
saved_p += SRC_SIZE; \
} \
- HDfree(tmp1); \
- HDfree(tmp2); \
+ HDfree(tmp1); \
+ HDfree(tmp2); \
}
/* Allocate buffer and initialize it with floating-point special values, +/-0, +/-infinity,
@@ -342,50 +342,50 @@ static int without_hardware_g = 0;
SAVED = (unsigned char*)aligned_malloc( NELMTS*MAX(SRC_SIZE, DST_SIZE)); \
HDmemset(BUF, 0, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \
HDmemset(SAVED, 0, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \
- value = (unsigned char*)HDcalloc(SRC_SIZE, sizeof(unsigned char)); \
+ value = (unsigned char*)HDcalloc(SRC_SIZE, sizeof(unsigned char)); \
\
buf_p = BUF; \
\
/* +0 */ \
- H5T__bit_set(value, (size_t)0, SRC_PREC, FALSE); \
- memcpy(buf_p, value, SRC_SIZE*sizeof(unsigned char)); \
+ H5T__bit_set(value, (size_t)0, SRC_PREC, FALSE); \
+ HDmemcpy(buf_p, value, SRC_SIZE*sizeof(unsigned char)); \
buf_p += SRC_SIZE; \
\
for(n=0; n<2; n++) { \
if(n==1) { \
memset(value, 0, SRC_SIZE*sizeof(unsigned char)); \
/* -0 */ \
- H5T__bit_set(value, (size_t)(SRC_PREC - 1), (size_t)1, TRUE); \
+ H5T__bit_set(value, (size_t)(SRC_PREC - 1), (size_t)1, TRUE); \
CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE);/*change order for big endian*/ \
- HDmemcpy(buf_p, value, SRC_SIZE*sizeof(unsigned char)); \
+ HDmemcpy(buf_p, value, SRC_SIZE*sizeof(unsigned char)); \
CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE);/*change back the order for bit operation*/ \
buf_p += SRC_SIZE; \
} \
\
/* +/-infinity */ \
- H5T__bit_set(value, (size_t)(SRC_MANT_DIG - 1), SRC_PREC-SRC_MANT_DIG, TRUE); \
+ H5T__bit_set(value, (size_t)(SRC_MANT_DIG - 1), SRC_PREC-SRC_MANT_DIG, TRUE); \
CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change order for big endian*/ \
- HDmemcpy(buf_p, value, SRC_SIZE*sizeof(unsigned char)); \
+ HDmemcpy(buf_p, value, SRC_SIZE*sizeof(unsigned char)); \
CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change back the order for bit operation*/ \
buf_p += SRC_SIZE; \
\
/* +/-SNaN */ \
- H5T__bit_set(value, (size_t)0, (size_t)1, TRUE); \
+ H5T__bit_set(value, (size_t)0, (size_t)1, TRUE); \
CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change order for big endian*/ \
- HDmemcpy(buf_p, value, SRC_SIZE * sizeof(unsigned char)); \
+ HDmemcpy(buf_p, value, SRC_SIZE * sizeof(unsigned char)); \
CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change back the order for bit operation*/ \
buf_p += SRC_SIZE; \
\
/* +/-QNaN */ \
- H5T__bit_set(value, (size_t)(SRC_MANT_DIG - 2), (size_t)1, TRUE); \
+ H5T__bit_set(value, (size_t)(SRC_MANT_DIG - 2), (size_t)1, TRUE); \
CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change order for big endian*/ \
- HDmemcpy(buf_p, value, SRC_SIZE*sizeof(unsigned char)); \
+ HDmemcpy(buf_p, value, SRC_SIZE*sizeof(unsigned char)); \
CHANGE_ORDER(value, SRC_ORDR, SRC_SIZE); /*change back the order for bit operation*/ \
buf_p += SRC_SIZE; \
} \
\
- HDmemcpy(SAVED, BUF, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \
- HDfree(value); \
+ HDmemcpy(SAVED, BUF, NELMTS*MAX(SRC_SIZE, DST_SIZE)); \
+ HDfree(value); \
}
void some_dummy_func(float x);
diff --git a/test/fheap.c b/test/fheap.c
index 558cb44..a59c27f 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -498,7 +498,7 @@ get_del_string(const fheap_test_param_t *tparam)
*
*-------------------------------------------------------------------------
*/
-static size_t
+H5_ATTR_PURE static size_t
get_fill_size(const fheap_test_param_t *tparam)
{
switch(tparam->fill) {
diff --git a/test/freespace.c b/test/freespace.c
index 2023724..6e680c3 100644
--- a/test/freespace.c
+++ b/test/freespace.c
@@ -221,7 +221,7 @@ TEST_sect_init_cls(H5FS_section_class_t *cls, void *_udata)
* Check if the two sections can be merged:
* true if second section adjoins the first section
*/
-static herr_t
+H5_ATTR_PURE static herr_t
TEST_sect_can_merge(const H5FS_section_info_t *_sect1,
const H5FS_section_info_t *_sect2, void H5_ATTR_UNUSED *_udata)
{
diff --git a/test/h5test.c b/test/h5test.c
index 39731a2..6267137 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -767,15 +767,15 @@ h5_fixname_real(const char *base_name, hid_t fapl, const char *_suffix,
*
*-------------------------------------------------------------------------
*/
-const char *
+H5_ATTR_PURE const char *
h5_rmprefix(const char *filename)
{
const char *ret_ptr;
if ((ret_ptr = HDstrstr(filename, ":")) == NULL)
- ret_ptr = filename;
+ ret_ptr = filename;
else
- ret_ptr++;
+ ret_ptr++;
return(ret_ptr);
}
diff --git a/test/tcheck_version.c b/test/tcheck_version.c
index a75d642..1abab69 100644
--- a/test/tcheck_version.c
+++ b/test/tcheck_version.c
@@ -104,7 +104,7 @@ parse(int ac, char **av)
* some systems may produce extra messages and/or produce core dump.
* This tries to eliminate those side effects.
*/
-void
+H5_ATTR_NORETURN void
abort_intercept (int H5_ATTR_UNUSED sig)
{
HDexit(6);
diff --git a/test/tchecksum.c b/test/tchecksum.c
index 350a218..cb7c023 100644
--- a/test/tchecksum.c
+++ b/test/tchecksum.c
@@ -247,7 +247,7 @@ test_checksum(void)
*
*-------------------------------------------------------------------------
*/
-void
+H5_ATTR_PURE void
cleanup_checksum(void)
{
/* no file to clean */
diff --git a/test/tconfig.c b/test/tconfig.c
index 3ae26c2..1604c61 100644
--- a/test/tconfig.c
+++ b/test/tconfig.c
@@ -86,7 +86,7 @@ test_configure(void)
*
*-------------------------------------------------------------------------
*/
-void
+H5_ATTR_PURE void
cleanup_configure(void)
{
/* no file to clean */
@@ -109,7 +109,7 @@ cleanup_configure(void)
*
*-------------------------------------------------------------------------
*/
-void
+H5_ATTR_PURE void
test_config_ctypes(void)
{
/* standard C89 basic types */
@@ -218,7 +218,7 @@ test_config_ctypes(void)
*
*-------------------------------------------------------------------------
*/
-void
+H5_ATTR_PURE void
test_exit_definitions(void)
{
/* Verify the EXIT_SUCCESS and EXIT_FAILURE are 0 and 1 respectively. */
diff --git a/test/testframe.c b/test/testframe.c
index daa27c5..1c56f88 100644
--- a/test/testframe.c
+++ b/test/testframe.c
@@ -365,7 +365,7 @@ void TestCleanup(void)
/*
* Retrieve the verbosity level for the testing framework
*/
-int GetTestVerbosity(void)
+H5_ATTR_PURE int GetTestVerbosity(void)
{
return(TestVerbosity);
}
@@ -452,7 +452,7 @@ int SetTestExpress(int newval)
* Retrieve Summary request value.
* 0 means no summary, 1 means yes.
*/
-int GetTestSummary(void)
+H5_ATTR_PURE int GetTestSummary(void)
{
return(Summary);
}
@@ -461,7 +461,7 @@ int GetTestSummary(void)
* Retrieve Cleanup request value.
* 0 means no Cleanup, 1 means yes.
*/
-int GetTestCleanup(void)
+H5_ATTR_PURE int GetTestCleanup(void)
{
return(CleanUp);
}
@@ -498,7 +498,7 @@ void ParseTestVerbosity(char *argv)
/*
* Retrieve the number of testing errors for the testing framework
*/
-int GetTestNumErrs(void)
+H5_ATTR_PURE int GetTestNumErrs(void)
{
return(num_errs);
}
@@ -516,7 +516,7 @@ void IncTestNumErrs(void)
/*
* Retrieve the current Test Parameters pointer.
*/
-const void *GetTestParameters(void)
+H5_ATTR_PURE const void *GetTestParameters(void)
{
return(Test_parameters);
}
diff --git a/test/titerate.c b/test/titerate.c
index 20a3940..f61842a 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -72,7 +72,7 @@ herr_t aiter_cb(hid_t group, const char *name, const H5A_info_t *ainfo,
** iter_strcmp(): String comparison routine for qsort
**
****************************************************************/
-int iter_strcmp(const void *s1, const void *s2)
+H5_ATTR_PURE int iter_strcmp(const void *s1, const void *s2)
{
return(HDstrcmp(*(const char * const *)s1,*(const char * const *)s2));
}
@@ -527,7 +527,7 @@ static void test_iter_attr(hid_t fapl, hbool_t new_format)
** iter_strcmp2(): String comparison routine for qsort
**
****************************************************************/
-int iter_strcmp2(const void *s1, const void *s2)
+H5_ATTR_PURE int iter_strcmp2(const void *s1, const void *s2)
{
return(HDstrcmp((const char *)s1, (const char *)s2));
} /* end iter_strcmp2() */
diff --git a/test/tmeta.c b/test/tmeta.c
index a7fd688..e69c057 100644
--- a/test/tmeta.c
+++ b/test/tmeta.c
@@ -123,7 +123,7 @@ test_metadata(void)
*
*-------------------------------------------------------------------------
*/
-void
+H5_ATTR_PURE void
cleanup_metadata(void)
{
/* no file to clean */
diff --git a/test/tselect.c b/test/tselect.c
index 670406d..73b8015 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -2630,7 +2630,7 @@ test_select_hyper_checker_board_dr__select_checker_board(hid_t tgt_n_cube_sid,
** a selected or an unselected checker.
**
****************************************************************/
-static hbool_t
+H5_ATTR_PURE static hbool_t
test_select_hyper_checker_board_dr__verify_data(uint16_t * buf_ptr,
unsigned rank, unsigned edge_size, unsigned checker_edge_size,
uint16_t first_expected_val, hbool_t buf_starts_in_checker)
diff --git a/test/ttsafe.c b/test/ttsafe.c
index d3c5cfb..1fb9446 100644
--- a/test/ttsafe.c
+++ b/test/ttsafe.c
@@ -45,7 +45,7 @@
#define NAME_OFFSET 6 /* offset for "name<num>" */
/* pre-condition: num must be a non-negative number */
-static unsigned
+H5_ATTR_PURE static unsigned
num_digits(int num)
{
unsigned u;
diff --git a/test/ttsafe_acreate.c b/test/ttsafe_acreate.c
index dec2eee..cc3f405 100644
--- a/test/ttsafe_acreate.c
+++ b/test/ttsafe_acreate.c
@@ -113,7 +113,7 @@ void tts_acreate(void)
* with the dataset
*/
for(i = 0; i < NUM_THREADS; i++) {
- attrib_data = HDmalloc(sizeof(ttsafe_name_data_t));
+ attrib_data = (ttsafe_name_data_t *)HDmalloc(sizeof(ttsafe_name_data_t));
attrib_data->dataset = dataset;
attrib_data->datatype = datatype;
attrib_data->dataspace = dataspace;
@@ -170,7 +170,7 @@ void *tts_acreate_thread(void *client_data)
H5P_DEFAULT, H5P_DEFAULT);
/* Write data to the attribute */
- attribute_data = HDmalloc(sizeof(int));
+ attribute_data = (int *)HDmalloc(sizeof(int));
*attribute_data = attrib_data->current_index;
H5Awrite(attribute, H5T_NATIVE_INT, attribute_data);
H5Aclose(attribute);