From 105f8ffc98d25e23c9a7eb5a5327e711b1e21e50 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 10 Apr 2017 11:12:45 +0200 Subject: [PATCH] Minor cleanup Also, possible fix for #1310 on 32-bit systems. --- src/libstore/gc.cc | 2 +- src/libstore/local-store.hh | 11 +++-------- src/libstore/store-api.hh | 7 +------ 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 8e90913cc..0b03d61a7 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -679,7 +679,7 @@ void LocalStore::removeUnusedLinks(const GCState & state) if (unlink(path.c_str()) == -1) throw SysError(format("deleting ‘%1%’") % path); - state.results.bytesFreed += st.st_blocks * 512; + state.results.bytesFreed += st.st_blocks * 512ULL; } struct stat st; diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh index 28e9a31c9..750da0c14 100644 --- a/src/libstore/local-store.hh +++ b/src/libstore/local-store.hh @@ -26,14 +26,9 @@ struct Derivation; struct OptimiseStats { - unsigned long filesLinked; - unsigned long long bytesFreed; - unsigned long long blocksFreed; - OptimiseStats() - { - filesLinked = 0; - bytesFreed = blocksFreed = 0; - } + unsigned long filesLinked = 0; + unsigned long long bytesFreed = 0; + unsigned long long blocksFreed = 0; }; diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index 68c59a9f2..c0a52145a 100644 --- a/src/libstore/store-api.hh +++ b/src/libstore/store-api.hh @@ -81,12 +81,7 @@ struct GCResults /* For `gcReturnDead', `gcDeleteDead' and `gcDeleteSpecific', the number of bytes that would be or was freed. */ - unsigned long long bytesFreed; - - GCResults() - { - bytesFreed = 0; - } + unsigned long long bytesFreed = 0; };