Skip to content

Commit

Permalink
Add missing fallthrough attributes
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
  • Loading branch information
cgzones committed Nov 28, 2024
1 parent ec49428 commit f9dc0b6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/common/c_jhash.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,17 @@ static inline uint32_t c_jhash(const uint8_t *k, uint32_t length, uint32_t initv
c += length;
/* all the case statements fall through */
switch(len) {
case 11: c+=((uint32_t)k[10]<<24);
case 10: c+=((uint32_t)k[9]<<16);
case 9 : c+=((uint32_t)k[8]<<8);
case 11: c+=((uint32_t)k[10]<<24); Q_FALLTHROUGH();
case 10: c+=((uint32_t)k[9]<<16); Q_FALLTHROUGH();
case 9 : c+=((uint32_t)k[8]<<8); Q_FALLTHROUGH();
/* the first byte of c is reserved for the length */
case 8 : b+=((uint32_t)k[7]<<24);
case 7 : b+=((uint32_t)k[6]<<16);
case 6 : b+=((uint32_t)k[5]<<8);
case 5 : b+=k[4];
case 4 : a+=((uint32_t)k[3]<<24);
case 3 : a+=((uint32_t)k[2]<<16);
case 2 : a+=((uint32_t)k[1]<<8);
case 8 : b+=((uint32_t)k[7]<<24); Q_FALLTHROUGH();
case 7 : b+=((uint32_t)k[6]<<16); Q_FALLTHROUGH();
case 6 : b+=((uint32_t)k[5]<<8); Q_FALLTHROUGH();
case 5 : b+=k[4]; Q_FALLTHROUGH();
case 4 : a+=((uint32_t)k[3]<<24); Q_FALLTHROUGH();
case 3 : a+=((uint32_t)k[2]<<16); Q_FALLTHROUGH();
case 2 : a+=((uint32_t)k[1]<<8); Q_FALLTHROUGH();
case 1 : a+=k[0];
/* case 0: nothing left to add */
}
Expand Down

0 comments on commit f9dc0b6

Please sign in to comment.