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)
|
||||
{
|
||||
msec = 0;
|
||||
sec = tm.tm_sec;
|
||||
min = tm.tm_min;
|
||||
hour = tm.tm_hour;
|
||||
mday = tm.tm_mday;
|
||||
sec = (wxDateTime::wxDateTime_t)tm.tm_sec;
|
||||
min = (wxDateTime::wxDateTime_t)tm.tm_min;
|
||||
hour = (wxDateTime::wxDateTime_t)tm.tm_hour;
|
||||
mday = (wxDateTime::wxDateTime_t)tm.tm_mday;
|
||||
mon = (wxDateTime::Month)tm.tm_mon;
|
||||
year = 1900 + tm.tm_year;
|
||||
wday = tm.tm_wday;
|
||||
@@ -597,7 +597,7 @@ void wxDateTime::Tm::AddDays(int dayDiff)
|
||||
dayDiff += GetNumOfDaysInMonth(year, mon);
|
||||
}
|
||||
|
||||
mday += dayDiff;
|
||||
mday = (wxDateTime::wxDateTime_t)( mday + dayDiff );
|
||||
while ( mday > GetNumOfDaysInMonth(year, mon) )
|
||||
{
|
||||
mday -= GetNumOfDaysInMonth(year, mon);
|
||||
@@ -1873,7 +1873,7 @@ bool wxDateTime::SetToWeekDay(WeekDay weekday,
|
||||
static inline
|
||||
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
|
||||
@@ -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,
|
||||
@@ -2467,11 +2467,11 @@ const wxChar *wxDateTime::ParseRfc822Date(const wxChar* date)
|
||||
return (wxChar *)NULL;
|
||||
}
|
||||
|
||||
wxDateTime_t day = *p++ - _T('0');
|
||||
wxDateTime_t day = (wxDateTime_t)(*p++ - _T('0'));
|
||||
if ( wxIsdigit(*p) )
|
||||
{
|
||||
day *= 10;
|
||||
day += *p++ - _T('0');
|
||||
day = (wxDateTime_t)(day + (*p++ - _T('0')));
|
||||
}
|
||||
|
||||
if ( *p++ != _T(' ') )
|
||||
@@ -3392,7 +3392,10 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
||||
{
|
||||
wxString date = wxGetTranslation(literalDates[n].str);
|
||||
size_t len = date.length();
|
||||
if ( wxStrlen(p) >= len && (wxString(p, len).CmpNoCase(date) == 0) )
|
||||
if ( wxStrlen(p) >= len )
|
||||
{
|
||||
wxString str(p, len);
|
||||
if ( str.CmpNoCase(date) == 0 )
|
||||
{
|
||||
// nothing can follow this, so stop here
|
||||
p += len;
|
||||
@@ -3407,6 +3410,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
|
||||
return p;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We try to guess what we have here: for each new (numeric) token, we
|
||||
// determine if it can be a month, day or a year. Of course, there is an
|
||||
|
@@ -1190,8 +1190,8 @@ public:
|
||||
// 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
|
||||
// supporting it
|
||||
BOOL usedDef wxDUMMY_INITIALIZE(false),
|
||||
*pUsedDef;
|
||||
BOOL usedDef wxDUMMY_INITIALIZE(false);
|
||||
BOOL *pUsedDef;
|
||||
int flags;
|
||||
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)
|
||||
return (size_t)-1;
|
||||
buf[c] = psz[c];
|
||||
buf[c] = (char)psz[c];
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -114,7 +114,7 @@ wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]
|
||||
|
||||
bool isVirtual;
|
||||
|
||||
WORD key = wxCharCodeWXToMSW(entries[i].GetKeyCode(), &isVirtual);
|
||||
WORD key = (WORD)wxCharCodeWXToMSW(entries[i].GetKeyCode(), &isVirtual);
|
||||
if (isVirtual)
|
||||
fVirt |= FVIRTKEY;
|
||||
|
||||
|
@@ -426,7 +426,7 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
|
||||
for ( int bits = 0; bits < 8; bits++)
|
||||
{
|
||||
reversed <<= 1;
|
||||
reversed |= (val & 0x01);
|
||||
reversed |= (unsigned char)(val & 0x01);
|
||||
val >>= 1;
|
||||
}
|
||||
*dst++ = reversed;
|
||||
|
@@ -2461,6 +2461,7 @@ static bool AlphaBlt(HDC hdcDst,
|
||||
#else // !wxHAVE_RAW_BITMAP
|
||||
// no wxAlphaBlend() neither, fall back to using simple BitBlt() (we lose
|
||||
// alpha but at least something will be shown like this)
|
||||
wxUnusedVar(bmp);
|
||||
return false;
|
||||
#endif // wxHAVE_RAW_BITMAP
|
||||
}
|
||||
|
@@ -460,7 +460,7 @@ wxString wxDialUpManagerMSW::GetErrorString(DWORD error)
|
||||
|
||||
case 0:
|
||||
// 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);
|
||||
}
|
||||
|
@@ -69,7 +69,7 @@ static inline WORD GetNumberOfColours(WORD bitsPerPixel)
|
||||
{
|
||||
// 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)
|
||||
return bitsPerPixel <= 8 ? 1 << bitsPerPixel : 0;
|
||||
return (WORD)(bitsPerPixel <= 8 ? 1 << bitsPerPixel : 0);
|
||||
}
|
||||
|
||||
// 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
|
||||
// all channels by alpha value for use with ::AlphaBlend.
|
||||
const unsigned char a = *alpha++;
|
||||
*dst++ = (src[2] * a + 127) / 255;
|
||||
*dst++ = (src[1] * a + 127) / 255;
|
||||
*dst++ = (src[0] * a + 127) / 255;
|
||||
*dst++ = (unsigned char)((src[2] * a + 127) / 255);
|
||||
*dst++ = (unsigned char)((src[1] * a + 127) / 255);
|
||||
*dst++ = (unsigned char)((src[0] * a + 127) / 255);
|
||||
*dst++ = a;
|
||||
src += 3;
|
||||
}
|
||||
|
@@ -168,7 +168,7 @@ public:
|
||||
|
||||
bool IsUsingSizeInPixels() const
|
||||
{
|
||||
return m_nativeFontInfoOk ? TRUE : m_sizeUsingPixels;
|
||||
return m_nativeFontInfoOk ? true : m_sizeUsingPixels;
|
||||
}
|
||||
|
||||
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
|
||||
// family
|
||||
BYTE pitch = M_FONTDATA->GetNativeFontInfo().
|
||||
lf.lfPitchAndFamily & PITCH_MASK;
|
||||
BYTE pitch =
|
||||
(BYTE)(M_FONTDATA->GetNativeFontInfo().lf.lfPitchAndFamily & PITCH_MASK);
|
||||
|
||||
return pitch == FIXED_PITCH;
|
||||
}
|
||||
|
@@ -1528,24 +1528,15 @@ GSocketError _GAddress_Init_UNIX(GAddress *address)
|
||||
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);
|
||||
address->m_error = 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);
|
||||
address->m_error = GSOCK_INVADDR;
|
||||
return GSOCK_INVADDR;
|
||||
|
@@ -4134,7 +4134,8 @@ bool wxWindowMSW::HandleMaximize()
|
||||
|
||||
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);
|
||||
|
||||
return GetEventHandler()->ProcessEvent(event);
|
||||
@@ -4708,7 +4709,7 @@ int wxWindowMSW::HandleMenuChar(int chAccel, WXLPARAM lParam)
|
||||
// FIXME-UNICODE: this comparison doesn't risk to work
|
||||
// for non ASCII accelerator characters I'm afraid, but
|
||||
// what can we do?
|
||||
if ( wxToupper(*p) == (wchar_t)chAccel )
|
||||
if ( (wchar_t)wxToupper(*p) == (wchar_t)chAccel )
|
||||
{
|
||||
return i;
|
||||
}
|
||||
|
Reference in New Issue
Block a user