From ffab8e3f4613675ffd1c9133ee6dd36c07b5fe58 Mon Sep 17 00:00:00 2001 From: Andres Suarez Date: Thu, 20 May 2021 21:22:47 -0700 Subject: [PATCH] Apply clang-format Reviewed By: igorsugak Differential Revision: D28477074 fbshipit-source-id: f15dfc45b9fb30c661ebe2899cd882676d0fdf2a --- React/Base/RCTAssert.h | 22 +++++++++---------- .../first-party/yogajni/jni/YGJNIVanilla.cpp | 3 +-- .../renderer/core/tests/RawPropsTest.cpp | 21 ++++++++++-------- ReactCommon/yoga/yoga/Yoga.cpp | 8 ++----- 4 files changed, 26 insertions(+), 28 deletions(-) diff --git a/React/Base/RCTAssert.h b/React/Base/RCTAssert.h index 912d9237f91647..e4c77907f6e645 100644 --- a/React/Base/RCTAssert.h +++ b/React/Base/RCTAssert.h @@ -20,17 +20,17 @@ RCT_EXTERN BOOL RCTIsMainQueue(void); * assert handler through `RCTSetAssertFunction`. */ #ifndef NS_BLOCK_ASSERTIONS -#define RCTAssert(condition, ...) \ - do { \ - if ((condition) == 0) { \ - _RCTAssertFormat(#condition, __FILE__, __LINE__, __func__, __VA_ARGS__); \ - if (RCT_NSASSERT) { \ - [[NSAssertionHandler currentHandler] handleFailureInFunction:(NSString * _Nonnull) @(__func__) \ - file:(NSString * _Nonnull) @(__FILE__) \ - lineNumber:__LINE__ \ - description:__VA_ARGS__]; \ - } \ - } \ +#define RCTAssert(condition, ...) \ + do { \ + if ((condition) == 0) { \ + _RCTAssertFormat(#condition, __FILE__, __LINE__, __func__, __VA_ARGS__); \ + if (RCT_NSASSERT) { \ + [[NSAssertionHandler currentHandler] handleFailureInFunction:(NSString *_Nonnull)@(__func__) \ + file:(NSString *_Nonnull)@(__FILE__) \ + lineNumber:__LINE__ \ + description:__VA_ARGS__]; \ + } \ + } \ } while (false) #else #define RCTAssert(condition, ...) \ diff --git a/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp b/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp index 6534382116eb3c..3503be401f48c5 100644 --- a/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp +++ b/ReactAndroid/src/main/jni/first-party/yogajni/jni/YGJNIVanilla.cpp @@ -726,8 +726,7 @@ static void jni_YGNodePrintJNI(JNIEnv* env, jobject obj, jlong nativePointer) { const YGNodeRef node = _jlong2YGNodeRef(nativePointer); YGNodePrint( node, - (YGPrintOptions)( - YGPrintOptionsStyle | YGPrintOptionsLayout | YGPrintOptionsChildren)); + (YGPrintOptions) (YGPrintOptionsStyle | YGPrintOptionsLayout | YGPrintOptionsChildren)); #endif } diff --git a/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp b/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp index 7bb589914edd8d..2e54fc8bf02f88 100644 --- a/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp +++ b/ReactCommon/react/renderer/core/tests/RawPropsTest.cpp @@ -191,9 +191,10 @@ TEST(RawPropsTest, handleRawPropsSingleIntGetManyTimes) { } TEST(RawPropsTest, handleRawPropsPrimitiveTypes) { - const auto &raw = RawProps(folly::dynamic::object("intValue", (int)42)( - "doubleValue", (double)17.42)("floatValue", (float)66.67)( - "stringValue", "helloworld")("boolValue", true)); + const auto &raw = RawProps( + folly::dynamic::object("intValue", (int)42)("doubleValue", (double)17.42)( + "floatValue", + (float)66.67)("stringValue", "helloworld")("boolValue", true)); auto parser = RawPropsParser(); parser.prepare(); @@ -209,9 +210,10 @@ TEST(RawPropsTest, handleRawPropsPrimitiveTypes) { } TEST(RawPropsTest, handleRawPropsPrimitiveTypesGetTwice) { - const auto &raw = RawProps(folly::dynamic::object("intValue", (int)42)( - "doubleValue", (double)17.42)("floatValue", (float)66.67)( - "stringValue", "helloworld")("boolValue", true)); + const auto &raw = RawProps( + folly::dynamic::object("intValue", (int)42)("doubleValue", (double)17.42)( + "floatValue", + (float)66.67)("stringValue", "helloworld")("boolValue", true)); auto parser = RawPropsParser(); parser.prepare(); @@ -235,9 +237,10 @@ TEST(RawPropsTest, handleRawPropsPrimitiveTypesGetTwice) { } TEST(RawPropsTest, handleRawPropsPrimitiveTypesGetOutOfOrder) { - const auto &raw = RawProps(folly::dynamic::object("intValue", (int)42)( - "doubleValue", (double)17.42)("floatValue", (float)66.67)( - "stringValue", "helloworld")("boolValue", true)); + const auto &raw = RawProps( + folly::dynamic::object("intValue", (int)42)("doubleValue", (double)17.42)( + "floatValue", + (float)66.67)("stringValue", "helloworld")("boolValue", true)); auto parser = RawPropsParser(); parser.prepare(); diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp index 33f70e8292258e..2c68674a742933 100644 --- a/ReactCommon/yoga/yoga/Yoga.cpp +++ b/ReactCommon/yoga/yoga/Yoga.cpp @@ -4194,9 +4194,7 @@ YOGA_EXPORT void YGNodeCalculateLayoutWithContext( if (node->getConfig()->printTree) { YGNodePrint( node, - (YGPrintOptions)( - YGPrintOptionsLayout | YGPrintOptionsChildren | - YGPrintOptionsStyle)); + (YGPrintOptions) (YGPrintOptionsLayout | YGPrintOptionsChildren | YGPrintOptionsStyle)); } #endif } @@ -4256,9 +4254,7 @@ YOGA_EXPORT void YGNodeCalculateLayoutWithContext( if (nodeWithoutLegacyFlag->getConfig()->printTree) { YGNodePrint( nodeWithoutLegacyFlag, - (YGPrintOptions)( - YGPrintOptionsLayout | YGPrintOptionsChildren | - YGPrintOptionsStyle)); + (YGPrintOptions) (YGPrintOptionsLayout | YGPrintOptionsChildren | YGPrintOptionsStyle)); } #endif }