Skip to content

Commit

Permalink
Apply clang-format
Browse files Browse the repository at this point in the history
Reviewed By: igorsugak

Differential Revision: D28477074

fbshipit-source-id: f15dfc45b9fb30c661ebe2899cd882676d0fdf2a
  • Loading branch information
zertosh authored and facebook-github-bot committed May 21, 2021
1 parent a657c26 commit ffab8e3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 28 deletions.
22 changes: 11 additions & 11 deletions React/Base/RCTAssert.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
21 changes: 12 additions & 9 deletions ReactCommon/react/renderer/core/tests/RawPropsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<PropsPrimitiveTypes>();
Expand All @@ -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<PropsPrimitiveTypes>();
Expand All @@ -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<PropsPrimitiveTypes>();
Expand Down
8 changes: 2 additions & 6 deletions ReactCommon/yoga/yoga/Yoga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4194,9 +4194,7 @@ YOGA_EXPORT void YGNodeCalculateLayoutWithContext(
if (node->getConfig()->printTree) {
YGNodePrint(
node,
(YGPrintOptions)(
YGPrintOptionsLayout | YGPrintOptionsChildren |
YGPrintOptionsStyle));
(YGPrintOptions) (YGPrintOptionsLayout | YGPrintOptionsChildren | YGPrintOptionsStyle));
}
#endif
}
Expand Down Expand Up @@ -4256,9 +4254,7 @@ YOGA_EXPORT void YGNodeCalculateLayoutWithContext(
if (nodeWithoutLegacyFlag->getConfig()->printTree) {
YGNodePrint(
nodeWithoutLegacyFlag,
(YGPrintOptions)(
YGPrintOptionsLayout | YGPrintOptionsChildren |
YGPrintOptionsStyle));
(YGPrintOptions) (YGPrintOptionsLayout | YGPrintOptionsChildren | YGPrintOptionsStyle));
}
#endif
}
Expand Down

0 comments on commit ffab8e3

Please sign in to comment.