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@29784 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-10-11 16:30:43 +00:00
parent e40bae72d4
commit 42841dfcad
19 changed files with 50 additions and 57 deletions

View File

@@ -117,7 +117,7 @@ public:
long style = 0);
// empty but ensures that dtor of all derived classes is virtual
virtual ~wxConfigBase();
virtual ~wxConfigBase(){};
// path management
// set current path: if the first character is '/', it's the absolute path,

View File

@@ -1327,7 +1327,7 @@ public:
static void AddAuthority(wxDateTimeHolidayAuthority *auth);
// the base class must have a virtual dtor
virtual ~wxDateTimeHolidayAuthority();
virtual ~wxDateTimeHolidayAuthority(){};
protected:
// this function is called to determine whether a given day is a holiday

View File

@@ -84,7 +84,7 @@ struct WXDLLIMPEXP_HTML wxHtmlHelpDataItem
{
wxHtmlHelpDataItem() : level(0), parent(NULL), id(wxID_ANY), book(NULL) {}
short int level;
int level;
wxHtmlHelpDataItem *parent;
int id;
wxString name;
@@ -110,7 +110,7 @@ struct wxHtmlContentsItem
wxHtmlContentsItem& operator=(const wxHtmlContentsItem& d);
~wxHtmlContentsItem();
short int m_Level;
int m_Level;
int m_ID;
wxChar *m_Name;
wxChar *m_Page;

View File

@@ -39,7 +39,7 @@ public:
long style = wxCONFIG_USE_GLOBAL_FILE);
// dtor will save unsaved data
virtual ~wxRegConfig();
virtual ~wxRegConfig(){};
// implement inherited pure virtual functions
// ------------------------------------------

View File

@@ -165,7 +165,7 @@ public:
wxMBConv& conv = wxConvUTF8);
// dtor
virtual ~wxTextBuffer();
virtual ~wxTextBuffer(){};
protected:
// ctors

View File

