From c3cf7682b9de238d31c6d305d133bf9880d276f4 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 18 Dec 2014 12:58:46 +0100 Subject: [PATCH] Clean up the DebugInfo class refs #7709 --- lib/base/debuginfo.cpp | 4 ++++ lib/base/debuginfo.hpp | 8 +++----- lib/cli/daemoncommand.cpp | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/base/debuginfo.cpp b/lib/base/debuginfo.cpp index eeda4f5f8..c98d06c80 100644 --- a/lib/base/debuginfo.cpp +++ b/lib/base/debuginfo.cpp @@ -23,6 +23,10 @@ using namespace icinga; +DebugInfo::DebugInfo(void) + : FirstLine(0), FirstColumn(0), LastLine(0), LastColumn(0) +{ } + /** * Outputs a DebugInfo struct to a stream. * diff --git a/lib/base/debuginfo.hpp b/lib/base/debuginfo.hpp index cd8e2a579..d5d8bc471 100644 --- a/lib/base/debuginfo.hpp +++ b/lib/base/debuginfo.hpp @@ -31,7 +31,7 @@ namespace icinga * * @ingroup config */ -struct DebugInfo +struct I2_BASE_API DebugInfo { String Path; @@ -41,16 +41,14 @@ struct DebugInfo int LastLine; int LastColumn; - DebugInfo(void) - : FirstLine(0), FirstColumn(0), LastLine(0), LastColumn(0) - { } + DebugInfo(void); }; I2_BASE_API std::ostream& operator<<(std::ostream& out, const DebugInfo& val); I2_BASE_API DebugInfo DebugInfoRange(const DebugInfo& start, const DebugInfo& end); -I2_BASE_API void ShowCodeFragment(std::ostream& out, const DebugInfo& di, bool verbose); +I2_BASE_API void ShowCodeFragment(std::ostream& out, const DebugInfo& di, bool verbose = true); } diff --git a/lib/cli/daemoncommand.cpp b/lib/cli/daemoncommand.cpp index 6129c5cd2..255e9d457 100644 --- a/lib/cli/daemoncommand.cpp +++ b/lib/cli/daemoncommand.cpp @@ -144,7 +144,7 @@ static bool LoadConfigFiles(const boost::program_options::variables_map& vm, con BOOST_FOREACH(const ConfigCompilerMessage& message, ConfigCompilerContext::GetInstance()->GetMessages()) { std::ostringstream locbuf; - ShowCodeFragment(locbuf, message.Location, true); + ShowCodeFragment(locbuf, message.Location); String location = locbuf.str(); String logmsg; -- 2.40.0