Warning fixes found under hardest mode of OpenWatcom. Seems clean in Borland, MinGW and DMC.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29682 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -536,10 +536,10 @@ wxDateTime::Tm::Tm(const struct tm& tm, const TimeZone& tz)
|
|||||||
: m_tz(tz)
|
: m_tz(tz)
|
||||||
{
|
{
|
||||||
msec = 0;
|
msec = 0;
|
||||||
sec = tm.tm_sec;
|
sec = (wxDateTime::wxDateTime_t)tm.tm_sec;
|
||||||
min = tm.tm_min;
|
min = (wxDateTime::wxDateTime_t)tm.tm_min;
|
||||||
hour = tm.tm_hour;
|
hour = (wxDateTime::wxDateTime_t)tm.tm_hour;
|
||||||
mday = tm.tm_mday;
|
mday = (wxDateTime::wxDateTime_t)tm.tm_mday;
|
||||||
mon = (wxDateTime::Month)tm.tm_mon;
|
mon = (wxDateTime::Month)tm.tm_mon;
|
||||||
year = 1900 + tm.tm_year;
|
year = 1900 + tm.tm_year;
|
||||||
wday = tm.tm_wday;
|
wday = tm.tm_wday;
|
||||||
@@ -597,7 +597,7 @@ void wxDateTime::Tm::AddDays(int dayDiff)
|
|||||||
dayDiff += GetNumOfDaysInMonth(year, mon);
|
dayDiff += GetNumOfDaysInMonth(year, mon);
|
||||||
}
|
}
|
||||||
|
|
||||||
mday += dayDiff;
|
mday = (wxDateTime::wxDateTime_t)( mday + dayDiff );
|
||||||
while ( mday > GetNumOfDaysInMonth(year, mon) )
|
while ( mday > GetNumOfDaysInMonth(year, mon) )
|
||||||
{
|
{
|
||||||
mday -= GetNumOfDaysInMonth(year, mon);
|
mday -= GetNumOfDaysInMonth(year, mon);
|
||||||
@@ -1873,7 +1873,7 @@ bool wxDateTime::SetToWeekDay(WeekDay weekday,
|
|||||||
static inline
|
static inline
|
||||||
wxDateTime::wxDateTime_t GetDayOfYearFromTm(const wxDateTime::Tm& tm)
|
wxDateTime::wxDateTime_t GetDayOfYearFromTm(const wxDateTime::Tm& tm)
|
||||||
{
|
{
|
||||||
return gs_cumulatedDays[wxDateTime::IsLeapYear(tm.year)][tm.mon] + tm.mday;
|
return (wxDateTime::wxDateTime_t)(gs_cumulatedDays[wxDateTime::IsLeapYear(tm.year)][tm.mon] + tm.mday);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDateTime::wxDateTime_t wxDateTime::GetDayOfYear(const TimeZone& tz) const
|
wxDateTime::wxDateTime_t wxDateTime::GetDayOfYear(const TimeZone& tz) const
|
||||||
@@ -1941,7 +1941,7 @@ wxDateTime::GetWeekOfYear(wxDateTime::WeekFlags flags, const TimeZone& tz) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return week;
|
return (wxDateTime::wxDateTime_t)week;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDateTime::wxDateTime_t wxDateTime::GetWeekOfMonth(wxDateTime::WeekFlags flags,
|
wxDateTime::wxDateTime_t wxDateTime::GetWeekOfMonth(wxDateTime::WeekFlags flags,
|
||||||
@@ -2467,11 +2467,11 @@ const wxChar *wxDateTime::ParseRfc822Date(const wxChar* date)
|
|||||||
return (wxChar *)NULL;
|
return (wxChar *)NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDateTime_t day = *p++ - _T('0');
|
wxDateTime_t day = (wxDateTime_t)(*p++ - _T('0'));
|
||||||
if ( wxIsdigit(*p) )
|
if ( wxIsdigit(*p) )
|
||||||
{
|
{
|
||||||
day *= 10;
|
day *= 10;
|
||||||
day += *p++ - _T('0');
|
day = (wxDateTime_t)(day + (*p++ - _T('0')));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( *p++ != _T(' ') )
|
if ( *p++ != _T(' ') )
|
||||||
@@ -3392,19 +3392,23 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
|||||||
{
|
{
|
||||||
wxString date = wxGetTranslation(literalDates[n].str);
|
wxString date = wxGetTranslation(literalDates[n].str);
|
||||||
size_t len = date.length();
|
size_t len = date.length();
|
||||||
if ( wxStrlen(p) >= len && (wxString(p, len).CmpNoCase(date) == 0) )
|
if ( wxStrlen(p) >= len )
|
||||||
{
|
{
|
||||||
// nothing can follow this, so stop here
|
wxString str(p, len);
|
||||||
p += len;
|
if ( str.CmpNoCase(date) == 0 )
|
||||||
|
|
||||||
int dayDiffFromToday = literalDates[n].dayDiffFromToday;
|
|
||||||
*this = Today();
|
|
||||||
if ( dayDiffFromToday )
|
|
||||||
{
|
{
|
||||||
*this += wxDateSpan::Days(dayDiffFromToday);
|
// nothing can follow this, so stop here
|
||||||
}
|
p += len;
|
||||||
|
|
||||||
return p;
|
int dayDiffFromToday = literalDates[n].dayDiffFromToday;
|
||||||
|
*this = Today();
|
||||||
|
if ( dayDiffFromToday )
|
||||||
|
{
|
||||||
|
*this += wxDateSpan::Days(dayDiffFromToday);
|
||||||
|
}
|
||||||
|
|
||||||
|
return p;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1190,8 +1190,8 @@ public:
|
|||||||
// it doesn't work with CJK encodings (which we test for rather roughly
|
// it doesn't work with CJK encodings (which we test for rather roughly
|
||||||
// here...) nor with UTF-7/8 nor, of course, with Windows versions not
|
// here...) nor with UTF-7/8 nor, of course, with Windows versions not
|
||||||
// supporting it
|
// supporting it
|
||||||
BOOL usedDef wxDUMMY_INITIALIZE(false),
|
BOOL usedDef wxDUMMY_INITIALIZE(false);
|
||||||
*pUsedDef;
|
BOOL *pUsedDef;
|
||||||
int flags;
|
int flags;
|
||||||
if ( CanUseNoBestFit() && m_CodePage < 50000 )
|
if ( CanUseNoBestFit() && m_CodePage < 50000 )
|
||||||
{
|
{
|
||||||
@@ -1769,7 +1769,7 @@ size_t wxCSConv::WC2MB(char *buf, const wchar_t *psz, size_t n) const
|
|||||||
{
|
{
|
||||||
if (psz[c] > 0xFF)
|
if (psz[c] > 0xFF)
|
||||||
return (size_t)-1;
|
return (size_t)-1;
|
||||||
buf[c] = psz[c];
|
buf[c] = (char)psz[c];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -114,7 +114,7 @@ wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]
|
|||||||
|
|
||||||
bool isVirtual;
|
bool isVirtual;
|
||||||
|
|
||||||
WORD key = wxCharCodeWXToMSW(entries[i].GetKeyCode(), &isVirtual);
|
WORD key = (WORD)wxCharCodeWXToMSW(entries[i].GetKeyCode(), &isVirtual);
|
||||||
if (isVirtual)
|
if (isVirtual)
|
||||||
fVirt |= FVIRTKEY;
|
fVirt |= FVIRTKEY;
|
||||||
|
|
||||||
|
@@ -426,7 +426,7 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
|
|||||||
for ( int bits = 0; bits < 8; bits++)
|
for ( int bits = 0; bits < 8; bits++)
|
||||||
{
|
{
|
||||||
reversed <<= 1;
|
reversed <<= 1;
|
||||||
reversed |= (val & 0x01);
|
reversed |= (unsigned char)(val & 0x01);
|
||||||
val >>= 1;
|
val >>= 1;
|
||||||
}
|
}
|
||||||
*dst++ = reversed;
|
*dst++ = reversed;
|
||||||
@@ -1031,7 +1031,7 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
|
|||||||
#ifndef __WXMICROWIN__
|
#ifndef __WXMICROWIN__
|
||||||
// handle alpha channel, if any
|
// handle alpha channel, if any
|
||||||
if (HasAlpha())
|
if (HasAlpha())
|
||||||
ret.UseAlpha();
|
ret.UseAlpha();
|
||||||
|
|
||||||
// copy bitmap data
|
// copy bitmap data
|
||||||
MemoryHDC dcSrc,
|
MemoryHDC dcSrc,
|
||||||
|
@@ -2461,6 +2461,7 @@ static bool AlphaBlt(HDC hdcDst,
|
|||||||
#else // !wxHAVE_RAW_BITMAP
|
#else // !wxHAVE_RAW_BITMAP
|
||||||
// no wxAlphaBlend() neither, fall back to using simple BitBlt() (we lose
|
// no wxAlphaBlend() neither, fall back to using simple BitBlt() (we lose
|
||||||
// alpha but at least something will be shown like this)
|
// alpha but at least something will be shown like this)
|
||||||
|
wxUnusedVar(bmp);
|
||||||
return false;
|
return false;
|
||||||
#endif // wxHAVE_RAW_BITMAP
|
#endif // wxHAVE_RAW_BITMAP
|
||||||
}
|
}
|
||||||
|
@@ -460,7 +460,7 @@ wxString wxDialUpManagerMSW::GetErrorString(DWORD error)
|
|||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
// we want the error message to start from a lower case letter
|
// we want the error message to start from a lower case letter
|
||||||
buffer[0] = wxTolower(buffer[0]);
|
buffer[0] = (wxChar)wxTolower(buffer[0]);
|
||||||
|
|
||||||
return wxString(buffer);
|
return wxString(buffer);
|
||||||
}
|
}
|
||||||
|
@@ -69,7 +69,7 @@ static inline WORD GetNumberOfColours(WORD bitsPerPixel)
|
|||||||
{
|
{
|
||||||
// only 1, 4 and 8bpp bitmaps use palettes (well, they could be used with
|
// only 1, 4 and 8bpp bitmaps use palettes (well, they could be used with
|
||||||
// 24bpp ones too but we don't support this as I think it's quite uncommon)
|
// 24bpp ones too but we don't support this as I think it's quite uncommon)
|
||||||
return bitsPerPixel <= 8 ? 1 << bitsPerPixel : 0;
|
return (WORD)(bitsPerPixel <= 8 ? 1 << bitsPerPixel : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// wrapper around ::GetObject() for DIB sections
|
// wrapper around ::GetObject() for DIB sections
|
||||||
@@ -674,9 +674,9 @@ bool wxDIB::Create(const wxImage& image)
|
|||||||
// RGB order is reversed, and we need to premultiply
|
// RGB order is reversed, and we need to premultiply
|
||||||
// all channels by alpha value for use with ::AlphaBlend.
|
// all channels by alpha value for use with ::AlphaBlend.
|
||||||
const unsigned char a = *alpha++;
|
const unsigned char a = *alpha++;
|
||||||
*dst++ = (src[2] * a + 127) / 255;
|
*dst++ = (unsigned char)((src[2] * a + 127) / 255);
|
||||||
*dst++ = (src[1] * a + 127) / 255;
|
*dst++ = (unsigned char)((src[1] * a + 127) / 255);
|
||||||
*dst++ = (src[0] * a + 127) / 255;
|
*dst++ = (unsigned char)((src[0] * a + 127) / 255);
|
||||||
*dst++ = a;
|
*dst++ = a;
|
||||||
src += 3;
|
src += 3;
|
||||||
}
|
}
|
||||||
|
@@ -165,10 +165,10 @@ public:
|
|||||||
return m_nativeFontInfoOk ? m_nativeFontInfo.GetPixelSize()
|
return m_nativeFontInfoOk ? m_nativeFontInfo.GetPixelSize()
|
||||||
: m_pixelSize;
|
: m_pixelSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsUsingSizeInPixels() const
|
bool IsUsingSizeInPixels() const
|
||||||
{
|
{
|
||||||
return m_nativeFontInfoOk ? TRUE : m_sizeUsingPixels;
|
return m_nativeFontInfoOk ? true : m_sizeUsingPixels;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetFamily() const
|
int GetFamily() const
|
||||||
@@ -1041,8 +1041,8 @@ bool wxFont::IsFixedWidth() const
|
|||||||
{
|
{
|
||||||
// the two low-order bits specify the pitch of the font, the rest is
|
// the two low-order bits specify the pitch of the font, the rest is
|
||||||
// family
|
// family
|
||||||
BYTE pitch = M_FONTDATA->GetNativeFontInfo().
|
BYTE pitch =
|
||||||
lf.lfPitchAndFamily & PITCH_MASK;
|
(BYTE)(M_FONTDATA->GetNativeFontInfo().lf.lfPitchAndFamily & PITCH_MASK);
|
||||||
|
|
||||||
return pitch == FIXED_PITCH;
|
return pitch == FIXED_PITCH;
|
||||||
}
|
}
|
||||||
|
@@ -1528,24 +1528,15 @@ GSocketError _GAddress_Init_UNIX(GAddress *address)
|
|||||||
return GSOCK_INVADDR;
|
return GSOCK_INVADDR;
|
||||||
}
|
}
|
||||||
|
|
||||||
GSocketError GAddress_UNIX_SetPath(GAddress *address, const char *path)
|
GSocketError GAddress_UNIX_SetPath(GAddress *address, const char *WXUNUSED(path))
|
||||||
{
|
{
|
||||||
#if defined(__BORLANDC__)
|
|
||||||
/* prevents unused variable message in Borland */
|
|
||||||
(void)path;
|
|
||||||
#endif
|
|
||||||
assert (address != NULL);
|
assert (address != NULL);
|
||||||
address->m_error = GSOCK_INVADDR;
|
address->m_error = GSOCK_INVADDR;
|
||||||
return GSOCK_INVADDR;
|
return GSOCK_INVADDR;
|
||||||
}
|
}
|
||||||
|
|
||||||
GSocketError GAddress_UNIX_GetPath(GAddress *address, char *path, size_t sbuf)
|
GSocketError GAddress_UNIX_GetPath(GAddress *address, char *WXUNUSED(path), size_t WXUNUSED(sbuf))
|
||||||
{
|
{
|
||||||
#if defined(__BORLANDC__)
|
|
||||||
/* prevents unused variable message in Borland */
|
|
||||||
(void)path;
|
|
||||||
(void)sbuf;
|
|
||||||
#endif
|
|
||||||
assert (address != NULL);
|
assert (address != NULL);
|
||||||
address->m_error = GSOCK_INVADDR;
|
address->m_error = GSOCK_INVADDR;
|
||||||
return GSOCK_INVADDR;
|
return GSOCK_INVADDR;
|
||||||
|
@@ -4134,7 +4134,8 @@ bool wxWindowMSW::HandleMaximize()
|
|||||||
|
|
||||||
bool wxWindowMSW::HandleMove(int x, int y)
|
bool wxWindowMSW::HandleMove(int x, int y)
|
||||||
{
|
{
|
||||||
wxMoveEvent event(wxPoint(x, y), m_windowId);
|
wxPoint point(x,y);
|
||||||
|
wxMoveEvent event(point, m_windowId);
|
||||||
event.SetEventObject(this);
|
event.SetEventObject(this);
|
||||||
|
|
||||||
return GetEventHandler()->ProcessEvent(event);
|
return GetEventHandler()->ProcessEvent(event);
|
||||||
@@ -4708,7 +4709,7 @@ int wxWindowMSW::HandleMenuChar(int chAccel, WXLPARAM lParam)
|
|||||||
// FIXME-UNICODE: this comparison doesn't risk to work
|
// FIXME-UNICODE: this comparison doesn't risk to work
|
||||||
// for non ASCII accelerator characters I'm afraid, but
|
// for non ASCII accelerator characters I'm afraid, but
|
||||||
// what can we do?
|
// what can we do?
|
||||||
if ( wxToupper(*p) == (wchar_t)chAccel )
|
if ( (wchar_t)wxToupper(*p) == (wchar_t)chAccel )
|
||||||
{
|
{
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user