]> git.saurik.com Git - wxWidgets.git/commitdiff
minor icc warning fixes
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 19 Nov 2008 09:55:27 +0000 (09:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 19 Nov 2008 09:55:27 +0000 (09:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56845 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/cppunit.h
tests/archive/archivetest.cpp
tests/arrays/arrays.cpp
tests/datetime/datetimetest.cpp
tests/longlong/longlongtest.cpp
tests/mbconv/mbconvtest.cpp
tests/regex/wxregextest.cpp
tests/streams/textstreamtest.cpp
tests/strings/strings.cpp
tests/strings/unicode.cpp
tests/textfile/textfiletest.cpp

index e96196343c6bcaa9873d03cd0963ac1194a37951..5d5e7406bf6b03358b88bccbbdd74b4560145371 100644 (file)
@@ -123,7 +123,7 @@ assertEquals(const wchar_t *expected,
 
 // and another to be able to specify (usually literal) ints as expected values
 // for functions returning size_t
-WX_CPPUNIT_ASSERT_EQUALS(int, size_t);
+WX_CPPUNIT_ASSERT_EQUALS(int, size_t)
 
 // special section with VC6 workarounds: due to incorrect resolution of
 // overloaded/template functions in this compiler (it basically doesn't use the
@@ -131,8 +131,8 @@ WX_CPPUNIT_ASSERT_EQUALS(int, size_t);
 // none of them matches fully) we also need
 #ifdef __VISUALC6__
 
-WX_CPPUNIT_ASSERT_EQUALS(int, int);
-WX_CPPUNIT_ASSERT_EQUALS(size_t, size_t);
+WX_CPPUNIT_ASSERT_EQUALS(int, int)
+WX_CPPUNIT_ASSERT_EQUALS(size_t, size_t)
 
 #endif // VC6
 
index 0885346bfea28a4104c68113b949dbfdd1310685..1d8853945a9468d1720c964d5b4b1ebbaa8f9f79 100644 (file)
@@ -1243,11 +1243,10 @@ void CorruptionTestCase::ExtractArchive(wxInputStream& in)
 {
     auto_ptr<wxArchiveInputStream> arc(m_factory->NewStream(in));
     auto_ptr<wxArchiveEntry> entry(arc->GetNextEntry());
-        
+
     while (entry.get() != NULL) {
-        wxString name = entry->GetName();
         char buf[1024];
-        
+
         while (arc->IsOk())
             arc->Read(buf, sizeof(buf));
 
@@ -1329,7 +1328,7 @@ ArchiveTestSuite *ArchiveTestSuite::makeSuite()
                         addTest(test);
                 }
 
-    for (int options = 0; options <= PipeIn; options += PipeIn) 
+    for (int options = 0; options <= PipeIn; options += PipeIn)
     {
         wxObject *pObj = wxCreateDynamicObject(m_name + _T("ClassFactory"));
         wxArchiveClassFactory *factory;
index 3df8126846b9dfbe2500f73ecde5141d84d8742d..1cd0537457da4fff063554ddfdf6901cdc3acce8 100644 (file)
@@ -94,7 +94,7 @@ size_t Bar::ms_bars = 0;
 
 WX_DECLARE_OBJARRAY(Bar, ArrayBars);
 #include "wx/arrimpl.cpp"
-WX_DEFINE_OBJARRAY(ArrayBars);
+WX_DEFINE_OBJARRAY(ArrayBars)
 
 // ----------------------------------------------------------------------------
 // helpers for sorting arrays and comparing items
@@ -125,9 +125,9 @@ int wxCMPFUNC_CONV name ## RevCompare(T* first, T* second)                    \
 
 typedef unsigned short ushort;
 
-DEFINE_COMPARE(Char, char);
-DEFINE_COMPARE(UShort, ushort);
-DEFINE_COMPARE(Int, int);
+DEFINE_COMPARE(Char, char)
+DEFINE_COMPARE(UShort, ushort)
+DEFINE_COMPARE(Int, int)
 
 WX_DEFINE_ARRAY_CHAR(char, wxArrayChar);
 WX_DEFINE_SORTED_ARRAY_CHAR(char, wxSortedArrayCharNoCmp);
@@ -539,11 +539,11 @@ void ArraysTestCase::wxArray ## name ## Test()                                \
     CPPUNIT_ASSERT( b.Index( 17 ) == 3 );                                     \
 }
 
-TestArrayOf(UShort);
+TestArrayOf(UShort)
 
-TestArrayOf(Char);
+TestArrayOf(Char)
 
-TestArrayOf(Int);
+TestArrayOf(Int)
 
 void ArraysTestCase::Alloc()
 {
index b9a3b9caf3a4389a25b3b78032682c3bf7d59c72..f4f87df2f4675aed9cfbb63f7a91861e460cfb6f 100644 (file)
@@ -281,10 +281,10 @@ void DateTimeTestCase::TestTimeJDN()
         // JDNs must be computed for UTC times
         double jdn = dt.FromUTC().GetJulianDayNumber();
 
-        CPPUNIT_ASSERT( jdn == d.jdn );
+        CPPUNIT_ASSERT_EQUAL( d.jdn, jdn );
 
         dt.Set(jdn);
-        CPPUNIT_ASSERT( dt.GetJulianDayNumber() == jdn );
+        CPPUNIT_ASSERT_EQUAL( jdn, dt.GetJulianDayNumber() );
     }
 }
 
@@ -879,7 +879,6 @@ void DateTimeTestCase::TestDateParse()
 
     for ( size_t n = 0; n < WXSIZEOF(parseTestDates); n++ )
     {
-        wxDateTime dt;
         if ( dt.ParseDate(parseTestDates[n].str) )
         {
             CPPUNIT_ASSERT( parseTestDates[n].good );
@@ -984,7 +983,6 @@ void DateTimeTestCase::TestDateTimeParse()
     wxDateTime dt;
     for ( size_t n = 0; n < WXSIZEOF(parseTestDates); n++ )
     {
-        wxDateTime dt;
         if ( dt.ParseDateTime(parseTestDates[n].str) )
         {
             CPPUNIT_ASSERT( parseTestDates[n].good );
index e59e8bbb481c6f4255ec913ff1917573a3e8b0cb..a9142a6fb5dba21cd896c7ea448ed7dc8c9929ff 100644 (file)
@@ -237,7 +237,7 @@ void LongLongTestCase::Division()
 
 void LongLongTestCase::BitOperations()
 {
-    for ( size_t n = 0; n < ITEMS; n++ )
+    for ( size_t m = 0; m < ITEMS; m++ )
     {
         wxLongLong a = RAND_LL();
 
index be18289a77dc7c59e4d764ce11e0a98f2111ebb8..5260887d7c4a1059bde966b3cd79f8e4514a2578 100644 (file)
@@ -254,7 +254,7 @@ wxString CByteArrayFormat( const void* data, size_t len, const wxChar* name )
     const unsigned char* bytes = (unsigned char*)data;
     wxString result;
 
-    result.Printf( _T("const static unsigned char %s[%i] = \n{"), name, (int)len );
+    result.Printf( _T("static const unsigned char %s[%i] = \n{"), name, (int)len );
 
     for ( size_t i = 0; i < len; i++ )
     {
@@ -277,7 +277,7 @@ wxString CByteArrayFormat( const void* data, size_t len, const wxChar* name )
 // characters, encoded in several different formats.
 
 // encoded by iconv
-const static unsigned char welcome_utf7_iconv[84] =
+static const unsigned char welcome_utf7_iconv[84] =
 {
     0x57,0x65,0x6c,0x63,0x6f,0x6d,0x65,0x20,0x74,0x6f,0x20,0x6f,0x75,0x72,0x20,0x63,
     0x79,0x62,0x65,0x72,0x20,0x73,0x70,0x61,0x63,0x65,0x20,0x66,0x6f,0x72,0x63,0x65,
@@ -287,7 +287,7 @@ const static unsigned char welcome_utf7_iconv[84] =
     0x57,0x54,0x41,0x43
 };
 // encoded by wxWindows (iconv can decode this successfully)
-const static unsigned char welcome_utf7_wx[109] =
+static const unsigned char welcome_utf7_wx[109] =
 {
     0x57,0x65,0x6c,0x63,0x6f,0x6d,0x65,0x2b,0x41,0x43,0x41,0x2d,0x74,0x6f,0x2b,0x41,
     0x43,0x41,0x2d,0x6f,0x75,0x72,0x2b,0x41,0x43,0x41,0x2d,0x63,0x79,0x62,0x65,0x72,
@@ -298,7 +298,7 @@ const static unsigned char welcome_utf7_wx[109] =
     0x51,0x77,0x52,0x44,0x42,0x6e,0x4d,0x46,0x6b,0x77,0x41,0x67,0x2d
 };
 // encoded by iconv
-const static unsigned char welcome_utf8[89] =
+static const unsigned char welcome_utf8[89] =
 {
     0x57,0x65,0x6c,0x63,0x6f,0x6d,0x65,0x20,0x74,0x6f,0x20,0x6f,0x75,0x72,0x20,0x63,
     0x79,0x62,0x65,0x72,0x20,0x73,0x70,0x61,0x63,0x65,0x20,0x66,0x6f,0x72,0x63,0x65,
@@ -308,7 +308,7 @@ const static unsigned char welcome_utf8[89] =
     0xe3,0x81,0xa7,0xe3,0x81,0x99,0xe3,0x80,0x82
 };
 // encoded by iconv
-const static unsigned char welcome_utf16le[106] =
+static const unsigned char welcome_utf16le[106] =
 {
     0x57,0x00,0x65,0x00,0x6c,0x00,0x63,0x00,0x6f,0x00,0x6d,0x00,0x65,0x00,0x20,0x00,
     0x74,0x00,0x6f,0x00,0x20,0x00,0x6f,0x00,0x75,0x00,0x72,0x00,0x20,0x00,0x63,0x00,
@@ -319,7 +319,7 @@ const static unsigned char welcome_utf16le[106] =
     0x44,0x30,0x44,0x30,0x67,0x30,0x59,0x30,0x02,0x30
 };
 // encoded by iconv
-const static unsigned char welcome_utf16be[106] =
+static const unsigned char welcome_utf16be[106] =
 {
     0x00,0x57,0x00,0x65,0x00,0x6c,0x00,0x63,0x00,0x6f,0x00,0x6d,0x00,0x65,0x00,0x20,
     0x00,0x74,0x00,0x6f,0x00,0x20,0x00,0x6f,0x00,0x75,0x00,0x72,0x00,0x20,0x00,0x63,
@@ -330,7 +330,7 @@ const static unsigned char welcome_utf16be[106] =
     0x30,0x44,0x30,0x44,0x30,0x67,0x30,0x59,0x30,0x02
 };
 // encoded by iconv
-const static unsigned char welcome_utf32le[212] =
+static const unsigned char welcome_utf32le[212] =
 {
     0x57,0x00,0x00,0x00,0x65,0x00,0x00,0x00,0x6c,0x00,0x00,0x00,0x63,0x00,0x00,0x00,
     0x6f,0x00,0x00,0x00,0x6d,0x00,0x00,0x00,0x65,0x00,0x00,0x00,0x20,0x00,0x00,0x00,
@@ -348,7 +348,7 @@ const static unsigned char welcome_utf32le[212] =
     0x02,0x30,0x00,0x00
 };
 // encoded by iconv
-const static unsigned char welcome_utf32be[212] =
+static const unsigned char welcome_utf32be[212] =
 {
     0x00,0x00,0x00,0x57,0x00,0x00,0x00,0x65,0x00,0x00,0x00,0x6c,0x00,0x00,0x00,0x63,
     0x00,0x00,0x00,0x6f,0x00,0x00,0x00,0x6d,0x00,0x00,0x00,0x65,0x00,0x00,0x00,0x20,
@@ -366,7 +366,7 @@ const static unsigned char welcome_utf32be[212] =
     0x00,0x00,0x30,0x02
 };
 // encoded by iconv
-const static unsigned char welcome_cp932[71] =
+static const unsigned char welcome_cp932[71] =
 {
     0x57,0x65,0x6c,0x63,0x6f,0x6d,0x65,0x20,0x74,0x6f,0x20,0x6f,0x75,0x72,0x20,0x63,
     0x79,0x62,0x65,0x72,0x20,0x73,0x70,0x61,0x63,0x65,0x20,0x66,0x6f,0x72,0x63,0x65,
@@ -676,6 +676,9 @@ static const unsigned char CP1252_utf8[386] =
     0x84,0xa2
 };
 
+// this is unused currently so avoid warnings about this
+#if 0
+
 // a character sequence encoded as iso8859-5 (iconv)
 static const unsigned char iso8859_5[251] =
 {
@@ -724,6 +727,7 @@ static const unsigned char iso8859_5_utf8[380] =
     0x92,0xd1,0x93,0xd1,0x94,0xd1,0x95,0xd1,0x96,0xd1,0x97,0xd1,0x98,0xd1,0x99,0xd1,
     0x9a,0xd1,0x9b,0xd1,0x9c,0xd1,0x9e,0xd1,0x9f,0xe2,0x84,0x96
 };
+#endif // 0
 
 // DecodeUTF8
 // decodes the specified *unterminated* UTF-8 byte array
@@ -896,7 +900,7 @@ void MBConvTestCase::Latin1Tests()
     static const char nulstr[] = "foo\0bar\0";
     static const size_t mbLen = WXSIZEOF(nulstr) - 1;
     size_t wcLen;
-    wxWCharBuffer wbuf(wxConvISO8859_1.cMB2WC(nulstr, mbLen, &wcLen));
+    wxConvISO8859_1.cMB2WC(nulstr, mbLen, &wcLen);
     CPPUNIT_ASSERT_EQUAL( mbLen, wcLen );
 }
 
index 1d9c75acc8f385bd6c85f801d2e9b1460ac6fce9..38286da82cc4edabe2fb4b1269635cafd151aef8 100644 (file)
@@ -327,7 +327,7 @@ wxString wxRegExTestSuite::FlagStr(int flags)
     }
 
     return _T(" (") + str.Mid(3) + _T(")");
-};
+}
 
 // register in the unnamed registry so that these tests are run by default
 CPPUNIT_TEST_SUITE_REGISTRATION(wxRegExTestSuite);
index efc8ee8d33f17c7dbe219382be776be3654f80b6..16cbcdee943aa5c5ab576f043187767da2dc36d9 100644 (file)
@@ -185,7 +185,7 @@ void TextStreamTestCase::TestULongLong()
 
 #if wxUSE_UNICODE
 
-const static wchar_t txtWchar[4] =
+static const wchar_t txtWchar[4] =
 {
     0x0041, // LATIN CAPITAL LETTER A
     0x0100, // A WITH BREVE, LATIN SMALL LETTER
@@ -193,28 +193,28 @@ const static wchar_t txtWchar[4] =
     0x0100, // A WITH BREVE, LATIN SMALL LETTER
 };
 
-const static unsigned char txtUtf8[6] =
+static const unsigned char txtUtf8[6] =
 {
     0x41, 0xc4, 0x80, 0x41, 0xc4, 0x80,
 };
 
-const static unsigned char txtUtf16le[8] =
+static const unsigned char txtUtf16le[8] =
 {
     0x41, 0x00, 0x00, 0x01, 0x41, 0x00, 0x00, 0x01,
 };
 
-const static unsigned char txtUtf16be[8] =
+static const unsigned char txtUtf16be[8] =
 {
     0x00, 0x41, 0x01, 0x00, 0x00, 0x41, 0x01, 0x00,
 };
 
-const static unsigned char txtUtf32le[16] =
+static const unsigned char txtUtf32le[16] =
 {
     0x41, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
     0x41, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
 };
 
-const static unsigned char txtUtf32be[16] =
+static const unsigned char txtUtf32be[16] =
 {
     0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x01, 0x00,
     0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x01, 0x00,
index 9fb5c5490be0af2b5066456f91ac12601ef8d104..f9371210917e8028c965f613b311c1344846b358 100644 (file)
@@ -531,7 +531,7 @@ enum
     Number_Unsigned = 2,    // if not specified, works for signed conversion
     Number_Signed   = 4,    // if not specified, works for unsigned
     Number_LongLong = 8,    // only for long long tests
-    Number_Long     = 16,   // only for long tests
+    Number_Long     = 16    // only for long tests
 };
 
 static const struct ToLongData
index b79c987438976b9adcea7e2da87ae0ea9ca23659..1110b3f29d1d717a9424a08185e69c289e17c033 100644 (file)
@@ -243,12 +243,12 @@ void UnicodeTestCase::ConversionEmpty()
     size_t len;
 
 #if wxUSE_UNICODE
-    wxCharBuffer buf = wxConvLibc.cWC2MB(L"", 0, &len);
+    wxConvLibc.cWC2MB(L"", 0, &len);
 #else // !wxUSE_UNICODE
-    wxWCharBuffer wbuf = wxConvLibc.cMB2WC("", 0, &len);
+    wxConvLibc.cMB2WC("", 0, &len);
 #endif // wxUSE_UNICODE/!wxUSE_UNICODE
 
-    CPPUNIT_ASSERT(len == 0);
+    CPPUNIT_ASSERT_EQUAL( 0, len );
 }
 
 void UnicodeTestCase::ConversionWithNULs()
@@ -368,8 +368,8 @@ void UnicodeTestCase::ConversionUTF16()
     // terminate the string, this exposed a bug in our conversion code which
     // got confused in this case
     size_t len;
-    wxWCharBuffer wbuf(conv.cMB2WC("\x01\0\0B\0C" /* A macron BC */, 6, &len));
-    CPPUNIT_ASSERT_EQUAL( (size_t)3, len );
+    conv.cMB2WC("\x01\0\0B\0C" /* A macron BC */, 6, &len);
+    CPPUNIT_ASSERT_EQUAL( 3, len );
 }
 
 void UnicodeTestCase::ConversionUTF32()
@@ -392,9 +392,8 @@ void UnicodeTestCase::ConversionUTF32()
     }
 
     size_t len;
-    wxWCharBuffer wbuf(conv.cMB2WC("\0\0\x01\0\0\0\0B\0\0\0C" /* A macron BC */,
-                                   12, &len));
-    CPPUNIT_ASSERT_EQUAL( (size_t)3, len );
+    conv.cMB2WC("\0\0\x01\0\0\0\0B\0\0\0C" /* A macron BC */, 12, &len);
+    CPPUNIT_ASSERT_EQUAL( 3, len );
 }
 
 void UnicodeTestCase::IsConvOk()
index aa93472894b2d3837262d5167ece8eeb173ee46a..b85e9444b5e2e486dfcbb28e6fa6e686226a0bb4 100644 (file)
@@ -89,8 +89,8 @@ void TextFileTestCase::CreateTestFile(size_t len, const char *contents)
     FILE *f = fopen(GetTestFileName(), "wb");
     CPPUNIT_ASSERT( f );
 
-    CPPUNIT_ASSERT( fwrite(contents, 1, len, f) >= 0 );
-    CPPUNIT_ASSERT( fclose(f) == 0 );
+    CPPUNIT_ASSERT_EQUAL( len, fwrite(contents, 1, len, f) );
+    CPPUNIT_ASSERT_EQUAL( 0, fclose(f) );
 }
 
 void TextFileTestCase::ReadEmpty()