diff options
author | Mark Wielaard <mjw@redhat.com> | 2016-11-04 23:55:01 +0000 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2016-11-18 11:06:18 +0100 |
commit | 4d17eaece8b31e642acaf4d77fe961ad8e3aaf50 (patch) | |
tree | dc02d2bd4f420b18fa85514f3aee1ccd69f8c8a5 /libiberty/hashtab.c | |
parent | ef0f5d7cc3b2082c94beffa7c9c1a8acd8eaa427 (diff) | |
download | gdb-4d17eaece8b31e642acaf4d77fe961ad8e3aaf50.zip gdb-4d17eaece8b31e642acaf4d77fe961ad8e3aaf50.tar.gz gdb-4d17eaece8b31e642acaf4d77fe961ad8e3aaf50.tar.bz2 |
libiberty: Fix -Wimplicit-fallthrough warnings.
Adjust some comments, add some explicit fall through comments or explicit
returns where necessary to not get implicit-fallthrough warnings.
All fall throughs were deliberate. In one case I added an explicit return
false for clarity instead of falling through a default case (that also
would return false).
libiberty/ChangeLog:
* cplus-dem.c (demangle_signature): Move fall through comment.
(demangle_fund_type): Add fall through comment between 'G' and 'I'.
* hashtab.c (iterative_hash): Add fall through comments.
* regex.c (regex_compile): Add Fall through comment after '+'/'?'.
(byte_re_match_2_internal): Add Fall through comment after jump_n.
Change "Note fall through" to "Fall through".
(common_op_match_null_string_p): Return false after set_number_at
instead of fall through.
Diffstat (limited to 'libiberty/hashtab.c')
-rw-r--r-- | libiberty/hashtab.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c index 04607ea..99381b1 100644 --- a/libiberty/hashtab.c +++ b/libiberty/hashtab.c @@ -962,17 +962,17 @@ iterative_hash (const PTR k_in /* the key */, c += length; switch(len) /* all the case statements fall through */ { - case 11: c+=((hashval_t)k[10]<<24); - case 10: c+=((hashval_t)k[9]<<16); - case 9 : c+=((hashval_t)k[8]<<8); + case 11: c+=((hashval_t)k[10]<<24); /* fall through */ + case 10: c+=((hashval_t)k[9]<<16); /* fall through */ + case 9 : c+=((hashval_t)k[8]<<8); /* fall through */ /* the first byte of c is reserved for the length */ - case 8 : b+=((hashval_t)k[7]<<24); - case 7 : b+=((hashval_t)k[6]<<16); - case 6 : b+=((hashval_t)k[5]<<8); - case 5 : b+=k[4]; - case 4 : a+=((hashval_t)k[3]<<24); - case 3 : a+=((hashval_t)k[2]<<16); - case 2 : a+=((hashval_t)k[1]<<8); + case 8 : b+=((hashval_t)k[7]<<24); /* fall through */ + case 7 : b+=((hashval_t)k[6]<<16); /* fall through */ + case 6 : b+=((hashval_t)k[5]<<8); /* fall through */ + case 5 : b+=k[4]; /* fall through */ + case 4 : a+=((hashval_t)k[3]<<24); /* fall through */ + case 3 : a+=((hashval_t)k[2]<<16); /* fall through */ + case 2 : a+=((hashval_t)k[1]<<8); /* fall through */ case 1 : a+=k[0]; /* case 0: nothing left to add */ } |