@@ -73,10 +73,6 @@ wxConfigBase::wxConfigBase(const wxString& appName,
m_bRecordDefaults = false;
}
wxConfigBase::~wxConfigBase()
{
}
wxConfigBase *wxConfigBase::Set(wxConfigBase *pConfig)
{
wxConfigBase *pOld = ms_pConfig;

View File

@@ -1974,7 +1974,7 @@ wxDateTime& wxDateTime::SetToYearDay(wxDateTime::wxDateTime_t yday)
// yday lies in December then
if ( (mon == Dec) || (yday <= gs_cumulatedDays[isLeap][mon + 1]) )
{
Set(yday - gs_cumulatedDays[isLeap][mon], mon, year);
Set((wxDateTime::wxDateTime_t)(yday - gs_cumulatedDays[isLeap][mon]), mon, year);
break;
}
@@ -2565,7 +2565,7 @@ const wxChar *wxDateTime::ParseRfc822Date(const wxChar* date)
return (wxChar *)NULL;
}
wxDateTime_t hour = *p++ - _T('0');
wxDateTime_t hour = (wxDateTime_t)(*p++ - _T('0'));
if ( !wxIsdigit(*p) )
{
@@ -2573,7 +2573,7 @@ const wxChar *wxDateTime::ParseRfc822Date(const wxChar* date)
}
hour *= 10;
hour += *p++ - _T('0');
hour = (wxDateTime_t)(hour + (*p++ - _T('0')));
if ( *p++ != _T(':') )
{
@@ -2585,7 +2585,7 @@ const wxChar *wxDateTime::ParseRfc822Date(const wxChar* date)
return (wxChar *)NULL;
}
wxDateTime_t min = *p++ - _T('0');
wxDateTime_t min = (wxDateTime_t)(*p++ - _T('0'));
if ( !wxIsdigit(*p) )
{
@@ -2593,7 +2593,7 @@ const wxChar *wxDateTime::ParseRfc822Date(const wxChar* date)
}
min *= 10;
min += *p++ - _T('0');
min = (wxDateTime_t)(min + *p++ - _T('0'));
wxDateTime_t sec = 0;
if ( *p++ == _T(':') )
@@ -2603,7 +2603,7 @@ const wxChar *wxDateTime::ParseRfc822Date(const wxChar* date)
return (wxChar *)NULL;
}
sec = *p++ - _T('0');
sec = (wxDateTime_t)(*p++ - _T('0'));
if ( !wxIsdigit(*p) )
{
@@ -2611,7 +2611,7 @@ const wxChar *wxDateTime::ParseRfc822Date(const wxChar* date)
}
sec *= 10;
sec += *p++ - _T('0');
sec = (wxDateTime_t)(sec + *p++ - _T('0'));
}
if ( *p++ != _T(' ') )
@@ -3463,9 +3463,11 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
}
else // may be either day or year
{
wxDateTime_t maxDays = haveMon
wxDateTime_t maxDays = (wxDateTime_t)(
haveMon
? GetNumOfDaysInMonth(haveYear ? year : Inv_Year, mon)
: 31;
: 31
);
// can it be day?
if ( (val == 0) || (val > (unsigned long)maxDays) )
@@ -3519,7 +3521,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
{
// no need to check in month range as always < 12, but
// the days are counted from 1 unlike the months
day = (wxDateTime_t)mon + 1;
day = (wxDateTime_t)(mon + 1);
haveDay = true;
}
else
@@ -3641,7 +3643,7 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
// we're in the current year then
if ( (year > 0) && (year <= (int)GetNumOfDaysInMonth(Inv_Year, mon)) )
{
day = year;
day = (wxDateTime_t)year;
haveMon = true;
haveYear = false;
@@ -4028,11 +4030,6 @@ void wxDateTimeHolidayAuthority::AddAuthority(wxDateTimeHolidayAuthority *auth)
ms_authorities.push_back(auth);
}
wxDateTimeHolidayAuthority::~wxDateTimeHolidayAuthority()
{
// nothing to do here
}
// ----------------------------------------------------------------------------
// wxDateTimeWorkDays
// ----------------------------------------------------------------------------

View File

@@ -1351,7 +1351,7 @@ void wxBoxSizer::RecalcSizes()
}
wxPoint child_pos( pt );
wxSize child_size( wxSize( size.x, height) );
wxSize child_size( size.x, height );
if (item->GetFlag() & (wxEXPAND | wxSHAPED))
child_size.x = m_size.x;
@@ -1377,7 +1377,7 @@ void wxBoxSizer::RecalcSizes()
}
wxPoint child_pos( pt );
wxSize child_size( wxSize(width, size.y) );
wxSize child_size( width, size.y );
if (item->GetFlag() & (wxEXPAND | wxSHAPED))
child_size.y = m_size.y;

View File

@@ -146,10 +146,6 @@ wxTextBuffer::wxTextBuffer(const wxString& strBufferName)
m_isOpened = false;
}
wxTextBuffer::~wxTextBuffer()
{
}
// ----------------------------------------------------------------------------
// buffer operations
// ----------------------------------------------------------------------------

View File

