summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/identity.cpp2
-rw-r--r--src/storage.cpp7
2 files changed, 6 insertions, 3 deletions
diff --git a/src/identity.cpp b/src/identity.cpp
index 4833f71..cee2688 100644
--- a/src/identity.cpp
+++ b/src/identity.cpp
@@ -169,6 +169,8 @@ shared_ptr<Identity::Priv> Identity::Priv::validate(const vector<Stored<Signed<I
auto p = new Priv {
.data = sdata,
+ .name = {},
+ .owner = nullopt,
};
shared_ptr<Priv> ret(p);
diff --git a/src/storage.cpp b/src/storage.cpp
index b5e71b7..e611da0 100644
--- a/src/storage.cpp
+++ b/src/storage.cpp
@@ -258,7 +258,7 @@ Digest::Digest(const string & str)
if (str.size() != 2 * size)
throw runtime_error("invalid ref digest");
- for (int i = 0; i < size; i++)
+ for (size_t i = 0; i < size; i++)
std::from_chars(str.data() + 2 * i,
str.data() + 2 * i + 2,
value[i], 16);
@@ -267,7 +267,7 @@ Digest::Digest(const string & str)
Digest::operator string() const
{
string res(size * 2, '0');
- for (int i = 0; i < size; i++)
+ for (size_t i = 0; i < size; i++)
std::to_chars(res.data() + 2 * i + (value[i] < 0x10),
res.data() + 2 * i + 2,
value[i], 16);
@@ -283,6 +283,7 @@ optional<Ref> Ref::create(Storage st, const Digest & digest)
auto p = new Priv {
.storage = st,
.digest = digest,
+ .object = {},
};
p->object = std::async(std::launch::deferred, [p] {
@@ -502,7 +503,7 @@ optional<Object> Object::decode(Storage st, const vector<uint8_t> & data)
if (space == newline)
return nullopt;
- size_t size = std::stoi(string(space + 1, newline));
+ ssize_t size = std::stoi(string(space + 1, newline));
if (data.end() - newline - 1 != size)
return nullopt;