diff --git a/Firestore/core/src/local/index_backfiller.cc b/Firestore/core/src/local/index_backfiller.cc index b0be8be8fdf..1991031d4c6 100644 --- a/Firestore/core/src/local/index_backfiller.cc +++ b/Firestore/core/src/local/index_backfiller.cc @@ -13,6 +13,7 @@ // limitations under the License. #include +#include #include #include @@ -44,7 +45,7 @@ IndexBackfiller::IndexBackfiller() { max_documents_to_process_ = kMaxDocumentsToProcess; } -int IndexBackfiller::WriteIndexEntries(const LocalStore* local_store) { +size_t IndexBackfiller::WriteIndexEntries(const LocalStore* local_store) { IndexManager* index_manager = local_store->index_manager(); std::unordered_set processed_collection_groups; size_t documents_remaining = max_documents_to_process_; @@ -64,10 +65,10 @@ int IndexBackfiller::WriteIndexEntries(const LocalStore* local_store) { return max_documents_to_process_ - documents_remaining; } -int IndexBackfiller::WriteEntriesForCollectionGroup( +size_t IndexBackfiller::WriteEntriesForCollectionGroup( const LocalStore* local_store, const std::string& collection_group, - int documents_remaining_under_cap) const { + size_t documents_remaining_under_cap) const { IndexManager* index_manager = local_store->index_manager(); const auto* const local_documents_view = local_store->local_documents(); diff --git a/Firestore/core/src/local/index_backfiller.h b/Firestore/core/src/local/index_backfiller.h index 5ebd3aa8014..46c3ef1468d 100644 --- a/Firestore/core/src/local/index_backfiller.h +++ b/Firestore/core/src/local/index_backfiller.h @@ -15,6 +15,7 @@ #ifndef FIRESTORE_CORE_SRC_LOCAL_INDEX_BACKFILLER_H_ #define FIRESTORE_CORE_SRC_LOCAL_INDEX_BACKFILLER_H_ +#include #include namespace firebase { @@ -43,7 +44,7 @@ class IndexBackfiller { * Writes index entries until the cap is reached. Returns the number of * documents processed. */ - int WriteIndexEntries(const LocalStore* local_store); + size_t WriteIndexEntries(const LocalStore* local_store); private: friend class IndexBackfillerTest; @@ -53,9 +54,10 @@ class IndexBackfiller { * Writes entries for the provided collection group. Returns the number of * documents processed. */ - int WriteEntriesForCollectionGroup(const LocalStore* local_store, - const std::string& collection_group, - int documents_remaining_under_cap) const; + size_t WriteEntriesForCollectionGroup( + const LocalStore* local_store, + const std::string& collection_group, + size_t documents_remaining_under_cap) const; /** Returns the next offset based on the provided documents. */ model::IndexOffset GetNewOffset(const model::IndexOffset& existing_offset, diff --git a/Firestore/core/src/local/local_documents_view.cc b/Firestore/core/src/local/local_documents_view.cc index b4e2cd78807..d3812e42a5f 100644 --- a/Firestore/core/src/local/local_documents_view.cc +++ b/Firestore/core/src/local/local_documents_view.cc @@ -134,7 +134,7 @@ model::DocumentMap LocalDocumentsView::GetDocumentsMatchingCollectionGroupQuery( LocalWriteResult LocalDocumentsView::GetNextDocuments( const std::string& collection_group, const IndexOffset& offset, - int count) const { + size_t count) const { auto docs = remote_document_cache_->GetAll(collection_group, offset, count); auto overlays = count - docs.size() > 0 ? document_overlay_cache_->GetOverlays( diff --git a/Firestore/core/src/local/local_documents_view.h b/Firestore/core/src/local/local_documents_view.h index 7fc12b378fa..549656dc44e 100644 --- a/Firestore/core/src/local/local_documents_view.h +++ b/Firestore/core/src/local/local_documents_view.h @@ -17,6 +17,7 @@ #ifndef FIRESTORE_CORE_SRC_LOCAL_LOCAL_DOCUMENTS_VIEW_H_ #define FIRESTORE_CORE_SRC_LOCAL_LOCAL_DOCUMENTS_VIEW_H_ +#include #include #include #include @@ -98,7 +99,7 @@ class LocalDocumentsView { */ local::LocalWriteResult GetNextDocuments(const std::string& collection_group, const model::IndexOffset& offset, - int count) const; + size_t count) const; /** * Similar to `GetDocuments`, but creates the local view from the given diff --git a/Firestore/core/src/remote/bloom_filter.cc b/Firestore/core/src/remote/bloom_filter.cc index ddf84b866e9..0e4c8e04f34 100644 --- a/Firestore/core/src/remote/bloom_filter.cc +++ b/Firestore/core/src/remote/bloom_filter.cc @@ -78,7 +78,7 @@ int32_t BloomFilter::GetBitIndex(const Hash& hash, int32_t hash_index) const { uint64_t bit_index = combined_hash % bit_count_uint64; HARD_ASSERT(bit_index <= INT32_MAX); - return bit_index; + return static_cast(bit_index); } bool BloomFilter::IsBitSet(int32_t index) const {