Skip to content

Commit 04c8c9b

Browse files
committed
Use fixed-sized types
Should have caught this during review, but cpplint caught it
1 parent 856c3a0 commit 04c8c9b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Firestore/core/src/firebase/firestore/model/timestamp.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace firebase {
2424
namespace firestore {
2525
namespace model {
2626

27-
Timestamp::Timestamp(long seconds, int nanos)
27+
Timestamp::Timestamp(int64_t seconds, int32_t nanos)
2828
: seconds_(seconds), nanos_(nanos) {
2929
FIREBASE_ASSERT_MESSAGE_WITH_EXPRESSION(
3030
nanos >= 0, nanos >= 0, "timestamp nanoseconds out of range: %d", nanos);

Firestore/core/src/firebase/firestore/model/timestamp.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,22 @@ class Timestamp {
4343
* @param seconds the number of seconds since epoch.
4444
* @param nanos the number of nanoseconds after the seconds.
4545
*/
46-
Timestamp(long seconds, int nanos);
46+
Timestamp(int64_t seconds, int32_t nanos);
4747

4848
/** Returns a timestamp with the current date / time. */
4949
static Timestamp Now();
5050

51-
long seconds() const {
51+
int64_t seconds() const {
5252
return seconds_;
5353
}
5454

55-
int nanos() const {
55+
int32_t nanos() const {
5656
return nanos_;
5757
}
5858

5959
private:
60-
long seconds_;
61-
int nanos_;
60+
int64_t seconds_;
61+
int32_t nanos_;
6262
};
6363

6464
/** Compares against another Timestamp. */
@@ -91,4 +91,4 @@ inline bool operator==(const Timestamp& lhs, const Timestamp& rhs) {
9191
} // namespace firestore
9292
} // namespace firebase
9393

94-
#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_VALUE_H_
94+
#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_TIMESTAMP_H_

0 commit comments

Comments
 (0)