minor icc warning fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56845 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-11-19 09:55:27 +00:00
parent 2c2944d6aa
commit 93a800a95e
11 changed files with 47 additions and 47 deletions

View File

@@ -123,7 +123,7 @@ assertEquals(const wchar_t *expected,
// and another to be able to specify (usually literal) ints as expected values // and another to be able to specify (usually literal) ints as expected values
// for functions returning size_t // 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 // special section with VC6 workarounds: due to incorrect resolution of
// overloaded/template functions in this compiler (it basically doesn't use the // 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 // none of them matches fully) we also need
#ifdef __VISUALC6__ #ifdef __VISUALC6__
WX_CPPUNIT_ASSERT_EQUALS(int, int); WX_CPPUNIT_ASSERT_EQUALS(int, int)
WX_CPPUNIT_ASSERT_EQUALS(size_t, size_t); WX_CPPUNIT_ASSERT_EQUALS(size_t, size_t)
#endif // VC6 #endif // VC6

View File

@@ -1245,7 +1245,6 @@ void CorruptionTestCase::ExtractArchive(wxInputStream& in)
auto_ptr<wxArchiveEntry> entry(arc->GetNextEntry()); auto_ptr<wxArchiveEntry> entry(arc->GetNextEntry());
while (entry.get() != NULL) { while (entry.get() != NULL) {
wxString name = entry->GetName();
char buf[1024]; char buf[1024];
while (arc->IsOk()) while (arc->IsOk())

View File

@@ -94,7 +94,7 @@ size_t Bar::ms_bars = 0;
WX_DECLARE_OBJARRAY(Bar, ArrayBars); WX_DECLARE_OBJARRAY(Bar, ArrayBars);
#include "wx/arrimpl.cpp" #include "wx/arrimpl.cpp"
WX_DEFINE_OBJARRAY(ArrayBars); WX_DEFINE_OBJARRAY(ArrayBars)
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// helpers for sorting arrays and comparing items // helpers for sorting arrays and comparing items
@@ -125,9 +125,9 @@ int wxCMPFUNC_CONV name ## RevCompare(T* first, T* second) \
typedef unsigned short ushort; typedef unsigned short ushort;
DEFINE_COMPARE(Char, char); DEFINE_COMPARE(Char, char)
DEFINE_COMPARE(UShort, ushort); DEFINE_COMPARE(UShort, ushort)
DEFINE_COMPARE(Int, int); DEFINE_COMPARE(Int, int)
WX_DEFINE_ARRAY_CHAR(char, wxArrayChar); WX_DEFINE_ARRAY_CHAR(char, wxArrayChar);
WX_DEFINE_SORTED_ARRAY_CHAR(char, wxSortedArrayCharNoCmp); WX_DEFINE_SORTED_ARRAY_CHAR(char, wxSortedArrayCharNoCmp);
@@ -539,11 +539,11 @@ void ArraysTestCase::wxArray ## name ## Test() \
CPPUNIT_ASSERT( b.Index( 17 ) == 3 ); \ CPPUNIT_ASSERT( b.Index( 17 ) == 3 ); \
} }
TestArrayOf(UShort); TestArrayOf(UShort)
TestArrayOf(Char); TestArrayOf(Char)
TestArrayOf(Int); TestArrayOf(Int)
void ArraysTestCase::Alloc() void ArraysTestCase::Alloc()
{ {

View File

@@ -281,10 +281,10 @@ void DateTimeTestCase::TestTimeJDN()
// JDNs must be computed for UTC times // JDNs must be computed for UTC times
double jdn = dt.FromUTC().GetJulianDayNumber(); double jdn = dt.FromUTC().GetJulianDayNumber();
CPPUNIT_ASSERT( jdn == d.jdn ); CPPUNIT_ASSERT_EQUAL( d.jdn, jdn );
dt.Set(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++ ) for ( size_t n = 0; n < WXSIZEOF(parseTestDates); n++ )
{ {
wxDateTime dt;
if ( dt.ParseDate(parseTestDates[n].str) ) if ( dt.ParseDate(parseTestDates[n].str) )
{ {
CPPUNIT_ASSERT( parseTestDates[n].good ); CPPUNIT_ASSERT( parseTestDates[n].good );
@@ -984,7 +983,6 @@ void DateTimeTestCase::TestDateTimeParse()
wxDateTime dt; wxDateTime dt;
for ( size_t n = 0; n < WXSIZEOF(parseTestDates); n++ ) for ( size_t n = 0; n < WXSIZEOF(parseTestDates); n++ )
{ {
wxDateTime dt;
if ( dt.ParseDateTime(parseTestDates[n].str) ) if ( dt.ParseDateTime(parseTestDates[n].str) )
{ {
CPPUNIT_ASSERT( parseTestDates[n].good ); CPPUNIT_ASSERT( parseTestDates[n].good );

View File

@@ -237,7 +237,7 @@ void LongLongTestCase::Division()
void LongLongTestCase::BitOperations() void LongLongTestCase::BitOperations()
{ {
for ( size_t n = 0; n < ITEMS; n++ ) for ( size_t m = 0; m < ITEMS; m++ )
{ {
wxLongLong a = RAND_LL(); wxLongLong a = RAND_LL();

View File

@@ -254,7 +254,7 @@ wxString CByteArrayFormat( const void* data, size_t len, const wxChar* name )
const unsigned char* bytes = (unsigned char*)data; const unsigned char* bytes = (unsigned char*)data;
wxString result; 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++ ) 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. // characters, encoded in several different formats.
// encoded by iconv // 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, 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, 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 0x57,0x54,0x41,0x43
}; };
// encoded by wxWindows (iconv can decode this successfully) // 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, 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, 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 0x51,0x77,0x52,0x44,0x42,0x6e,0x4d,0x46,0x6b,0x77,0x41,0x67,0x2d
}; };
// encoded by iconv // 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, 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, 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 0xe3,0x81,0xa7,0xe3,0x81,0x99,0xe3,0x80,0x82
}; };
// encoded by iconv // 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, 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, 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 0x44,0x30,0x44,0x30,0x67,0x30,0x59,0x30,0x02,0x30
}; };
// encoded by iconv // 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,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,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 0x30,0x44,0x30,0x44,0x30,0x67,0x30,0x59,0x30,0x02
}; };
// encoded by iconv // 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, 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, 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 0x02,0x30,0x00,0x00
}; };
// encoded by iconv // 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,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,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 0x00,0x00,0x30,0x02
}; };
// encoded by iconv // 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, 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, 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 0x84,0xa2
}; };
// this is unused currently so avoid warnings about this
#if 0
// a character sequence encoded as iso8859-5 (iconv) // a character sequence encoded as iso8859-5 (iconv)
static const unsigned char iso8859_5[251] = 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, 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 0x9a,0xd1,0x9b,0xd1,0x9c,0xd1,0x9e,0xd1,0x9f,0xe2,0x84,0x96
}; };
#endif // 0
// DecodeUTF8 // DecodeUTF8
// decodes the specified *unterminated* UTF-8 byte array // decodes the specified *unterminated* UTF-8 byte array
@@ -896,7 +900,7 @@ void MBConvTestCase::Latin1Tests()
static const char nulstr[] = "foo\0bar\0"; static const char nulstr[] = "foo\0bar\0";
static const size_t mbLen = WXSIZEOF(nulstr) - 1; static const size_t mbLen = WXSIZEOF(nulstr) - 1;
size_t wcLen; size_t wcLen;
wxWCharBuffer wbuf(wxConvISO8859_1.cMB2WC(nulstr, mbLen, &wcLen)); wxConvISO8859_1.cMB2WC(nulstr, mbLen, &wcLen);
CPPUNIT_ASSERT_EQUAL( mbLen, wcLen ); CPPUNIT_ASSERT_EQUAL( mbLen, wcLen );
} }

