Skip to content

Commit 90b7391

Browse files
committed
clang-format.
1 parent 63b6865 commit 90b7391

File tree

12 files changed

+828
-698
lines changed

12 files changed

+828
-698
lines changed

Firestore/Source/API/FIRDecimal128Value.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#include "Firestore/core/src/util/quadruple.h"
2020
#include "Firestore/core/src/util/string_apple.h"
2121

22-
using firebase::firestore::util::Quadruple;
2322
using firebase::firestore::util::MakeString;
23+
using firebase::firestore::util::Quadruple;
2424

2525
@implementation FIRDecimal128Value
2626

Firestore/Swift/Tests/Integration/TypeTest.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,17 @@ class TypeTest: FSTIntegrationTestCase {
138138
}
139139

140140
func testDecimal128ValueEquality() {
141-
let v1 = Decimal128Value("1.2e3");
142-
let v2 = Decimal128Value("12e2");
143-
let v3 = Decimal128Value("0.12e4");
144-
let v4 = Decimal128Value("12000e-1");
145-
let v5 = Decimal128Value("1.2");
141+
let v1 = Decimal128Value("1.2e3")
142+
let v2 = Decimal128Value("12e2")
143+
let v3 = Decimal128Value("0.12e4")
144+
let v4 = Decimal128Value("12000e-1")
145+
let v5 = Decimal128Value("1.2")
146146

147147
XCTAssertTrue(v1 == v2)
148148
XCTAssertTrue(v1 == v3)
149149
XCTAssertTrue(v1 == v4)
150150
XCTAssertFalse(v1 == v5)
151-
151+
152152
XCTAssertFalse(v1 != v2)
153153
XCTAssertFalse(v1 != v3)
154154
XCTAssertFalse(v1 != v4)

Firestore/core/src/model/value_util.cc

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,20 +261,25 @@ void SortFields(google_firestore_v1_Value& value) {
261261
}
262262
}
263263

264-
Quadruple ConvertNumericValueToQuadruple(const google_firestore_v1_Value& value) {
264+
Quadruple ConvertNumericValueToQuadruple(
265+
const google_firestore_v1_Value& value) {
265266
if (value.which_value_type == google_firestore_v1_Value_double_value_tag) {
266267
return Quadruple(value.double_value);
267-
} else if (value.which_value_type == google_firestore_v1_Value_integer_value_tag) {
268+
} else if (value.which_value_type ==
269+
google_firestore_v1_Value_integer_value_tag) {
268270
return Quadruple(value.integer_value);
269271
} else if (IsInt32Value(value)) {
270272
return Quadruple(value.map_value.fields[0].value.integer_value);
271273
} else if (IsDecimal128Value(value)) {
272274
Quadruple result;
273-
result.Parse(nanopb::MakeString(value.map_value.fields[0].value.string_value));
275+
result.Parse(
276+
nanopb::MakeString(value.map_value.fields[0].value.string_value));
274277
return result;
275278
}
276279

277-
HARD_FAIL("ConvertNumericValueToQuadruple was called with non-numeric value: %s", value.ToString());
280+
HARD_FAIL(
281+
"ConvertNumericValueToQuadruple was called with non-numeric value: %s",
282+
value.ToString());
278283
}
279284

280285
ComparisonResult Compare128BitNumbers(const google_firestore_v1_Value& left,

Firestore/core/src/util/quadruple.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
// limitations under the License.
1414

1515
#include "quadruple.h"
16-
#include "quadruple_builder.h"
1716
#include <ctype.h>
1817
#include <stdint.h>
1918
#include <cmath>
2019
#include <limits>
20+
#include "quadruple_builder.h"
2121

2222
namespace firebase {
2323
namespace firestore {
@@ -99,7 +99,7 @@ bool Quadruple::Parse(std::string s) {
9999
mantissa_lo_ = 0;
100100
return true;
101101
}
102-
if (s == "-Infinity") {
102+
if (s == "-Infinity") {
103103
negative_ = true;
104104
exponent_ = kInfiniteExponent;
105105
mantissa_hi_ = 0;
@@ -127,7 +127,7 @@ bool Quadruple::Parse(std::string s) {
127127
i++;
128128
}
129129
}
130-
//int firstDigit = i;
130+
// int firstDigit = i;
131131
while (i < len && isdigit(s[i])) {
132132
digits[j++] = static_cast<uint8_t>(s[i++] - '0');
133133
}

Firestore/core/src/util/quadruple.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
// limitations under the License.
1414

1515
#include <stdint.h>
16-
#include <string>
1716
#include <iomanip>
1817
#include <ios>
1918
#include <sstream>
19+
#include <string>
2020

2121
#ifndef FIRESTORE_CORE_UTIL_QUADRUPLE_H_
2222
#define FIRESTORE_CORE_UTIL_QUADRUPLE_H_
@@ -35,14 +35,17 @@ namespace util {
3535
class Quadruple {
3636
public:
3737
// Initialises a Quadruple to +0.0
38-
Quadruple() : Quadruple(0, 0, 0) {}
38+
Quadruple() : Quadruple(0, 0, 0) {
39+
}
3940

40-
Quadruple(uint64_t exponent_and_sign, uint64_t mantissa_hi,
41+
Quadruple(uint64_t exponent_and_sign,
42+
uint64_t mantissa_hi,
4143
uint64_t mantissa_lo)
4244
: negative_(exponent_and_sign >> 63),
4345
exponent_(static_cast<uint32_t>(exponent_and_sign)),
4446
mantissa_hi_(mantissa_hi),
45-
mantissa_lo_(mantissa_lo) {}
47+
mantissa_lo_(mantissa_lo) {
48+
}
4649
explicit Quadruple(double x);
4750
explicit Quadruple(int64_t x);
4851
// Updates this Quadruple with the decimal number specified in s.
@@ -58,7 +61,9 @@ class Quadruple {
5861
explicit operator double() const;
5962
// Compare two quadruples, with -0 < 0, and NaNs larger than all numbers.
6063
int Compare(const Quadruple& other) const;
61-
bool operator==(const Quadruple& other) const { return Compare(other) == 0; }
64+
bool operator==(const Quadruple& other) const {
65+
return Compare(other) == 0;
66+
}
6267
bool is_nan() const {
6368
return (exponent_ == kInfiniteExponent) &&
6469
!(mantissa_hi_ == 0 && mantissa_lo_ == 0);
@@ -79,6 +84,7 @@ class Quadruple {
7984

8085
return out.str();
8186
}
87+
8288
private:
8389
static const uint32_t kInfiniteExponent = 0xFFFFFFFF; // including its bias
8490
bool negative_;

0 commit comments

Comments
 (0)