[Libreoffice-commits] online.git: 2 commits - common/SpookyV2.cpp kit/Kit.cpp

Tor Lillqvist tml at collabora.com
Thu Oct 26 08:57:00 UTC 2017


 common/SpookyV2.cpp |   18 ++++++++++++++++++
 kit/Kit.cpp         |    1 +
 2 files changed, 19 insertions(+)

New commits:
commit a806655e59786b9de6d64dfcff30bfa4fde6af67
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Oct 26 11:53:35 2017 +0300

    Fix makedev warning
    
    g++ says: In the GNU C Library, "makedev" is defined by
    <sys/sysmacros.h>. For historical compatibility, it is currently
    defined by <sys/types.h> as well, but we plan to remove this soon. To
    use "makedev", include <sys/sysmacros.h> directly. If you did not
    intend to use a system-defined macro "makedev", you should undefine it
    after including <sys/types.h>.
    
    Change-Id: If5cd1ec0ca34b00b1248e9b2650d4d13e6d3bf64

diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index d2ded17f..34aed6a1 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -19,6 +19,7 @@
 #include <sys/capability.h>
 #include <unistd.h>
 #include <utime.h>
+#include <sys/sysmacros.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 
commit 73d77a9f6746e4a6418b6539dfbe35fcda29fcd5
Author: Tor Lillqvist <tml at collabora.com>
Date:   Thu Oct 26 11:51:53 2017 +0300

    More -Werror=implicit-fallthrough=
    
    Change-Id: I62164eef3a4f95bfe505b3b1a866495bde6c19b1

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;


More information about the Libreoffice-commits mailing list