From 88ef77226e0a395a0151297c295843d2e39f24d5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 8 Dec 2016 20:37:58 +0100 Subject: [PATCH] Fix warning on 32-bit systems http://hydra.nixos.org/build/44628517 --- src/libstore/nar-accessor.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libstore/nar-accessor.cc b/src/libstore/nar-accessor.cc index ded19c05d..4cb5de744 100644 --- a/src/libstore/nar-accessor.cc +++ b/src/libstore/nar-accessor.cc @@ -52,8 +52,9 @@ struct NarIndexer : ParseSink, StringSource void preallocateContents(unsigned long long size) override { currentStart = string(s, pos, 16); + assert(size <= std::numeric_limits::max()); members.emplace(currentPath, - NarMember{FSAccessor::Type::tRegular, isExec, pos, size}); + NarMember{FSAccessor::Type::tRegular, isExec, pos, (size_t) size}); } void receiveContents(unsigned char * data, unsigned int len) override