diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-08-19 21:36:03 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-08-19 21:36:03 (GMT) |
commit | fcb21bb3dde491209881dc99eb0adc9198f21452 (patch) | |
tree | 13b7c21f12dafe59ccece140695a2f561f98f1fe | |
parent | b503983d858b4c42ed60ec1275e45a807b6b1198 (diff) | |
parent | cd7ba8ad55e7432bba2e778b6ffdceb7e8293907 (diff) | |
download | hdf5-fcb21bb3dde491209881dc99eb0adc9198f21452.zip hdf5-fcb21bb3dde491209881dc99eb0adc9198f21452.tar.gz hdf5-fcb21bb3dde491209881dc99eb0adc9198f21452.tar.bz2 |
[svn-r24027] merge r 23938 from reduce warnings branch into trunk.
This is the fix for "switch missing default case" warnings in src.
Mohamad & Vailin worked on this patch.
-rw-r--r-- | src/H5SL.c | 6 | ||||
-rw-r--r-- | src/H5Shyper.c | 3 | ||||
-rw-r--r-- | src/H5T.c | 8 | ||||
-rw-r--r-- | src/H5Tdbg.c | 2 | ||||
-rw-r--r-- | src/H5Znbit.c | 12 | ||||
-rw-r--r-- | src/H5Zshuffle.c | 6 | ||||
-rw-r--r-- | src/H5checksum.c | 2 |
7 files changed, 39 insertions, 0 deletions
@@ -1668,6 +1668,9 @@ H5SL_below(H5SL_t *slist, const void *key) case H5SL_TYPE_GENERIC: H5SL_FIND(GENERIC, slist, x, const void, key, -) break; + + default: + HDassert(0 && "Unknown skiplist type!"); } /* end switch */ /* An exact match for 'key' must not have been found in list, if we get here */ @@ -1767,6 +1770,9 @@ H5SL_above(H5SL_t *slist, const void *key) case H5SL_TYPE_GENERIC: H5SL_FIND(GENERIC, slist, x, const void, key, -) break; + + default: + HDassert(0 && "Unknown skiplist type!"); } /* end switch */ /* An exact match for 'key' must not have been found in list, if we get here */ diff --git a/src/H5Shyper.c b/src/H5Shyper.c index d88ac35..f8d87e4 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -8249,6 +8249,9 @@ loc += fast_dim_buf_off; duffs_index = (fast_dim_count + 7) / 8; switch (fast_dim_count % 8) { + default: + HDassert(0 && "This Should never be executed!"); + break; case 0: do { @@ -3247,6 +3247,8 @@ H5T_copy(H5T_t *old_dt, H5T_copy_t method) new_dt->shared->state = H5T_STATE_RDONLY; } break; + default: + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, NULL, "invalid copy method type") } /* end switch */ /* Update fields in the new struct, if we aren't sharing an already opened @@ -3449,6 +3451,8 @@ H5T_lock (H5T_t *dt, hbool_t immutable) case H5T_STATE_OPEN: /*void*/ break; + default: + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, FAIL, "invalid datatype state") } done: @@ -4850,6 +4854,8 @@ H5T_oloc(H5T_t *dt) HDassert(dt->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); ret_value = &dt->oloc; break; + default: + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, NULL, "invalid datatype state") } /* end switch */ done: @@ -4888,6 +4894,8 @@ H5T_nameof(H5T_t *dt) case H5T_STATE_OPEN: ret_value = &(dt->path); break; + default: + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, NULL, "invalid datatype state") } /* end switch */ done: diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index e5df7ff..fe204d8 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -237,6 +237,8 @@ H5T_debug(const H5T_t *dt, FILE *stream) case H5T_STATE_OPEN: s2 = "[named,open]"; break; + default: + HDassert(0 && "This Should never be executed!"); } /* end switch */ fprintf(stream, "%s%s {nbytes=%lu", s1, s2, (unsigned long)(dt->shared->size)); diff --git a/src/H5Znbit.c b/src/H5Znbit.c index 134ef3a..ebb534b 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -1093,6 +1093,8 @@ H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset, parms_index++; /* skip size of no-op type */ H5Z_nbit_decompress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); break; + default: + HDassert(0 && "This Should never be executed!"); } /* end switch */ } @@ -1131,6 +1133,8 @@ H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_offset, H5Z_nbit_decompress_one_nooptype(data, data_offset+member_offset, buffer, j, buf_len, size); break; + default: + HDassert(0 && "This Should never be executed!"); } /* end switch */ } } @@ -1179,6 +1183,8 @@ H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffe parms_index = 4; } break; + default: + HDassert(0 && "This Should never be executed!"); } /* end switch */ } @@ -1320,6 +1326,8 @@ static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, parms_index++; /* skip size of no-op type */ H5Z_nbit_compress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); break; + default: + HDassert(0 && "This Should never be executed!"); } /* end switch */ } @@ -1358,6 +1366,8 @@ static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offs H5Z_nbit_compress_one_nooptype(data, data_offset+member_offset, buffer, j, buf_len, size); break; + default: + HDassert(0 && "This Should never be executed!"); } /* end switch */ } } @@ -1406,6 +1416,8 @@ static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned c parms_index = 4; } break; + default: + HDassert(0 && "This Should never be executed!"); } /* end switch */ /* Update the size to the new value after compression. If there are any bits hanging over in diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index 7aa0202..90509b0 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -183,6 +183,9 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], duffs_index = (numofelements + 7) / 8; switch (numofelements % 8) { + default: + HDassert(0 && "This Should never be executed!"); + break; case 0: do { @@ -238,6 +241,9 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], duffs_index = (numofelements + 7) / 8; switch (numofelements % 8) { + default: + HDassert(0 && "This Should never be executed!"); + break; case 0: do { diff --git a/src/H5checksum.c b/src/H5checksum.c index ec8b2b0..48e4ce5 100644 --- a/src/H5checksum.c +++ b/src/H5checksum.c @@ -422,6 +422,8 @@ H5_checksum_lookup3(const void *key, size_t length, uint32_t initval) case 1 : a+=k[0]; break; case 0 : goto done; + default: + HDassert(0 && "This Should never be executed!"); } H5_lookup3_final(a, b, c); |