Skip to content

Commit

Permalink
Make the project build on XCode 14.3 (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
pasin authored Sep 18, 2023
1 parent 0651b69 commit d6d2541
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/CBLBlob_CAPI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ CBLBlob* CBLBlob_CreateWithStream(FLString contentType,
CBLBlobWriteStream* writer) noexcept
{
try {
return retain(new CBLNewBlob(contentType, move(*writer)));
return retain(new CBLNewBlob(contentType, std::move(*writer)));
} catchAndWarn()
}

Expand Down
3 changes: 2 additions & 1 deletion src/CBLBlob_Internal.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "c4Document.hh"
#include "fleece/Fleece.hh"
#include "fleece/Mutable.hh"
#include <algorithm>
#include <mutex>
#include "betterassert.hh"

Expand Down Expand Up @@ -225,7 +226,7 @@ struct CBLBlobReadStream {
}
if (pos < 0)
C4Error::raise(LiteCoreDomain, kC4ErrorInvalidParameter, "Seek to negative position");
pos = std::min(pos, _c4stream.getLength());
pos = std::min(pos, (int64_t) _c4stream.getLength());
_c4stream.seek(pos);
_pos = pos;
return pos;
Expand Down
4 changes: 2 additions & 2 deletions src/CBLDatabase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Retained<CBLScope> CBLDatabase::getScope(slice scopeName) {
if (!scope && exist) {
auto retainedScope = make_retained<CBLScope>(scopeName, this);
scope = retainedScope.get();
_scopes.insert({scope->name(), move(retainedScope)});
_scopes.insert({scope->name(), std::move(retainedScope)});
}

return scope;
Expand Down Expand Up @@ -289,7 +289,7 @@ Retained<CBLCollection> CBLDatabase::createCBLCollection(C4Collection* c4col, CB
auto retainedCollection = make_retained<CBLCollection>(c4col, scope, const_cast<CBLDatabase*>(this));
auto collection = retainedCollection.get();
if (cache) {
_collections.insert({C4Database::CollectionSpec(c4col->getSpec()), move(retainedCollection)});
_collections.insert({C4Database::CollectionSpec(c4col->getSpec()), std::move(retainedCollection)});
}
return collection;
}
Expand Down
2 changes: 1 addition & 1 deletion src/CBLDocument.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ bool CBLDocument::save(CBLCollection* collection, const SaveOptions &opt) {
t.commit();
_collection = collection;
// HACK: Replace the inner reference of the c4doc with the one from newDoc.
c4doc.get() = move(newDoc);
c4doc.get() = std::move(newDoc);
_revID = c4doc->selectedRev().revID;
success = true;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/CBLQuery_CAPI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ CBLQuery* CBLDatabase_CreateQuery(const CBLDatabase* db,
C4Error::set(LiteCoreDomain, kC4ErrorInvalidQuery, {}, internal(outError));
return nullptr;
}
return move(query).detach();
return std::move(query).detach();
} catchAndBridge(outError)
}

Expand Down
2 changes: 1 addition & 1 deletion src/ConflictResolver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace cbl_internal {
:_collection(collection)
,_clientResolver(customResolver)
,_clientResolverContext(context)
,_docID(move(docID))
,_docID(std::move(docID))
{
//SyncLog(Info, "ConflictResolver %p on %.*s", this, _docID.c_str());
}
Expand Down
1 change: 1 addition & 0 deletions src/Internal.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#pragma once
#include "CBLBase.h"
#include "CBLPlatform.h"
#include "c4Base.h"
#include "c4Base.hh"
#include "fleece/slice.hh"
#include "fleece/Fleece.hh"
Expand Down
4 changes: 2 additions & 2 deletions src/Listener.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void NotificationQueue::setCallback(CBLNotificationsReadyCallback callback, void
auto pending = _state.useLocked<Notifications>([&](State &state) {
state.callback = callback;
state.context = context;
return callback ? nullptr : move(state.queue);
return callback ? nullptr : std::move(state.queue);
});
call(pending);
}
Expand Down Expand Up @@ -74,7 +74,7 @@ void NotificationQueue::add(Notification notification) {


void NotificationQueue::notifyAll() {
auto queue = move(_state.useLocked()->queue);
auto queue = std::move(_state.useLocked()->queue);
call(queue);
}

Expand Down
6 changes: 3 additions & 3 deletions test/CollectionTest_Cpp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ TEST_CASE_METHOD(CBLTest_Cpp, "Collection Listener Token") {
CHECK(listenerToken.token() == listener);

// Move Constructor:
ListenerToken<> listenerToken2 = move(listenerToken);
ListenerToken<> listenerToken2 = std::move(listenerToken);
REQUIRE(listenerToken2.context());
(*(ListenerToken<>::Callback*)listenerToken2.context())();
CHECK(num == 2);
Expand All @@ -471,7 +471,7 @@ TEST_CASE_METHOD(CBLTest_Cpp, "Collection Listener Token") {
#endif

// Move Assignment:
listenerToken = move(listenerToken2);
listenerToken = std::move(listenerToken2);
REQUIRE(listenerToken.context());
(*(ListenerToken<>::Callback*)listenerToken.context())();
CHECK(num == 3);
Expand All @@ -488,4 +488,4 @@ TEST_CASE_METHOD(CBLTest_Cpp, "Collection Listener Token") {
CHECK(!listenerToken.context());
CHECK(!listenerToken.context());
listenerToken.remove(); // Noops
}
}
4 changes: 2 additions & 2 deletions test/DatabaseTest_Cpp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ TEST_CASE_METHOD(CBLTest_Cpp, "Database Listener Token") {
CHECK(listenerToken.token() == listener);

// Move Constructor:
ListenerToken<> listenerToken2 = move(listenerToken);
ListenerToken<> listenerToken2 = std::move(listenerToken);
REQUIRE(listenerToken2.context());
(*(ListenerToken<>::Callback*)listenerToken2.context())();
CHECK(num == 2);
Expand All @@ -304,7 +304,7 @@ TEST_CASE_METHOD(CBLTest_Cpp, "Database Listener Token") {
#endif

// Move Assignment:
listenerToken = move(listenerToken2);
listenerToken = std::move(listenerToken2);
REQUIRE(listenerToken.context());
(*(ListenerToken<>::Callback*)listenerToken.context())();
CHECK(num == 3);
Expand Down
2 changes: 1 addition & 1 deletion test/QueryTest_Cpp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ TEST_CASE_METHOD(QueryTest_Cpp, "Query Listener C++ Move Operation", "[Query][Qu
resultCount = -1;

// Move constructor:
Query::ChangeListener listenerToken2 = move(listenerToken);
Query::ChangeListener listenerToken2 = std::move(listenerToken);
CHECK(listenerToken2.context());
CHECK(listenerToken2.token());

Expand Down

0 comments on commit d6d2541

Please sign in to comment.