From 0e2d636865003feb91d50852f87d0926e75043ec Mon Sep 17 00:00:00 2001 From: Marek Gilbert Date: Wed, 17 Jan 2018 10:43:25 -0800 Subject: [PATCH] Fix CMake build and lint warnings in field_value.cc Fixes these cpplint warnings: Firestore/core/src/firebase/firestore/model/field_value.cc:162: Semicolon defining empty statement. Use {} instead. [whitespace/semicolon] [5] Firestore/core/src/firebase/firestore/model/field_value.cc:170: Semicolon defining empty statement. Use {} instead. [whitespace/semicolon] [5] Firestore/core/src/firebase/firestore/model/field_value.cc:126: Add #include for swap [build/include_what_you_use] [4] --- .../core/src/firebase/firestore/model/CMakeLists.txt | 11 +++++------ .../core/src/firebase/firestore/model/field_value.cc | 5 +++-- .../core/test/firebase/firestore/model/CMakeLists.txt | 9 ++++----- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Firestore/core/src/firebase/firestore/model/CMakeLists.txt b/Firestore/core/src/firebase/firestore/model/CMakeLists.txt index 1beb3bb5195..ae80de3a735 100644 --- a/Firestore/core/src/firebase/firestore/model/CMakeLists.txt +++ b/Firestore/core/src/firebase/firestore/model/CMakeLists.txt @@ -12,11 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -add_library( +cc_library( firebase_firestore_model - field_value.cc -) -target_link_libraries( - firebase_firestore_model - firebase_firestore_util + SOURCES + field_value.cc + DEPENDS + firebase_firestore_util ) diff --git a/Firestore/core/src/firebase/firestore/model/field_value.cc b/Firestore/core/src/firebase/firestore/model/field_value.cc index 5a19549e951..45886bf2a9c 100644 --- a/Firestore/core/src/firebase/firestore/model/field_value.cc +++ b/Firestore/core/src/firebase/firestore/model/field_value.cc @@ -18,6 +18,7 @@ #include #include +#include #include #include "Firestore/core/src/firebase/firestore/util/firebase_assert.h" @@ -159,7 +160,7 @@ void FieldValue::SwitchTo(const Type type) { case Type::Array: array_value_.~vector(); break; - default:; // The other types where there is nothing to worry about. + default: {} // The other types where there is nothing to worry about. } tag_ = type; // Must call constructor explicitly for any non-POD type to initialize. @@ -167,7 +168,7 @@ void FieldValue::SwitchTo(const Type type) { case Type::Array: new (&array_value_) std::vector(); break; - default:; // The other types where there is nothing to worry about. + default: {} // The other types where there is nothing to worry about. } } diff --git a/Firestore/core/test/firebase/firestore/model/CMakeLists.txt b/Firestore/core/test/firebase/firestore/model/CMakeLists.txt index f5d9c2cdb5f..31fe040a6b3 100644 --- a/Firestore/core/test/firebase/firestore/model/CMakeLists.txt +++ b/Firestore/core/test/firebase/firestore/model/CMakeLists.txt @@ -14,9 +14,8 @@ cc_test( firebase_firestore_model_test - field_value_test.cc -) -target_link_libraries( - firebase_firestore_model_test - firebase_firestore_model + SOURCES + field_value_test.cc + DEPENDS + firebase_firestore_model )