File: implicit-fallthrough.patch

package info (click to toggle)
libs3 2.0-5
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 872 kB
  • sloc: ansic: 6,950; xml: 227; sh: 109; makefile: 12
file content (67 lines) | stat: -rw-r--r-- 3,215 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Description: disable implicit-fallthrough warnings for certain case lines
 Fixes FTBFS with GCC 7.
Author: Laszlo Boszormenyi (GCS) <gcs@debian.org>
Last-Update: 2017-09-27

---

--- libs3-2.0.orig/src/util.c
+++ libs3-2.0/src/util.c
@@ -486,17 +486,17 @@ uint64_t hash(const unsigned char *k, in
         }
         
         switch(length) {
-        case 12: c += ((uint32_t) k[11]) << 24;
-        case 11: c += ((uint32_t) k[10]) << 16;
-        case 10: c += ((uint32_t) k[9]) << 8;
-        case 9 : c += k[8];
-        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 12: c += ((uint32_t) k[11]) << 24; __attribute__ ((fallthrough));
+        case 11: c += ((uint32_t) k[10]) << 16; __attribute__ ((fallthrough));
+        case 10: c += ((uint32_t) k[9]) << 8; __attribute__ ((fallthrough));
+        case 9 : c += k[8]; __attribute__ ((fallthrough));
+        case 8 : b += ((uint32_t) k[7]) << 24; __attribute__ ((fallthrough));
+        case 7 : b += ((uint32_t) k[6]) << 16; __attribute__ ((fallthrough));
+        case 6 : b += ((uint32_t) k[5]) << 8; __attribute__ ((fallthrough));
+        case 5 : b += k[4]; __attribute__ ((fallthrough));
+        case 4 : a += ((uint32_t) k[3]) << 24; __attribute__ ((fallthrough));
+        case 3 : a += ((uint32_t) k[2]) << 16; __attribute__ ((fallthrough));
+        case 2 : a += ((uint32_t) k[1]) << 8; __attribute__ ((fallthrough));
         case 1 : a += k[0]; break;
         case 0 : goto end;
         }
@@ -526,17 +526,17 @@ uint64_t hash(const unsigned char *k, in
         }
 
         switch(length) {
-        case 12: c += k[11];
-        case 11: c += ((uint32_t) k[10]) << 8;
-        case 10: c += ((uint32_t) k[9]) << 16;
-        case 9 : c += ((uint32_t) k[8]) << 24;
-        case 8 : b += k[7];
-        case 7 : b += ((uint32_t) k[6]) << 8;
-        case 6 : b += ((uint32_t) k[5]) << 16;
-        case 5 : b += ((uint32_t) k[4]) << 24;
-        case 4 : a += k[3];
-        case 3 : a += ((uint32_t) k[2]) << 8;
-        case 2 : a += ((uint32_t) k[1]) << 16;
+        case 12: c += k[11]; __attribute__ ((fallthrough));
+        case 11: c += ((uint32_t) k[10]) << 8; __attribute__ ((fallthrough));
+        case 10: c += ((uint32_t) k[9]) << 16; __attribute__ ((fallthrough));
+        case 9 : c += ((uint32_t) k[8]) << 24; __attribute__ ((fallthrough));
+        case 8 : b += k[7]; __attribute__ ((fallthrough));
+        case 7 : b += ((uint32_t) k[6]) << 8; __attribute__ ((fallthrough));
+        case 6 : b += ((uint32_t) k[5]) << 16; __attribute__ ((fallthrough));
+        case 5 : b += ((uint32_t) k[4]) << 24; __attribute__ ((fallthrough));
+        case 4 : a += k[3]; __attribute__ ((fallthrough));
+        case 3 : a += ((uint32_t) k[2]) << 8; __attribute__ ((fallthrough));
+        case 2 : a += ((uint32_t) k[1]) << 16; __attribute__ ((fallthrough));
         case 1 : a += ((uint32_t) k[0]) << 24; break;
         case 0 : goto end;
         }