From 5dcd9c2dfcfe50cb8aea4e5ff4399aeb17d91296 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Fri, 9 Aug 2013 15:42:27 -0500 Subject: [svn-r23984] Merged 2 23932 from reduced_warnings branch: Changes applied to eliminate several compiler warnings in the test directory in files: dt_arith.c filter_fail.c big.c dynlib2.c dynlib3.c Also an HDassert(0 && "Unknown type"); statement was added to all 29 combination s of case OTHER: default: See crucible review HDF5-145 for more details. Tested with h5committest. --- test/big.c | 5 ++++- test/dt_arith.c | 32 ++++++++++++++++++++++++++++++++ test/dynlib2.c | 3 +++ test/dynlib3.c | 3 +++ test/filter_fail.c | 4 ++-- 5 files changed, 44 insertions(+), 3 deletions(-) diff --git a/test/big.c b/test/big.c index dffbbeb..5a70c26 100644 --- a/test/big.c +++ b/test/big.c @@ -393,6 +393,10 @@ writer (char* filename, hid_t fapl, fsizes_t testsize, int wrt_n) HDfprintf(stdout, "Unexpected file size of NOFILE\n"); goto error; break; + + default: + HDassert(0 && "Invalid test size."); + break; } /* @@ -604,7 +608,6 @@ usage(void) int testvfd(vfd_t vfd) { hid_t fapl=-1; - hsize_t family_size; char filename[1024]; fsizes_t testsize; diff --git a/test/dt_arith.c b/test/dt_arith.c index 096b83e..9879887 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -1853,6 +1853,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_UCHAR==dst_type) { @@ -1903,6 +1904,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_SHORT==dst_type) { @@ -1954,6 +1956,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_USHORT==dst_type) { @@ -2004,6 +2007,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_INT==dst_type) { @@ -2054,6 +2058,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_UINT==dst_type) { @@ -2104,6 +2109,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_LONG==dst_type) { @@ -2154,6 +2160,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_ULONG==dst_type) { @@ -2204,6 +2211,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_LLONG==dst_type) { @@ -2254,6 +2262,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_ULLONG==dst_type) { @@ -2304,6 +2313,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } @@ -2482,6 +2492,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } @@ -2535,6 +2546,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } @@ -2578,6 +2590,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } @@ -3867,6 +3880,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (FLT_DOUBLE==dst_type) { @@ -3919,6 +3933,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } #if H5_SIZEOF_LONG_DOUBLE !=0 @@ -3972,6 +3987,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case FLT_LDOUBLE: case OTHER: default: + HDassert(0 && "Unknown type"); break; } #endif @@ -4004,6 +4020,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_UCHAR==dst_type) { @@ -4035,6 +4052,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_SHORT==dst_type) { @@ -4066,6 +4084,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_USHORT==dst_type) { @@ -4097,6 +4116,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_INT==dst_type) { @@ -4128,6 +4148,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_UINT==dst_type) { @@ -4159,6 +4180,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_LONG==dst_type) { @@ -4190,6 +4212,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_ULONG==dst_type) { @@ -4221,6 +4244,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_LLONG==dst_type) { @@ -4252,6 +4276,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } else if (INT_ULLONG==dst_type) { @@ -4283,6 +4308,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) case INT_ULLONG: case OTHER: default: + HDassert(0 && "Unknown type"); break; } } @@ -4549,6 +4575,8 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) break; #endif case OTHER: + default: + HDassert(0 && "Unknown type"); break; } @@ -4612,6 +4640,8 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) break; #endif case OTHER: + default: + HDassert(0 && "Unknown type"); break; } @@ -4662,6 +4692,8 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) break; #endif case OTHER: + default: + HDassert(0 && "Unknown type"); break; } diff --git a/test/dynlib2.c b/test/dynlib2.c index a853ed0..0d8be2b 100644 --- a/test/dynlib2.c +++ b/test/dynlib2.c @@ -71,6 +71,9 @@ H5Z_filter_dynlib2(unsigned int flags, size_t cd_nelmts, if(cd_nelmts > 0) return(0); + /* Assignment to eliminate unused parameter warning. */ + cd_values = cd_values; + if(flags & H5Z_FLAG_REVERSE) { /*read*/ /* Divide the original value with MULTIPLIER */ while(buf_left > 0) { diff --git a/test/dynlib3.c b/test/dynlib3.c index 9560b86..b3a02ed 100644 --- a/test/dynlib3.c +++ b/test/dynlib3.c @@ -71,6 +71,9 @@ H5Z_filter_dynlib3(unsigned int flags, size_t cd_nelmts, if(cd_nelmts > 0) return(0); + /* Assignment to eliminate unused parameter warning. */ + cd_values = cd_values; + if(flags & H5Z_FLAG_REVERSE) { /*read*/ ret_value = *buf_size = nbytes - SUFFIX_LEN; } /* end if */ diff --git a/test/filter_fail.c b/test/filter_fail.c index c48be14..3dbb564 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -65,8 +65,8 @@ const H5Z_class2_t H5Z_FAIL_TEST[1] = {{ *------------------------------------------------------------------------- */ static size_t -filter_fail(unsigned int flags, size_t cd_nelmts, - const unsigned int *cd_values, size_t nbytes, +filter_fail(unsigned int flags, size_t UNUSED cd_nelmts, + const unsigned int UNUSED *cd_values, size_t nbytes, size_t *buf_size, void **buf) { int *dst = (int*)(*buf); -- cgit v0.12