@@ -144,7 +144,8 @@ wxRect wxChoicebook::GetPageRect() const
{
const wxSize sizeChoice = m_choice->GetSize();
wxRect rectPage(wxPoint(0, 0), GetClientSize());
wxPoint pt(0, 0);
wxRect rectPage(pt, GetClientSize());
switch ( GetWindowStyle() & wxCHB_ALIGN_MASK )
{
default:

View File

@@ -1072,7 +1072,8 @@ void wxGridCellFloatEditor::StartingKey(wxKeyEvent& event)
char tmpbuf[2];
tmpbuf[0] = (char) keycode;
tmpbuf[1] = '\0';
bool is_decimal_point = ( wxString(tmpbuf, *wxConvCurrent) ==
wxString strbuf(tmpbuf, *wxConvCurrent);
bool is_decimal_point = ( strbuf ==
wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER) );
if ( wxIsdigit(keycode) || keycode == '+' || keycode == '-'
|| is_decimal_point

View File

@@ -172,7 +172,8 @@ wxRect wxListbook::GetPageRect() const
{
const wxSize sizeList = m_list->GetSize();
wxRect rectPage(wxPoint(0, 0), GetClientSize());
wxPoint pt(0, 0);
wxRect rectPage(pt, GetClientSize());
switch ( GetWindowStyle() & wxLB_ALIGN_MASK )
{
default:

View File

@@ -483,8 +483,10 @@ void wxSashWindow::DrawSash(wxSashEdgePosition edge, wxDC& dc)
wxPen darkShadowPen(m_darkShadowColour, 1, wxSOLID);
wxPen lightShadowPen(m_lightShadowColour, 1, wxSOLID);
wxPen hilightPen(m_hilightColour, 1, wxSOLID);
wxPen blackPen(wxColour(0, 0, 0), 1, wxSOLID);
wxPen whitePen(wxColour(255, 255, 255), 1, wxSOLID);
wxColour blackClr(0, 0, 0);
wxColour whiteClr(255, 255, 255);
wxPen blackPen(blackClr, 1, wxSOLID);
wxPen whitePen(whiteClr, 1, wxSOLID);
if ( edge == wxSASH_LEFT || edge == wxSASH_RIGHT )
{

View File

@@ -686,7 +686,7 @@ bool wxHtmlHelpData::AddBook(const wxString& book)
lineptr = ReadLine(lineptr, linebuf, 300);
for (wxChar *ch = linebuf; *ch != wxT('\0') && *ch != wxT('='); ch++)
*ch = tolower(*ch);
*ch = (wxChar)wxTolower(*ch);
if (wxStrstr(linebuf, _T("title=")) == linebuf)
title = linebuf + wxStrlen(_T("title="));

View File

@@ -1674,7 +1674,7 @@ void wxHtmlHelpFrame::OnIndexFind(wxCommandEvent& event)
// other items, show them as well, because they are refinements
// of the displayed index entry (i.e. it is implicitly contained
// in them: "foo" with parent "bar" reads as "bar, foo"):
short int level = index[i].items[0]->level;
int level = index[i].items[0]->level;
i++;
while (i < cnt && index[i].items[0]->level > level)
{

View File

@@ -90,7 +90,7 @@ wxHtmlTagsCache::wxHtmlTagsCache(const wxString& source)
src[pos] != wxT('>') && !wxIsspace(src[pos]);
i++, pos++ )
{
tagBuffer[i] = wxToupper(src[pos]);
tagBuffer[i] = (wxChar)wxToupper(src[pos]);
}
tagBuffer[i] = _T('\0');

View File

@@ -513,7 +513,9 @@ wxString wxListBox::GetString(int N) const
// +1 for terminating NUL
wxString result;
ListBox_GetText(GetHwnd(), N, wxStringBuffer(result, len + 1));
wxChar* buffer = result.GetWriteBuf(len + 1);
ListBox_GetText(GetHwnd(), N, buffer);
result.UngetWriteBuf();
return result;
}
@@ -805,8 +807,9 @@ bool wxListBox::MSWOnDraw(WXDRAWITEMSTRUCT *item)
wxListBoxItem *pItem = (wxListBoxItem *)data;
wxDCTemp dc((WXHDC)pStruct->hDC);
wxRect rect(wxPoint(pStruct->rcItem.left, pStruct->rcItem.top),
wxPoint(pStruct->rcItem.right, pStruct->rcItem.bottom));
wxPoint pt1(pStruct->rcItem.left, pStruct->rcItem.top);
wxPoint pt2(pStruct->rcItem.right, pStruct->rcItem.bottom);
wxRect rect(pt1, pt2);
return pItem->OnDrawItem(dc, rect,
(wxOwnerDrawn::wxODAction)pStruct->itemAction,

View File

@@ -151,11 +151,6 @@ wxRegConfig::wxRegConfig(const wxString& appName, const wxString& vendorName,
}
}
wxRegConfig::~wxRegConfig()
{
// nothing to do - key will be closed in their dtors
}
// ----------------------------------------------------------------------------
// path management
// ----------------------------------------------------------------------------

View File

@@ -482,7 +482,8 @@ static int UnknownEncodingHnd(void * WXUNUSED(encodingHandlerData),
// We must build conversion table for expat. The easiest way to do so
// is to let wxCSConv convert as string containing all characters to
// wide character representation:
wxCSConv conv(wxString(name, wxConvLibc));
wxString str(name, wxConvLibc);
wxCSConv conv(str);
char mbBuf[2];
wchar_t wcBuf[10];
size_t i;