Commit 9f4a587c authored by Nicholas Ormrod's avatar Nicholas Ormrod Committed by Anton Likhtarov

Fix lint errors

Summary: Lines exceeding 80 characters have been restructured.

Test Plan:
fbconfig -r folly && fbmake runtests

Reviewed By: robbert@fb.com

Subscribers: trunkagent, sdwilsh, fugalh, njormrod

FB internal diff: D1568086
parent b6ee36ab
...@@ -769,7 +769,8 @@ class ConcurrentSkipList<T, Comp, NodeAlloc, MAX_HEIGHT>::Skipper { ...@@ -769,7 +769,8 @@ class ConcurrentSkipList<T, Comp, NodeAlloc, MAX_HEIGHT>::Skipper {
findInsertionPoint(preds_[lyr], lyr, data, preds_, succs_); findInsertionPoint(preds_[lyr], lyr, data, preds_, succs_);
if (foundLayer < 0) return false; if (foundLayer < 0) return false;
DCHECK(succs_[0] != nullptr) << "lyr=" << lyr << "; max_layer=" << max_layer; DCHECK(succs_[0] != nullptr) << "lyr=" << lyr
<< "; max_layer=" << max_layer;
return !succs_[0]->markedForRemoval(); return !succs_[0]->markedForRemoval();
} }
......
...@@ -217,7 +217,8 @@ public: ...@@ -217,7 +217,8 @@ public:
// with diffs defined by either xor or subtraction // with diffs defined by either xor or subtraction
// with a base of all zeros plus a counter, or plus another bit, or random // with a base of all zeros plus a counter, or plus another bit, or random
// //
static inline void ShortMix(uint64_t &h0, uint64_t &h1, uint64_t &h2, uint64_t &h3) static inline void ShortMix(uint64_t &h0, uint64_t &h1,
uint64_t &h2, uint64_t &h3)
{ {
h2 = Rot64(h2,50); h2 += h3; h0 ^= h2; h2 = Rot64(h2,50); h2 += h3; h0 ^= h2;
h3 = Rot64(h3,52); h3 += h0; h1 ^= h3; h3 = Rot64(h3,52); h3 += h0; h1 ^= h3;
...@@ -245,7 +246,8 @@ public: ...@@ -245,7 +246,8 @@ public:
// For every pair of input bits, // For every pair of input bits,
// with probability 50 +- .75% (the worst case is approximately that) // with probability 50 +- .75% (the worst case is approximately that)
// //
static inline void ShortEnd(uint64_t &h0, uint64_t &h1, uint64_t &h2, uint64_t &h3) static inline void ShortEnd(uint64_t &h0, uint64_t &h1,
uint64_t &h2, uint64_t &h3)
{ {
h3 ^= h2; h2 = Rot64(h2,15); h3 += h2; h3 ^= h2; h2 = Rot64(h2,15); h3 += h2;
h0 ^= h3; h3 = Rot64(h3,52); h0 += h3; h0 ^= h3; h3 = Rot64(h3,52); h0 += h3;
...@@ -269,7 +271,7 @@ private: ...@@ -269,7 +271,7 @@ private:
// held to the same quality bar. // held to the same quality bar.
// //
static void Short( static void Short(
const void *message, // message (array of bytes, not necessarily aligned) const void *message, // message (byte array, not necessarily aligned)
size_t length, // length of message (in bytes) size_t length, // length of message (in bytes)
uint64_t *hash1, // in/out: in the seed, out the hash value uint64_t *hash1, // in/out: in the seed, out the hash value
uint64_t *hash2); // in/out: in the seed, out the hash value uint64_t *hash2); // in/out: in the seed, out the hash value
......
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
// April 10 2012: buffer overflow on platforms without unaligned reads // April 10 2012: buffer overflow on platforms without unaligned reads
// July 12 2012: was passing out variables in final to in/out in short // July 12 2012: was passing out variables in final to in/out in short
// July 30 2012: I reintroduced the buffer overflow // July 30 2012: I reintroduced the buffer overflow
// August 5 2012: SpookyV2: d = should be d += in short hash, and remove extra mix from long hash // August 5 2012: SpookyV2: d = should be d += in short hash, and remove
// extra mix from long hash
#include <folly/SpookyHashV2.h> #include <folly/SpookyHashV2.h>
......
...@@ -222,7 +222,8 @@ public: ...@@ -222,7 +222,8 @@ public:
// with diffs defined by either xor or subtraction // with diffs defined by either xor or subtraction
// with a base of all zeros plus a counter, or plus another bit, or random // with a base of all zeros plus a counter, or plus another bit, or random
// //
static inline void ShortMix(uint64_t &h0, uint64_t &h1, uint64_t &h2, uint64_t &h3) static inline void ShortMix(uint64_t &h0, uint64_t &h1,
uint64_t &h2, uint64_t &h3)
{ {
h2 = Rot64(h2,50); h2 += h3; h0 ^= h2; h2 = Rot64(h2,50); h2 += h3; h0 ^= h2;
h3 = Rot64(h3,52); h3 += h0; h1 ^= h3; h3 = Rot64(h3,52); h3 += h0; h1 ^= h3;
...@@ -250,7 +251,8 @@ public: ...@@ -250,7 +251,8 @@ public:
// For every pair of input bits, // For every pair of input bits,
// with probability 50 +- .75% (the worst case is approximately that) // with probability 50 +- .75% (the worst case is approximately that)
// //
static inline void ShortEnd(uint64_t &h0, uint64_t &h1, uint64_t &h2, uint64_t &h3) static inline void ShortEnd(uint64_t &h0, uint64_t &h1,
uint64_t &h2, uint64_t &h3)
{ {
h3 ^= h2; h2 = Rot64(h2,15); h3 += h2; h3 ^= h2; h2 = Rot64(h2,15); h3 += h2;
h0 ^= h3; h3 = Rot64(h3,52); h0 += h3; h0 ^= h3; h3 = Rot64(h3,52); h0 += h3;
...@@ -274,7 +276,7 @@ private: ...@@ -274,7 +276,7 @@ private:
// held to the same quality bar. // held to the same quality bar.
// //
static void Short( static void Short(
const void *message, // message (array of bytes, not necessarily aligned) const void *message, // message (byte array, not necessarily aligned)
size_t length, // length of message (in bytes) size_t length, // length of message (in bytes)
uint64_t *hash1, // in/out: in the seed, out the hash value uint64_t *hash1, // in/out: in the seed, out the hash value
uint64_t *hash2); // in/out: in the seed, out the hash value uint64_t *hash2); // in/out: in the seed, out the hash value
......
...@@ -30,7 +30,8 @@ size_t xallocx(void*, size_t, size_t, int) __attribute__((__weak__)); ...@@ -30,7 +30,8 @@ size_t xallocx(void*, size_t, size_t, int) __attribute__((__weak__));
size_t sallocx(const void*, int) __attribute__((__weak__)); size_t sallocx(const void*, int) __attribute__((__weak__));
void dallocx(void*, int) __attribute__((__weak__)); void dallocx(void*, int) __attribute__((__weak__));
size_t nallocx(size_t, int) __attribute__((__weak__)); size_t nallocx(size_t, int) __attribute__((__weak__));
int mallctl(const char*, void*, size_t*, void*, size_t) __attribute__((__weak__)); int mallctl(const char*, void*, size_t*, void*, size_t)
__attribute__((__weak__));
#else #else
extern void* (*mallocx)(size_t, int); extern void* (*mallocx)(size_t, int);
extern void* (*rallocx)(void*, size_t, int); extern void* (*rallocx)(void*, size_t, int);
......
...@@ -56,8 +56,8 @@ void CPUThreadPoolExecutor::threadRun(std::shared_ptr<Thread> thread) { ...@@ -56,8 +56,8 @@ void CPUThreadPoolExecutor::threadRun(std::shared_ptr<Thread> thread) {
LOG(ERROR) << "CPUThreadPoolExecutor: func threw unhandled " << LOG(ERROR) << "CPUThreadPoolExecutor: func threw unhandled " <<
typeid(e).name() << " exception: " << e.what(); typeid(e).name() << " exception: " << e.what();
} catch (...) { } catch (...) {
LOG(ERROR) << "CPUThreadPoolExecutor: func threw unhandled non-exception " LOG(ERROR) << "CPUThreadPoolExecutor: func threw unhandled "
"object"; "non-exception object";
} }
thread->idle = true; thread->idle = true;
} }
......
...@@ -74,7 +74,8 @@ private: ...@@ -74,7 +74,8 @@ private:
}; };
// fastest conceivable hash function (for comparison) // fastest conceivable hash function (for comparison)
static void Add(const void *data, size_t length, uint64_t *hash1, uint64_t *hash2) static void Add(const void *data, size_t length,
uint64_t *hash1, uint64_t *hash2)
{ {
uint64_t *p64 = (uint64_t *)data; uint64_t *p64 = (uint64_t *)data;
uint64_t *end = p64 + length/8; uint64_t *end = p64 + length/8;
...@@ -426,8 +427,10 @@ void TestDeltas(int seed) ...@@ -426,8 +427,10 @@ void TestDeltas(int seed)
{ {
buf1[j/8] ^= (1 << (j%8)); buf1[j/8] ^= (1 << (j%8));
} }
SpookyHashV1::Hash128(buf1, h, &measure[0][0], &measure[0][1]); SpookyHashV1::Hash128(buf1, h,
SpookyHashV1::Hash128(buf2, h, &measure[1][0], &measure[1][1]); &measure[0][0], &measure[0][1]);
SpookyHashV1::Hash128(buf2, h,
&measure[1][0], &measure[1][1]);
for (int l=0; l<2; ++l) { for (int l=0; l<2; ++l) {
measure[2][l] = measure[0][l] ^ measure[1][l]; measure[2][l] = measure[0][l] ^ measure[1][l];
measure[3][l] = ~(measure[0][l] ^ measure[1][l]); measure[3][l] = ~(measure[0][l] ^ measure[1][l]);
......
This diff is collapsed.
...@@ -257,7 +257,8 @@ Future<T> makeFuture(std::exception_ptr const& e) { ...@@ -257,7 +257,8 @@ Future<T> makeFuture(std::exception_ptr const& e) {
} }
template <class T, class E> template <class T, class E>
typename std::enable_if<std::is_base_of<std::exception, E>::value, Future<T>>::type typename std::enable_if<std::is_base_of<std::exception, E>::value,
Future<T>>::type
makeFuture(E const& e) { makeFuture(E const& e) {
Promise<T> p; Promise<T> p;
auto f = p.getFuture(); auto f = p.getFuture();
......
...@@ -261,7 +261,8 @@ Future<T> makeFuture(std::exception_ptr const& e); ...@@ -261,7 +261,8 @@ Future<T> makeFuture(std::exception_ptr const& e);
/** Make a Future from an exception type E that can be passed to /** Make a Future from an exception type E that can be passed to
std::make_exception_ptr(). */ std::make_exception_ptr(). */
template <class T, class E> template <class T, class E>
typename std::enable_if<std::is_base_of<std::exception, E>::value, Future<T>>::type typename std::enable_if<std::is_base_of<std::exception, E>::value,
Future<T>>::type
makeFuture(E const& e); makeFuture(E const& e);
/** Make a Future out of a Try */ /** Make a Future out of a Try */
......
...@@ -56,7 +56,8 @@ aFunction(Params...) { ...@@ -56,7 +56,8 @@ aFunction(Params...) {
template <class Ret, class... Params> template <class Ret, class... Params>
std::function<Ret(Params...)> std::function<Ret(Params...)>
aStdFunction(typename std::enable_if<!isFuture<Ret>::value, bool>::type = false) { aStdFunction(
typename std::enable_if<!isFuture<Ret>::value, bool>::type = false) {
return [](Params...) -> Ret { return Ret(); }; return [](Params...) -> Ret { return Ret(); };
} }
......
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