Skip to content

Commit

Permalink
update clang-format in fbsource and format folly
Browse files Browse the repository at this point in the history
Reviewed By: zertosh

Differential Revision: D9993527

fbshipit-source-id: 52c4c0bfe6b5c73c652dd350f599fb846a003a4f
  • Loading branch information
igorsugak authored and facebook-github-bot committed Sep 21, 2018
1 parent 0289870 commit f68a521
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions folly/Function.h
Expand Up @@ -591,7 +591,7 @@ class Function final : private detail::function::FunctionTraits<FunctionType> {
// Make sure Objective C blocks are copied
template <class ReturnType, class... Args>
/*implicit*/ Function(ReturnType (^objCBlock)(Args... args))
: Function([blockCopy = (ReturnType (^)(Args...))[objCBlock copy]](
: Function([blockCopy = (ReturnType(^)(Args...))[objCBlock copy]](
Args... args) { return blockCopy(args...); }){};
#endif

Expand Down Expand Up @@ -680,7 +680,7 @@ class Function final : private detail::function::FunctionTraits<FunctionType> {
// Make sure Objective C blocks are copied
template <class ReturnType, class... Args>
/* implicit */ Function& operator=(ReturnType (^objCBlock)(Args... args)) {
(*this) = [blockCopy = (ReturnType (^)(Args...))[objCBlock copy]](
(*this) = [blockCopy = (ReturnType(^)(Args...))[objCBlock copy]](
Args... args) { return blockCopy(args...); };
return *this;
}
Expand Down
4 changes: 3 additions & 1 deletion folly/Poly.h
Expand Up @@ -333,7 +333,9 @@ template <class T, class I>
/// \overload
template <class T, class I>
[[noreturn]] detail::AddCvrefOf<T, I> const& poly_cast(
detail::ArchetypeRoot<I> const&) { assume_unreachable(); }
detail::ArchetypeRoot<I> const&) {
assume_unreachable();
}
/// \endcond

/// \overload
Expand Down
8 changes: 4 additions & 4 deletions folly/Subprocess.cpp
Expand Up @@ -152,7 +152,7 @@ namespace {
// Copy pointers to the given strings in a format suitable for posix_spawn
std::unique_ptr<const char* []> cloneStrings(
const std::vector<std::string>& s) {
std::unique_ptr<const char* []> d(new const char*[s.size() + 1]);
std::unique_ptr<const char*[]> d(new const char*[s.size() + 1]);
for (size_t i = 0; i < s.size(); i++) {
d[i] = s[i].c_str();
}
Expand Down Expand Up @@ -247,7 +247,7 @@ void Subprocess::setAllNonBlocking() {
}

void Subprocess::spawn(
std::unique_ptr<const char* []> argv,
std::unique_ptr<const char*[]> argv,
const char* executable,
const Options& optionsIn,
const std::vector<std::string>* env) {
Expand Down Expand Up @@ -319,7 +319,7 @@ void Subprocess::spawn(
FOLLY_PUSH_WARNING
FOLLY_GCC_DISABLE_WARNING("-Wclobbered")
void Subprocess::spawnInternal(
std::unique_ptr<const char* []> argv,
std::unique_ptr<const char*[]> argv,
const char* executable,
Options& options,
const std::vector<std::string>* env,
Expand Down Expand Up @@ -382,7 +382,7 @@ void Subprocess::spawnInternal(
char** argVec = const_cast<char**>(argv.get());

// Set up environment
std::unique_ptr<const char* []> envHolder;
std::unique_ptr<const char*[]> envHolder;
char** envVec;
if (env) {
envHolder = cloneStrings(*env);
Expand Down
4 changes: 2 additions & 2 deletions folly/Subprocess.h
Expand Up @@ -887,12 +887,12 @@ class Subprocess {
// spawnInternal() returns it reads the error pipe to see if the child
// encountered any errors.
void spawn(
std::unique_ptr<const char* []> argv,
std::unique_ptr<const char*[]> argv,
const char* executable,
const Options& options,
const std::vector<std::string>* env);
void spawnInternal(
std::unique_ptr<const char* []> argv,
std::unique_ptr<const char*[]> argv,
const char* executable,
Options& options,
const std::vector<std::string>* env,
Expand Down
7 changes: 4 additions & 3 deletions folly/detail/PolyDetail.h
Expand Up @@ -335,10 +335,11 @@ struct ArchetypeBase : Bottom {
template <class T>
/* implicit */ ArchetypeBase(T&&);
template <std::size_t, class... As>
[[noreturn]] Bottom _polyCall_(As&&...) const { std::terminate(); }
[[noreturn]] Bottom _polyCall_(As&&...) const {
std::terminate();
}

friend bool
operator==(ArchetypeBase const&, ArchetypeBase const&);
friend bool operator==(ArchetypeBase const&, ArchetypeBase const&);
friend bool operator!=(ArchetypeBase const&, ArchetypeBase const&);
friend bool operator<(ArchetypeBase const&, ArchetypeBase const&);
friend bool operator<=(ArchetypeBase const&, ArchetypeBase const&);
Expand Down
13 changes: 6 additions & 7 deletions folly/experimental/exception_tracer/ExceptionStackTraceLib.cpp
Expand Up @@ -66,10 +66,10 @@ void moveTopException(StackTraceStack& from, StackTraceStack& to) {

struct Initializer {
Initializer() {
registerCxaThrowCallback([](
void*, std::type_info*, void (*)(void*)) noexcept {
addActiveException();
});
registerCxaThrowCallback(
[](void*, std::type_info*, void (*)(void*)) noexcept {
addActiveException();
});

registerCxaBeginCatchCallback([](void*) noexcept {
moveTopException(activeExceptions, caughtExceptions);
Expand Down Expand Up @@ -101,9 +101,8 @@ struct Initializer {
}
});

registerRethrowExceptionCallback([](std::exception_ptr) noexcept {
addActiveException();
});
registerRethrowExceptionCallback(
[](std::exception_ptr) noexcept { addActiveException(); });

try {
::folly::exception_tracer::installHandlers();
Expand Down
15 changes: 6 additions & 9 deletions folly/functional/test/ApplyTupleTest.cpp
Expand Up @@ -499,9 +499,8 @@ TEST(IsNothrowApplicable, Basic) {
(folly::is_nothrow_applicable<decltype(f), std::tuple<int>>{}));
}
{
auto f = folly::overload([](int) noexcept {}, [](double) -> double {
return {};
});
auto f = folly::overload(
[](int) noexcept {}, [](double) -> double { return {}; });
EXPECT_FALSE(
(folly::is_nothrow_applicable<decltype(f), std::tuple<double>>{}));
EXPECT_TRUE((folly::is_nothrow_applicable<decltype(f), std::tuple<int>>{}));
Expand All @@ -520,9 +519,8 @@ TEST(IsApplicableR, Basic) {
(folly::is_applicable_r<double, decltype(f), std::tuple<int>>{}));
}
{
auto f = folly::overload([](int) noexcept {}, [](double) -> double {
return {};
});
auto f = folly::overload(
[](int) noexcept {}, [](double) -> double { return {}; });
EXPECT_TRUE(
(folly::is_applicable_r<float, decltype(f), std::tuple<double>>{}));
EXPECT_TRUE((folly::is_applicable_r<void, decltype(f), std::tuple<int>>{}));
Expand All @@ -545,9 +543,8 @@ TEST(IsNothrowApplicableR, Basic) {
is_nothrow_applicable_r<double, decltype(f), std::tuple<int>>{}));
}
{
auto f = folly::overload([](int) noexcept {}, [](double) -> double {
return {};
});
auto f = folly::overload(
[](int) noexcept {}, [](double) -> double { return {}; });
EXPECT_FALSE((
folly::
is_nothrow_applicable_r<float, decltype(f), std::tuple<double>>{}));
Expand Down
4 changes: 3 additions & 1 deletion folly/futures/test/SemiFutureTest.cpp
Expand Up @@ -699,7 +699,9 @@ TEST(SemiFuture, MakeSemiFutureFromFutureWithTry) {
}

namespace {
[[noreturn]] void deferHelper(folly::Try<folly::Unit>&&) { throw eggs; }
[[noreturn]] void deferHelper(folly::Try<folly::Unit>&&) {
throw eggs;
}
} // namespace

TEST(SemiFuture, DeferWithinContinuation) {
Expand Down
3 changes: 1 addition & 2 deletions folly/test/JsonTest.cpp
Expand Up @@ -243,8 +243,7 @@ TEST(Json, JsonNonAsciiEncoding) {

// multiple unicode encodings
EXPECT_EQ(
folly::json::serialize("\x1f\xe2\x82\xac", opts),
R"("\u001f\u20ac")");
folly::json::serialize("\x1f\xe2\x82\xac", opts), R"("\u001f\u20ac")");
EXPECT_EQ(
folly::json::serialize("\x1f\xc2\xa2\xe2\x82\xac", opts),
R"("\u001f\u00a2\u20ac")");
Expand Down

0 comments on commit f68a521

Please sign in to comment.