diff --git a/lix/libstore/store-api.cc b/lix/libstore/store-api.cc index 3845e5335..af1e4a229 100644 --- a/lix/libstore/store-api.cc +++ b/lix/libstore/store-api.cc @@ -1093,10 +1093,10 @@ namespace { struct CopyPathStream : AsyncInputStream { Activity & act; - size_t copied = 0, expected; + uint64_t copied = 0, expected; box_ptr inner; - CopyPathStream(Activity & act, size_t expected, box_ptr inner) + CopyPathStream(Activity & act, uint64_t expected, box_ptr inner) : act(act) , expected(expected) , inner(std::move(inner)) diff --git a/lix/libutil/archive.cc b/lix/libutil/archive.cc index 44128e6a1..d829eb375 100644 --- a/lix/libutil/archive.cc +++ b/lix/libutil/archive.cc @@ -128,7 +128,7 @@ static nar::Entry list(Path path, time_t & mtime, PathFilter & filter, bool retu if (S_ISREG(st.st_mode)) { return nar::File{ (st.st_mode & S_IXUSR) != 0, - size_t(st.st_size), + uint64_t(st.st_size), dumpContents(std::move(path), st.st_size) }; } else if (S_ISDIR(st.st_mode)) { @@ -355,21 +355,21 @@ struct Parser // but in such a way that doing it *wrong* will definitely make // tests fail. we could also duplicate them completely, but not // doing so ensures that we're the inverse of dump at all times -#define FETCH_U64() \ +#define FETCH_INT(type) \ ({ \ co_yield WantBytes{8}; \ StringSource src(std::string_view(buffer.data(), buffer.size())); \ - readNum(src); \ + readNum(src); \ }) #define READ_U64() \ ({ \ - auto u = FETCH_U64(); \ + auto u = FETCH_INT(uint64_t); \ buffer.clear(); \ u; \ }) #define READ_STRING_LIMITED(limit) \ ({ \ - uint64_t len = FETCH_U64(); \ + size_t len = FETCH_INT(size_t); \ co_yield WantBytes{len + (8 - len % 8) % 8}; \ StringSource src(std::string_view(buffer.data(), buffer.size())); \ auto str = readString(src, (limit)); \ @@ -380,7 +380,7 @@ struct Parser #define READ_PADDING(size) \ do { \ if ((size) % 8) { \ - co_yield WantBytes{8 - (size) % 8}; \ + co_yield WantBytes{size_t(8 - (size) % 8)}; \ StringSource src(std::string_view(buffer.data(), buffer.size())); \ readPadding((size), src); \ buffer.clear(); \ @@ -506,7 +506,7 @@ struct Parser co_yield parse(); } -#undef FETCH_U64 +#undef FETCH_INT #undef READ_U64 #undef READ_STRING #undef READ_STRING_LIMITED @@ -595,7 +595,7 @@ struct AsyncCopier : AsyncInputStream struct Fragment { // how many bytes the parser requested but we haven't read from source yet - size_t pending = 0; + uint64_t pending = 0; // whether the requested bytes are nar metadata (false) or contents (true) bool pendingFileContents = false; }; @@ -615,7 +615,7 @@ struct AsyncCopier : AsyncInputStream } } - size = std::min(current.pending, size); + size = std::min(current.pending, size); if (size == 0) { co_return 0; }