common/SpookyV2.cpp |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

New commits:
commit 497b872f3619987d4860407ce6250dce3052e6f6
Author: Tor Lillqvist <t...@collabora.com>
Date:   Thu Oct 26 11:51:53 2017 +0300

    More -Werror=implicit-fallthrough=
    
    Change-Id: I62164eef3a4f95bfe505b3b1a866495bde6c19b1
    (cherry picked from commit 73d77a9f6746e4a6418b6539dfbe35fcda29fcd5)
    Reviewed-on: https://gerrit.libreoffice.org/48626
    Reviewed-by: Tor Lillqvist <t...@collabora.com>
    Tested-by: Tor Lillqvist <t...@collabora.com>

diff --git a/common/SpookyV2.cpp b/common/SpookyV2.cpp
index 9d6ea649..88d79696 100644
--- a/common/SpookyV2.cpp
+++ b/common/SpookyV2.cpp
@@ -16,6 +16,13 @@
 
 #define ALLOW_UNALIGNED_READS true
 
+#if defined __clang__
+#define FALLTHROUGH [[clang::fallthrough]]
+#elif defined __GNUC__ && __GNUC__ >= 7
+#define FALLTHROUGH [[fallthrough]]
+#else
+#define FALLTHROUGH
+#endif
 //
 // short hash ... it could be used on any message,
 // but it's used by Spooky just for short messages.
@@ -80,36 +87,47 @@ void SpookyHash::Short(
     {
     case 15:
     d += ((uint64)u.p8[14]) << 48;
+    FALLTHROUGH;
     case 14:
         d += ((uint64)u.p8[13]) << 40;
+        FALLTHROUGH;
     case 13:
         d += ((uint64)u.p8[12]) << 32;
+        FALLTHROUGH;
     case 12:
         d += u.p32[2];
         c += u.p64[0];
         break;
     case 11:
         d += ((uint64)u.p8[10]) << 16;
+        FALLTHROUGH;
     case 10:
         d += ((uint64)u.p8[9]) << 8;
+        FALLTHROUGH;
     case 9:
         d += (uint64)u.p8[8];
+        FALLTHROUGH;
     case 8:
         c += u.p64[0];
         break;
     case 7:
         c += ((uint64)u.p8[6]) << 48;
+        FALLTHROUGH;
     case 6:
         c += ((uint64)u.p8[5]) << 40;
+        FALLTHROUGH;
     case 5:
         c += ((uint64)u.p8[4]) << 32;
+        FALLTHROUGH;
     case 4:
         c += u.p32[0];
         break;
     case 3:
         c += ((uint64)u.p8[2]) << 16;
+        FALLTHROUGH;
     case 2:
         c += ((uint64)u.p8[1]) << 8;
+        FALLTHROUGH;
     case 1:
         c += (uint64)u.p8[0];
         break;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to