Skip to content

Use fixed-sized types #719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Firestore/core/src/firebase/firestore/model/timestamp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace firebase {
namespace firestore {
namespace model {

Timestamp::Timestamp(long seconds, int nanos)
Timestamp::Timestamp(int64_t seconds, int32_t nanos)
: seconds_(seconds), nanos_(nanos) {
FIREBASE_ASSERT_MESSAGE_WITH_EXPRESSION(
nanos >= 0, nanos >= 0, "timestamp nanoseconds out of range: %d", nanos);
Expand Down
12 changes: 6 additions & 6 deletions Firestore/core/src/firebase/firestore/model/timestamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,22 @@ class Timestamp {
* @param seconds the number of seconds since epoch.
* @param nanos the number of nanoseconds after the seconds.
*/
Timestamp(long seconds, int nanos);
Timestamp(int64_t seconds, int32_t nanos);

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

long seconds() const {
int64_t seconds() const {
return seconds_;
}

int nanos() const {
int32_t nanos() const {
return nanos_;
}

private:
long seconds_;
int nanos_;
int64_t seconds_;
int32_t nanos_;
};

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

#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_VALUE_H_
#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_TIMESTAMP_H_