From c26c1e234ab3e7839b21e095b8cee1bdc4de7ad5 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 19 Aug 2013 23:54:54 +0900 Subject: [PATCH] Move GHR outside of function and provide ctor to suppress compiler warning Without ctor, compiler emits warning "unused variable ghr". --- src/DownloadEngine.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/DownloadEngine.cc b/src/DownloadEngine.cc index 9f3283dc..ba730076 100644 --- a/src/DownloadEngine.cc +++ b/src/DownloadEngine.cc @@ -140,15 +140,20 @@ void executeCommand(std::deque>& commands, } } // namespace +namespace { +class GHR { +public: + GHR() {} + ~GHR() + { + global::globalHaltRequested = 5; + } +}; +} // namespace + int DownloadEngine::run(bool oneshot) { - class GHR { - public: - ~GHR() { - global::globalHaltRequested = 5; - } - } ghr; - + GHR ghr; while(!commands_.empty() || !routineCommands_.empty()) { if(!commands_.empty()) { waitData();