From 69e4c826a34eb84c36bb07338a9a292a520f5970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Wed, 5 Feb 2020 22:13:09 +0100 Subject: Fix compilation with clang --- src/identity.cpp | 5 +++++ src/identity.h | 6 ++---- src/network.cpp | 2 +- src/pubkey.cpp | 5 +---- src/pubkey.h | 5 +---- src/storage.cpp | 8 ++++---- src/storage.h | 4 ++-- 7 files changed, 16 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/identity.cpp b/src/identity.cpp index 57f25cc..00abf0b 100644 --- a/src/identity.cpp +++ b/src/identity.cpp @@ -11,6 +11,9 @@ using std::nullopt; using std::runtime_error; using std::set; +Identity::Identity(const Priv * p): p(p) {} +Identity::Identity(shared_ptr && p): p(std::move(p)) {} + optional Identity::load(const Ref & ref) { return Identity::load(vector { ref }); @@ -75,6 +78,8 @@ Identity::Builder Identity::modify() const } +Identity::Builder::Builder(Priv * p): p(p) {} + Identity Identity::Builder::commit() const { auto idata = p->storage.store(IdentityData { diff --git a/src/identity.h b/src/identity.h index 79b335e..92ac34f 100644 --- a/src/identity.h +++ b/src/identity.h @@ -23,9 +23,8 @@ public: const optional> keyMessage; }; -class Identity::Priv +struct Identity::Priv { -public: vector>> data; shared_future> name; optional owner; @@ -38,9 +37,8 @@ public: function sel); }; -class Identity::Builder::Priv +struct Identity::Builder::Priv { -public: Storage storage; vector>> prev = {}; optional name = nullopt; diff --git a/src/network.cpp b/src/network.cpp index e9aeb3f..f778bf9 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -458,7 +458,7 @@ optional TransportHeader::load(const PartialObject & obj) } } - return TransportHeader { .items = items }; + return TransportHeader(items); } PartialObject TransportHeader::toObject() const diff --git a/src/pubkey.cpp b/src/pubkey.cpp index 3a08c70..6f6c1e7 100644 --- a/src/pubkey.cpp +++ b/src/pubkey.cpp @@ -122,10 +122,7 @@ optional Signature::load(const Ref & ref) if (!key || !sig) return nullopt; - return Signature { - .key = key.value(), - .sig = sig.value(), - }; + return Signature(*key, *sig); } Ref Signature::store(const Storage & st) const diff --git a/src/pubkey.h b/src/pubkey.h index b14743d..607352d 100644 --- a/src/pubkey.h +++ b/src/pubkey.h @@ -106,10 +106,7 @@ optional> Signed::load(const Ref & ref) if (sig.value()->verify(data.value().ref)) sigs.push_back(sig.value()); - return Signed { - .data = data.value(), - .sigs = sigs, - }; + return Signed(*data, sigs); } template diff --git a/src/storage.cpp b/src/storage.cpp index db9f629..07fef51 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -720,8 +720,8 @@ vector RecordT::encodeInner() const return res; } -template class RecordT; -template class RecordT; +template class erebos::RecordT; +template class erebos::RecordT; Blob::Blob(const vector & vec): @@ -852,8 +852,8 @@ optional ObjectT::asBlob() const return nullopt; } -template class ObjectT; -template class ObjectT; +template class erebos::ObjectT; +template class erebos::ObjectT; vector> erebos::collectStoredObjects(const Stored & from) { diff --git a/src/storage.h b/src/storage.h index 86dc48f..c67be22 100644 --- a/src/storage.h +++ b/src/storage.h @@ -98,7 +98,7 @@ private: unique_ptr parent; }; -struct Storage::Priv +struct PartialStorage::Priv { shared_ptr backend; @@ -111,7 +111,7 @@ struct Storage::Priv optional copy(const ObjectT &, vector *) const; }; -struct Ref::Priv +struct PartialRef::Priv { const unique_ptr storage; const Digest digest; -- cgit v1.2.3