aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Michael Lehenbauer <mikelehen@gmail.com>2018-01-10 09:28:44 -0800
committerGravatar GitHub <noreply@github.com>2018-01-10 09:28:44 -0800
commitdc0b29e9cf7febe201a3845782655ec80d9e19f4 (patch)
tree915ff0260b366e0613f44453a56576586c05fab1
parentd6bf54e2872801bc915ffd695bf2aa3051ae22ab (diff)
Run style.sh (#636)
Run style.sh (w/ clang-format version 6)
-rw-r--r--Firestore/Example/Tests/Integration/API/FIRTypeTests.m3
-rw-r--r--Firestore/Example/Tests/Integration/API/FIRValidationTests.m2
-rw-r--r--Firestore/Example/Tests/Remote/FSTSerializerBetaTests.m3
-rw-r--r--Firestore/Source/Local/FSTLevelDB.mm4
-rw-r--r--Firestore/Source/Model/FSTPath.m2
-rw-r--r--Firestore/core/src/firebase/firestore/util/assert_apple.mm13
-rw-r--r--Firestore/core/src/firebase/firestore/util/assert_stdio.cc7
-rw-r--r--Firestore/core/src/firebase/firestore/util/firebase_assert.h41
-rw-r--r--Firestore/core/src/firebase/firestore/util/string_apple.h10
-rw-r--r--Firestore/core/src/firebase/firestore/util/string_printf.h3
10 files changed, 51 insertions, 37 deletions
diff --git a/Firestore/Example/Tests/Integration/API/FIRTypeTests.m b/Firestore/Example/Tests/Integration/API/FIRTypeTests.m
index 638835f..1874f00 100644
--- a/Firestore/Example/Tests/Integration/API/FIRTypeTests.m
+++ b/Firestore/Example/Tests/Integration/API/FIRTypeTests.m
@@ -40,7 +40,8 @@
- (void)testCanReadAndWriteArrayFields {
[self assertSuccessfulRoundtrip:@{
- @"array" : @[ @1, @"foo", @{@"deep" : @YES}, [NSNull null] ]
+ @"array" : @[ @1, @"foo",
+ @{ @"deep" : @YES }, [NSNull null] ]
}];
}
diff --git a/Firestore/Example/Tests/Integration/API/FIRValidationTests.m b/Firestore/Example/Tests/Integration/API/FIRValidationTests.m
index a318c47..8b760c9 100644
--- a/Firestore/Example/Tests/Integration/API/FIRValidationTests.m
+++ b/Firestore/Example/Tests/Integration/API/FIRValidationTests.m
@@ -169,7 +169,7 @@
}
- (void)testWritesWithIndirectlyNestedArraysSucceed {
- NSDictionary<NSString *, id> *data = @{ @"nested-array" : @[ @1, @{@"foo" : @[ @2 ]} ] };
+ NSDictionary<NSString *, id> *data = @{ @"nested-array" : @[ @1, @{ @"foo" : @[ @2 ] } ] };
FIRDocumentReference *ref = [self documentRef];
FIRDocumentReference *ref2 = [self documentRef];
diff --git a/Firestore/Example/Tests/Remote/FSTSerializerBetaTests.m b/Firestore/Example/Tests/Remote/FSTSerializerBetaTests.m
index bba04c5..61847b0 100644
--- a/Firestore/Example/Tests/Remote/FSTSerializerBetaTests.m
+++ b/Firestore/Example/Tests/Remote/FSTSerializerBetaTests.m
@@ -267,7 +267,8 @@ NS_ASSUME_NONNULL_BEGIN
@"i" : @1,
@"n" : [NSNull null],
@"s" : @"foo",
- @"a" : @[ @2, @"bar", @{@"b" : @NO} ],
+ @"a" : @[ @2, @"bar",
+ @{ @"b" : @NO } ],
@"o" : @{
@"d" : @100,
@"nested" : @{@"e" : @(LLONG_MIN)},
diff --git a/Firestore/Source/Local/FSTLevelDB.mm b/Firestore/Source/Local/FSTLevelDB.mm
index fb1c81a..83b932c 100644
--- a/Firestore/Source/Local/FSTLevelDB.mm
+++ b/Firestore/Source/Local/FSTLevelDB.mm
@@ -72,8 +72,8 @@ using leveldb::WriteOptions;
#else
#error "local storage on tvOS"
-// TODO(mcg): Writing to NSDocumentsDirectory on tvOS will fail; we need to write to Caches
-// https://developer.apple.com/library/content/documentation/General/Conceptual/AppleTV_PG/
+ // TODO(mcg): Writing to NSDocumentsDirectory on tvOS will fail; we need to write to Caches
+ // https://developer.apple.com/library/content/documentation/General/Conceptual/AppleTV_PG/
#endif
}
diff --git a/Firestore/Source/Model/FSTPath.m b/Firestore/Source/Model/FSTPath.m
index b236107..636c322 100644
--- a/Firestore/Source/Model/FSTPath.m
+++ b/Firestore/Source/Model/FSTPath.m
@@ -240,7 +240,7 @@ NS_ASSUME_NONNULL_BEGIN
c = *source++;
// TODO(b/37244157): Make this a user-facing exception once we finalize field escaping.
FSTAssert(c != '\0', @"Trailing escape characters not allowed in %@", fieldPath);
- // Fall through
+ // Fall through
default:
// copy into the current segment
diff --git a/Firestore/core/src/firebase/firestore/util/assert_apple.mm b/Firestore/core/src/firebase/firestore/util/assert_apple.mm
index 0447d6c..83b76e1 100644
--- a/Firestore/core/src/firebase/firestore/util/assert_apple.mm
+++ b/Firestore/core/src/firebase/firestore/util/assert_apple.mm
@@ -26,16 +26,23 @@ namespace firebase {
namespace firestore {
namespace util {
-void FailAssert(const char* file, const char* func, const int line, const char* format, ...) {
+void FailAssert(const char* file,
+ const char* func,
+ const int line,
+ const char* format,
+ ...) {
va_list args;
va_start(args, format);
- NSString *description = [[NSString alloc] initWithFormat:WrapNSStringNoCopy(format) arguments:args];
+ NSString* description =
+ [[NSString alloc] initWithFormat:WrapNSStringNoCopy(format)
+ arguments:args];
va_end(args);
[[NSAssertionHandler currentHandler]
handleFailureInFunction:WrapNSStringNoCopy(func)
file:WrapNSStringNoCopy(file)
lineNumber:line
- description:@"FIRESTORE INTERNAL ASSERTION FAILED: %@", description];
+ description:@"FIRESTORE INTERNAL ASSERTION FAILED: %@",
+ description];
abort();
}
diff --git a/Firestore/core/src/firebase/firestore/util/assert_stdio.cc b/Firestore/core/src/firebase/firestore/util/assert_stdio.cc
index b5d0b7c..5476e65 100644
--- a/Firestore/core/src/firebase/firestore/util/assert_stdio.cc
+++ b/Firestore/core/src/firebase/firestore/util/assert_stdio.cc
@@ -29,8 +29,11 @@ namespace firebase {
namespace firestore {
namespace util {
-void FailAssert(const char* file, const char* func, const int line,
- const char* format, ...) {
+void FailAssert(const char* file,
+ const char* func,
+ const int line,
+ const char* format,
+ ...) {
std::string message;
StringAppendF(&message, "ASSERT: %s(%d) %s: ", file, line, func);
diff --git a/Firestore/core/src/firebase/firestore/util/firebase_assert.h b/Firestore/core/src/firebase/firestore/util/firebase_assert.h
index 9f1bce8..da01864 100644
--- a/Firestore/core/src/firebase/firestore/util/firebase_assert.h
+++ b/Firestore/core/src/firebase/firestore/util/firebase_assert.h
@@ -35,14 +35,14 @@
// Assert condition is true, if it's false log an assert with the specified
// expression as a string.
-#define FIREBASE_ASSERT_WITH_EXPRESSION(condition, expression) \
- do { \
- if (!(condition)) { \
- firebase::firestore::util::FailAssert( \
- __FILE__, __PRETTY_FUNCTION__, __LINE__, \
- FIREBASE_EXPAND_STRINGIFY(expression)); \
- } \
- } while(0)
+#define FIREBASE_ASSERT_WITH_EXPRESSION(condition, expression) \
+ do { \
+ if (!(condition)) { \
+ firebase::firestore::util::FailAssert( \
+ __FILE__, __PRETTY_FUNCTION__, __LINE__, \
+ FIREBASE_EXPAND_STRINGIFY(expression)); \
+ } \
+ } while (0)
// Assert condition is true, if it's false log an assert with the specified
// expression as a string. Compiled out of release builds.
@@ -65,15 +65,15 @@
// Assert condition is true otherwise display the specified expression,
// message and abort.
-#define FIREBASE_ASSERT_MESSAGE_WITH_EXPRESSION(condition, expression, ...) \
- do { \
- if (!(condition)) { \
- firebase::firestore::util::LogError( \
- FIREBASE_EXPAND_STRINGIFY(expression)); \
- firebase::firestore::util::FailAssert( \
- __FILE__, __PRETTY_FUNCTION__, __LINE__, __VA_ARGS__); \
- } \
- } while(0)
+#define FIREBASE_ASSERT_MESSAGE_WITH_EXPRESSION(condition, expression, ...) \
+ do { \
+ if (!(condition)) { \
+ firebase::firestore::util::LogError( \
+ FIREBASE_EXPAND_STRINGIFY(expression)); \
+ firebase::firestore::util::FailAssert(__FILE__, __PRETTY_FUNCTION__, \
+ __LINE__, __VA_ARGS__); \
+ } \
+ } while (0)
// Assert condition is true otherwise display the specified expression,
// message and abort. Compiled out of release builds.
@@ -92,8 +92,11 @@ namespace firestore {
namespace util {
// A no-return helper function. To raise an assertion, use Macro instead.
-void FailAssert(const char* file, const char* func, const int line,
- const char* format, ...);
+void FailAssert(const char* file,
+ const char* func,
+ const int line,
+ const char* format,
+ ...);
} // namespace util
} // namespace firestore
diff --git a/Firestore/core/src/firebase/firestore/util/string_apple.h b/Firestore/core/src/firebase/firestore/util/string_apple.h
index 42b51dd..e1be8c3 100644
--- a/Firestore/core/src/firebase/firestore/util/string_apple.h
+++ b/Firestore/core/src/firebase/firestore/util/string_apple.h
@@ -25,13 +25,13 @@ namespace util {
// Translates a C string to the equivalent NSString without making a copy.
inline NSString* WrapNSStringNoCopy(const char* c_str) {
- return [[NSString alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(c_str))
- length:strlen(c_str)
- encoding:NSUTF8StringEncoding
- freeWhenDone:NO];
+ return [[NSString alloc]
+ initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(c_str))
+ length:strlen(c_str)
+ encoding:NSUTF8StringEncoding
+ freeWhenDone:NO];
}
-
} // namespace util
} // namespace firestore
} // namespace firebase
diff --git a/Firestore/core/src/firebase/firestore/util/string_printf.h b/Firestore/core/src/firebase/firestore/util/string_printf.h
index 9e2b9c0..d15296e 100644
--- a/Firestore/core/src/firebase/firestore/util/string_printf.h
+++ b/Firestore/core/src/firebase/firestore/util/string_printf.h
@@ -28,8 +28,7 @@ namespace firestore {
namespace util {
/** Return a C++ string. */
-std::string StringPrintf(const char* format, ...)
- ABSL_PRINTF_ATTRIBUTE(1, 2);
+std::string StringPrintf(const char* format, ...) ABSL_PRINTF_ATTRIBUTE(1, 2);
/** Append result to a supplied string. */
void StringAppendF(std::string* dst, const char* format, ...)