View File

@@ -327,7 +327,7 @@ wxString wxRegExTestSuite::FlagStr(int flags)
} }
return _T(" (") + str.Mid(3) + _T(")"); return _T(" (") + str.Mid(3) + _T(")");
}; }
// register in the unnamed registry so that these tests are run by default // register in the unnamed registry so that these tests are run by default
CPPUNIT_TEST_SUITE_REGISTRATION(wxRegExTestSuite); CPPUNIT_TEST_SUITE_REGISTRATION(wxRegExTestSuite);

View File

@@ -185,7 +185,7 @@ void TextStreamTestCase::TestULongLong()
#if wxUSE_UNICODE #if wxUSE_UNICODE
const static wchar_t txtWchar[4] = static const wchar_t txtWchar[4] =
{ {
0x0041, // LATIN CAPITAL LETTER A 0x0041, // LATIN CAPITAL LETTER A
0x0100, // A WITH BREVE, LATIN SMALL LETTER 0x0100, // A WITH BREVE, LATIN SMALL LETTER
@@ -193,28 +193,28 @@ const static wchar_t txtWchar[4] =
0x0100, // A WITH BREVE, LATIN SMALL LETTER 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, 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, 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, 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,
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,
0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x01, 0x00,

View File

@@ -531,7 +531,7 @@ enum
Number_Unsigned = 2, // if not specified, works for signed conversion Number_Unsigned = 2, // if not specified, works for signed conversion
Number_Signed = 4, // if not specified, works for unsigned Number_Signed = 4, // if not specified, works for unsigned
Number_LongLong = 8, // only for long long tests 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 static const struct ToLongData

View File

@@ -243,12 +243,12 @@ void UnicodeTestCase::ConversionEmpty()
size_t len; size_t len;
#if wxUSE_UNICODE #if wxUSE_UNICODE
wxCharBuffer buf = wxConvLibc.cWC2MB(L"", 0, &len); wxConvLibc.cWC2MB(L"", 0, &len);
#else // !wxUSE_UNICODE #else // !wxUSE_UNICODE
wxWCharBuffer wbuf = wxConvLibc.cMB2WC("", 0, &len); wxConvLibc.cMB2WC("", 0, &len);
#endif // wxUSE_UNICODE/!wxUSE_UNICODE #endif // wxUSE_UNICODE/!wxUSE_UNICODE
CPPUNIT_ASSERT(len == 0); CPPUNIT_ASSERT_EQUAL( 0, len );
} }
void UnicodeTestCase::ConversionWithNULs() void UnicodeTestCase::ConversionWithNULs()
@@ -368,8 +368,8 @@ void UnicodeTestCase::ConversionUTF16()
// terminate the string, this exposed a bug in our conversion code which // terminate the string, this exposed a bug in our conversion code which
// got confused in this case // got confused in this case
size_t len; size_t len;
wxWCharBuffer wbuf(conv.cMB2WC("\x01\0\0B\0C" /* A macron BC */, 6, &len)); conv.cMB2WC("\x01\0\0B\0C" /* A macron BC */, 6, &len);
CPPUNIT_ASSERT_EQUAL( (size_t)3, len ); CPPUNIT_ASSERT_EQUAL( 3, len );
} }
void UnicodeTestCase::ConversionUTF32() void UnicodeTestCase::ConversionUTF32()
@@ -392,9 +392,8 @@ void UnicodeTestCase::ConversionUTF32()
} }
size_t len; size_t len;
wxWCharBuffer wbuf(conv.cMB2WC("\0\0\x01\0\0\0\0B\0\0\0C" /* A macron BC */, conv.cMB2WC("\0\0\x01\0\0\0\0B\0\0\0C" /* A macron BC */, 12, &len);
12, &len)); CPPUNIT_ASSERT_EQUAL( 3, len );
CPPUNIT_ASSERT_EQUAL( (size_t)3, len );
} }
void UnicodeTestCase::IsConvOk() void UnicodeTestCase::IsConvOk()

View File

@@ -89,8 +89,8 @@ void TextFileTestCase::CreateTestFile(size_t len, const char *contents)
FILE *f = fopen(GetTestFileName(), "wb"); FILE *f = fopen(GetTestFileName(), "wb");
CPPUNIT_ASSERT( f ); CPPUNIT_ASSERT( f );
CPPUNIT_ASSERT( fwrite(contents, 1, len, f) >= 0 ); CPPUNIT_ASSERT_EQUAL( len, fwrite(contents, 1, len, f) );
CPPUNIT_ASSERT( fclose(f) == 0 ); CPPUNIT_ASSERT_EQUAL( 0, fclose(f) );
} }
void TextFileTestCase::ReadEmpty() void TextFileTestCase::ReadEmpty()