From 895cae46b76569cad6486d2b9e5c409c9b15b68f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 6 Jun 2009 23:04:50 +0000 Subject: [PATCH] work around (harmless) warnings in VC7 release build git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60922 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/cppunit.h | 10 ++++++++++ tests/archive/tartest.cpp | 10 ++++++---- tests/archive/ziptest.cpp | 6 ++++-- tests/regex/regextest.cpp | 4 ++-- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/include/wx/cppunit.h b/include/wx/cppunit.h index bd131dd57a..7e10e80a68 100644 --- a/include/wx/cppunit.h +++ b/include/wx/cppunit.h @@ -48,11 +48,21 @@ // #include "wx/beforestd.h" +#ifdef __VISUALC__ + // with cppunit 1.12 we get many bogus warnings 4701 (local variable may be + // used without having been initialized) in TestAssert.h + #pragma warning(disable:4701) +#endif + #include #include #include #include #include + +#ifdef __VISUALC__ + #pragma warning(default:4701) +#endif #include "wx/afterstd.h" #include "wx/string.h" diff --git a/tests/archive/tartest.cpp b/tests/archive/tartest.cpp index 2ff2006d8e..d0110526ff 100644 --- a/tests/archive/tartest.cpp +++ b/tests/archive/tartest.cpp @@ -59,13 +59,15 @@ CppUnit::Test *tartest::makeTest( return NULL; if (genericInterface) + { return new ArchiveTestCase( descr, new wxTarClassFactory, options, archiver, unarchiver); - else - return new ArchiveTestCase( - descr, new wxTarClassFactory, - options, archiver, unarchiver); + } + + return new ArchiveTestCase( + descr, new wxTarClassFactory, + options, archiver, unarchiver); } CPPUNIT_TEST_SUITE_REGISTRATION(tartest); diff --git a/tests/archive/ziptest.cpp b/tests/archive/ziptest.cpp index 966e6e78a0..4204c7dfb7 100644 --- a/tests/archive/ziptest.cpp +++ b/tests/archive/ziptest.cpp @@ -261,11 +261,13 @@ CppUnit::Test *ziptest::makeTest( return NULL; if (genericInterface) + { return new ArchiveTestCase( descr, new wxZipClassFactory, options, archiver, unarchiver); - else - return new ZipTestCase(descr, options, archiver, unarchiver); + } + + return new ZipTestCase(descr, options, archiver, unarchiver); } CPPUNIT_TEST_SUITE_REGISTRATION(ziptest); diff --git a/tests/regex/regextest.cpp b/tests/regex/regextest.cpp index 042741ed3e..822012b8e2 100644 --- a/tests/regex/regextest.cpp +++ b/tests/regex/regextest.cpp @@ -170,8 +170,8 @@ wxString RegExTestCase::Conv(const char *str) if (!buf || wxWcscmp(wxConvCurrent->cWX2WC(buf), wstr) != 0) return convError(); - else - return buf; + + return buf; } // Parse flags -- 2.45.2