diff options
author | Gil <mcg@google.com> | 2018-04-12 14:54:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-12 14:54:53 -0700 |
commit | 8876622b6fcebc21672bc263666b858b7e152b45 (patch) | |
tree | 053fe00a20207099c11c1464df25565a5f5cc3c6 /Firestore/core/src/firebase/firestore/remote | |
parent | 1397e4ae72ea3b8d16a9b44ed1235caca47b3d9e (diff) |
Add clang-tidy checks for Firestore (#1078)
* Add a .clang-tidy configuration for Firestore C++
* Fix clang-tidy warnings
* typedef -> using
* const ref + rvalue ref -> pass by value
* NULL -> nullptr
* remove useless default initializations
* remove useless const value-type parameter declarations (definitions
can still use them)
* use auto instead of repeating types in a cast
* Fix typos
* Address use of static method through instance warnings
* Address use after move warnings
Diffstat (limited to 'Firestore/core/src/firebase/firestore/remote')
-rw-r--r-- | Firestore/core/src/firebase/firestore/remote/serializer.cc | 2 | ||||
-rw-r--r-- | Firestore/core/src/firebase/firestore/remote/serializer.h | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/Firestore/core/src/firebase/firestore/remote/serializer.cc b/Firestore/core/src/firebase/firestore/remote/serializer.cc index 805e7ac..befe032 100644 --- a/Firestore/core/src/firebase/firestore/remote/serializer.cc +++ b/Firestore/core/src/firebase/firestore/remote/serializer.cc @@ -294,7 +294,7 @@ void Writer::WriteVarint(uint64_t value) { * Note that (despite the return type) this works for bool, enum, int32, int64, * uint32 and uint64 proto field types. * - * Note: This is not expected to be called direclty, but rather only via the + * Note: This is not expected to be called directly, but rather only via the * other Decode* methods (i.e. DecodeBool, DecodeLong, etc) * * @return The decoded varint as a uint64_t. diff --git a/Firestore/core/src/firebase/firestore/remote/serializer.h b/Firestore/core/src/firebase/firestore/remote/serializer.h index 3b2b667..7541ef5 100644 --- a/Firestore/core/src/firebase/firestore/remote/serializer.h +++ b/Firestore/core/src/firebase/firestore/remote/serializer.h @@ -72,7 +72,7 @@ class Serializer { // TODO(rsgowman): If we never support any output except to a vector, it may // make sense to have Serializer own the vector and provide an accessor rather // than asking the user to create it first. - static util::Status EncodeFieldValue( + util::Status EncodeFieldValue( const firebase::firestore::model::FieldValue& field_value, std::vector<uint8_t>* out_bytes); @@ -84,8 +84,7 @@ class Serializer { * @return The model equivalent of the bytes. */ // TODO(rsgowman): error handling. - static firebase::firestore::model::FieldValue DecodeFieldValue( - const uint8_t* bytes, size_t length); + model::FieldValue DecodeFieldValue(const uint8_t* bytes, size_t length); /** * @brief Converts from bytes to the model FieldValue format. @@ -95,14 +94,13 @@ class Serializer { * @return The model equivalent of the bytes. */ // TODO(rsgowman): error handling. - static firebase::firestore::model::FieldValue DecodeFieldValue( - const std::vector<uint8_t>& bytes) { + model::FieldValue DecodeFieldValue(const std::vector<uint8_t>& bytes) { return DecodeFieldValue(bytes.data(), bytes.size()); } private: // TODO(rsgowman): We don't need the database_id_ yet (but will eventually). - // const firebase::firestore::model::DatabaseId& database_id_; + // model::DatabaseId* database_id_; }; } // namespace remote |