Commit ce7751a2 authored by James Sedgwick's avatar James Sedgwick Committed by Facebook Github Bot

add FOLLY_FALLTHROUGH throughout to satisfy internal linter

Summary: changes as suggested by FB-internal linter

Reviewed By: yfeldblum

Differential Revision: D4957742

fbshipit-source-id: c9d94c477d24f153cab0d25edccfd39ff31fdfdf
parent d19f7312
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <folly/Format.h> #include <folly/Format.h>
#include <folly/CppAttributes.h>
#include <folly/portability/Constexpr.h> #include <folly/portability/Constexpr.h>
#include <double-conversion/double-conversion.h> #include <double-conversion/double-conversion.h>
...@@ -81,6 +82,7 @@ void FormatValue<double>::formatHelper( ...@@ -81,6 +82,7 @@ void FormatValue<double>::formatHelper(
switch (arg.presentation) { switch (arg.presentation) {
case '%': case '%':
val *= 100; val *= 100;
FOLLY_FALLTHROUGH;
case 'f': case 'f':
case 'F': case 'F':
{ {
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <folly/SocketAddress.h> #include <folly/SocketAddress.h>
#include <folly/CppAttributes.h>
#include <folly/Exception.h> #include <folly/Exception.h>
#include <folly/Hash.h> #include <folly/Hash.h>
...@@ -554,7 +555,7 @@ bool SocketAddress::prefixMatch(const SocketAddress& other, ...@@ -554,7 +555,7 @@ bool SocketAddress::prefixMatch(const SocketAddress& other,
switch (getFamily()) { switch (getFamily()) {
case AF_INET: case AF_INET:
mask_length = 32; mask_length = 32;
// fallthrough FOLLY_FALLTHROUGH;
case AF_INET6: case AF_INET6:
{ {
auto prefix = folly::IPAddress::longestCommonPrefix( auto prefix = folly::IPAddress::longestCommonPrefix(
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include <folly/SpookyHashV1.h> #include <folly/SpookyHashV1.h>
#include <folly/CppAttributes.h>
#include <cstring> #include <cstring>
#define ALLOW_UNALIGNED_READS 1 #define ALLOW_UNALIGNED_READS 1
...@@ -96,37 +98,48 @@ void SpookyHashV1::Short( ...@@ -96,37 +98,48 @@ void SpookyHashV1::Short(
switch (remainder) switch (remainder)
{ {
case 15: case 15:
d += ((uint64_t)u.p8[14]) << 48; d += ((uint64_t)u.p8[14]) << 48;
FOLLY_FALLTHROUGH;
case 14: case 14:
d += ((uint64_t)u.p8[13]) << 40; d += ((uint64_t)u.p8[13]) << 40;
FOLLY_FALLTHROUGH;
case 13: case 13:
d += ((uint64_t)u.p8[12]) << 32; d += ((uint64_t)u.p8[12]) << 32;
FOLLY_FALLTHROUGH;
case 12: case 12:
d += u.p32[2]; d += u.p32[2];
c += u.p64[0]; c += u.p64[0];
break; break;
case 11: case 11:
d += ((uint64_t)u.p8[10]) << 16; d += ((uint64_t)u.p8[10]) << 16;
FOLLY_FALLTHROUGH;
case 10: case 10:
d += ((uint64_t)u.p8[9]) << 8; d += ((uint64_t)u.p8[9]) << 8;
FOLLY_FALLTHROUGH;
case 9: case 9:
d += (uint64_t)u.p8[8]; d += (uint64_t)u.p8[8];
FOLLY_FALLTHROUGH;
case 8: case 8:
c += u.p64[0]; c += u.p64[0];
break; break;
case 7: case 7:
c += ((uint64_t)u.p8[6]) << 48; c += ((uint64_t)u.p8[6]) << 48;
FOLLY_FALLTHROUGH;
case 6: case 6:
c += ((uint64_t)u.p8[5]) << 40; c += ((uint64_t)u.p8[5]) << 40;
FOLLY_FALLTHROUGH;
case 5: case 5:
c += ((uint64_t)u.p8[4]) << 32; c += ((uint64_t)u.p8[4]) << 32;
FOLLY_FALLTHROUGH;
case 4: case 4:
c += u.p32[0]; c += u.p32[0];
break; break;
case 3: case 3:
c += ((uint64_t)u.p8[2]) << 16; c += ((uint64_t)u.p8[2]) << 16;
FOLLY_FALLTHROUGH;
case 2: case 2:
c += ((uint64_t)u.p8[1]) << 8; c += ((uint64_t)u.p8[1]) << 8;
FOLLY_FALLTHROUGH;
case 1: case 1:
c += (uint64_t)u.p8[0]; c += (uint64_t)u.p8[0];
break; break;
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <folly/SpookyHashV2.h> #include <folly/SpookyHashV2.h>
#include <folly/CppAttributes.h>
#include <folly/Portability.h> #include <folly/Portability.h>
#include <cstring> #include <cstring>
...@@ -98,37 +99,48 @@ void SpookyHashV2::Short( ...@@ -98,37 +99,48 @@ void SpookyHashV2::Short(
switch (remainder) switch (remainder)
{ {
case 15: case 15:
d += ((uint64_t)u.p8[14]) << 48; d += ((uint64_t)u.p8[14]) << 48;
FOLLY_FALLTHROUGH;
case 14: case 14:
d += ((uint64_t)u.p8[13]) << 40; d += ((uint64_t)u.p8[13]) << 40;
FOLLY_FALLTHROUGH;
case 13: case 13:
d += ((uint64_t)u.p8[12]) << 32; d += ((uint64_t)u.p8[12]) << 32;
FOLLY_FALLTHROUGH;
case 12: case 12:
d += u.p32[2]; d += u.p32[2];
c += u.p64[0]; c += u.p64[0];
break; break;
case 11: case 11:
d += ((uint64_t)u.p8[10]) << 16; d += ((uint64_t)u.p8[10]) << 16;
FOLLY_FALLTHROUGH;
case 10: case 10:
d += ((uint64_t)u.p8[9]) << 8; d += ((uint64_t)u.p8[9]) << 8;
FOLLY_FALLTHROUGH;
case 9: case 9:
d += (uint64_t)u.p8[8]; d += (uint64_t)u.p8[8];
FOLLY_FALLTHROUGH;
case 8: case 8:
c += u.p64[0]; c += u.p64[0];
break; break;
case 7: case 7:
c += ((uint64_t)u.p8[6]) << 48; c += ((uint64_t)u.p8[6]) << 48;
FOLLY_FALLTHROUGH;
case 6: case 6:
c += ((uint64_t)u.p8[5]) << 40; c += ((uint64_t)u.p8[5]) << 40;
FOLLY_FALLTHROUGH;
case 5: case 5:
c += ((uint64_t)u.p8[4]) << 32; c += ((uint64_t)u.p8[4]) << 32;
FOLLY_FALLTHROUGH;
case 4: case 4:
c += u.p32[0]; c += u.p32[0];
break; break;
case 3: case 3:
c += ((uint64_t)u.p8[2]) << 16; c += ((uint64_t)u.p8[2]) << 16;
FOLLY_FALLTHROUGH;
case 2: case 2:
c += ((uint64_t)u.p8[1]) << 8; c += ((uint64_t)u.p8[1]) << 8;
FOLLY_FALLTHROUGH;
case 1: case 1:
c += (uint64_t)u.p8[0]; c += (uint64_t)u.p8[0];
break; break;
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <folly/Conv.h> #include <folly/Conv.h>
#include <folly/CppAttributes.h>
#include <folly/Format.h> #include <folly/Format.h>
#include <folly/Range.h> #include <folly/Range.h>
#include <folly/String.h> #include <folly/String.h>
...@@ -99,9 +100,9 @@ size_t parsePageSizeValue(StringPiece value) { ...@@ -99,9 +100,9 @@ size_t parsePageSizeValue(StringPiece value) {
StringPiece numStr(value.data() + match.position(1), size_t(match.length(1))); StringPiece numStr(value.data() + match.position(1), size_t(match.length(1)));
size_t size = to<size_t>(numStr); size_t size = to<size_t>(numStr);
switch (c) { switch (c) {
case 't': size *= 1024; case 't': size *= 1024; FOLLY_FALLTHROUGH;
case 'g': size *= 1024; case 'g': size *= 1024; FOLLY_FALLTHROUGH;
case 'm': size *= 1024; case 'm': size *= 1024; FOLLY_FALLTHROUGH;
case 'k': size *= 1024; case 'k': size *= 1024;
} }
return size; return size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment