From 210040016e4b42e1c5530cc5e3e79b4cac3d5828 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 17 Apr 2015 13:27:49 +0200 Subject: [PATCH] Fix harmless warning in wxCommandProcessor::IsDirty(). This fixes the warning for MSVC, which warned about "forcing value to bool 'true' or 'false'", without introducing one for gcc which would complain if we compared the value, of compatibility_iterator type, with NULL. This backports the changes of r75445 and r75653 from master. --- src/common/cmdproc.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/cmdproc.cpp b/src/common/cmdproc.cpp index 4534de633e..413c25b994 100644 --- a/src/common/cmdproc.cpp +++ b/src/common/cmdproc.cpp @@ -333,7 +333,10 @@ bool wxCommandProcessor::IsDirty() const { // We have never been saved, so we are dirty if and only if we have any // commands at all. - return m_currentCommand; + // + // NB: The ugly "!!" test is needed to avoid warnings both from MSVC in + // non-STL build and g++ in STL build. + return !!m_currentCommand; } if ( !m_currentCommand )