fix some warnings from GCC -Wextra

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53599 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2008-05-15 17:24:48 +00:00
parent d3338a5a34
commit 2a23042680
12 changed files with 31 additions and 22 deletions

View File

@@ -478,7 +478,9 @@ public:
: m_text(text), m_icon(icon)
{ }
wxDataViewIconText( const wxDataViewIconText &other )
{ m_icon = other.m_icon; m_text = other.m_text; }
: wxObject()
, m_text(other.m_text), m_icon(other.m_icon)
{ }
void SetText( const wxString &text ) { m_text = text; }
wxString GetText() const { return m_text; }

View File

@@ -114,7 +114,7 @@ private:
virtual void DoDrawArc(wxCoord, wxCoord, wxCoord, wxCoord, wxCoord, wxCoord);
virtual void DoDrawBitmap(const wxBitmap &, wxCoord, wxCoord, bool = 0);
virtual void DoDrawBitmap(const wxBitmap &, wxCoord, wxCoord, bool = false);
virtual void DoDrawCheckMark(wxCoord x, wxCoord y, wxCoord w, wxCoord h);

View File

@@ -31,6 +31,7 @@ public:
InitFromStream(stream, lenFile);
}
wxMemoryInputStream(wxMemoryInputStream& stream)
: wxInputStream()
{
InitFromStream(stream, wxInvalidOffset);
}

View File

@@ -176,7 +176,7 @@ wxIcon wxIconBundle::GetIcon(const wxSize& size) const
// the best icon is by default (arbitrarily) the first one but
// if we find a system-sized icon, take it instead
if ( sx == sysX && sy == sysY || !iconBest.IsOk() )
if ((sx == sysX && sy == sysY) || !iconBest.IsOk())
iconBest = icon;
}
}

View File

@@ -282,12 +282,14 @@ bool wxRegExImpl::Compile(const wxString& expr, int flags)
// translate our flags to regcomp() ones
int flagsRE = 0;
if ( !(flags & wxRE_BASIC) )
{
#ifndef WX_NO_REGEX_ADVANCED
if (flags & wxRE_ADVANCED)
flagsRE |= REG_ADVANCED;
else
#endif
flagsRE |= REG_EXTENDED;
}
if ( flags & wxRE_ICASE )
flagsRE |= REG_ICASE;
if ( flags & wxRE_NOSUB )

View File

@@ -370,7 +370,8 @@ bool wxGenericValidator::TransferToWindow(void)
}
} else
#endif
; // to match the last 'else' above
{ // to match the last 'else' above
}
// unrecognized control, or bad pointer
return false;

View File

@@ -1080,7 +1080,7 @@ static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent)
// open file
// ---------
bool bOk wxDUMMY_INITIALIZE(false);
bool bOk = false;
if ( wxFile::Exists(filename) ) {
bool bAppend = false;
wxString strMsg;

View File

@@ -208,9 +208,9 @@ void wxGenericPrintDialog::Init(wxWindow * WXUNUSED(parent))
if (factory->HasStatusLine())
{
flex->Add( new wxStaticText( this, wxID_ANY, _("Status:") ),
0, wxALIGN_CENTER_VERTICAL|wxALL-wxTOP, 5 );
0, wxALIGN_CENTER_VERTICAL|(wxALL-wxTOP), 5 );
flex->Add( new wxStaticText( this, wxID_ANY, factory->CreateStatusLine() ),
0, wxALIGN_CENTER_VERTICAL|wxALL-wxTOP, 5 );
0, wxALIGN_CENTER_VERTICAL|(wxALL-wxTOP), 5 );
}
mainsizer->Add( topsizer, 0, wxLEFT|wxTOP|wxRIGHT|wxGROW, 10 );
@@ -361,10 +361,12 @@ bool wxGenericPrintDialog::TransferDataToWindow()
if (m_printDialogData.GetToPage() > 0)
m_toText->SetValue(wxString::Format(_T("%d"), m_printDialogData.GetToPage()));
if(m_rangeRadioBox)
{
if (m_printDialogData.GetAllPages() || m_printDialogData.GetFromPage() == 0)
m_rangeRadioBox->SetSelection(0);
else
m_rangeRadioBox->SetSelection(1);
}
}
else
{

View File

@@ -592,8 +592,8 @@ bool wxVarScrollHelperBase::DoScrollToUnit(size_t unit)
// finally refresh the display -- but only redraw as few units as possible
// to avoid flicker. We can't do this if we have children because they
// won't be scrolled
if ( m_targetWindow->GetChildren().empty() &&
GetVisibleBegin() >= unitLastOld || GetVisibleEnd() <= unitFirstOld )
if ( (m_targetWindow->GetChildren().empty() &&
GetVisibleBegin() >= unitLastOld) || GetVisibleEnd() <= unitFirstOld )
{
// the simplest case: we don't have any old units left, just redraw
// everything

View File

@@ -902,8 +902,8 @@ void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
const bool hasAlpha = HasAlpha();
// allow access if bpp is valid and matches existence of alpha
if (pixbuf != NULL && (
bpp == 24 && !hasAlpha ||
bpp == 32 && hasAlpha))
(bpp == 24 && !hasAlpha) ||
(bpp == 32 && hasAlpha)))
{
data.m_height = gdk_pixbuf_get_height( pixbuf );
data.m_width = gdk_pixbuf_get_width( pixbuf );

View File

@@ -500,11 +500,11 @@ static long wxTranslateKeySymToWXKey(KeySym keysym, bool isChar)
case GDK_KP_7:
case GDK_KP_8:
case GDK_KP_9:
key_code = (isChar ? '0' : WXK_NUMPAD0) + keysym - GDK_KP_0;
key_code = (isChar ? '0' : int(WXK_NUMPAD0)) + keysym - GDK_KP_0;
break;
case GDK_KP_Space:
key_code = isChar ? ' ' : WXK_NUMPAD_SPACE;
key_code = isChar ? ' ' : int(WXK_NUMPAD_SPACE);
break;
case GDK_KP_Tab:
@@ -576,32 +576,32 @@ static long wxTranslateKeySymToWXKey(KeySym keysym, bool isChar)
break;
case GDK_KP_Equal:
key_code = isChar ? '=' : WXK_NUMPAD_EQUAL;
key_code = isChar ? '=' : int(WXK_NUMPAD_EQUAL);
break;
case GDK_KP_Multiply:
key_code = isChar ? '*' : WXK_NUMPAD_MULTIPLY;
key_code = isChar ? '*' : int(WXK_NUMPAD_MULTIPLY);
break;
case GDK_KP_Add:
key_code = isChar ? '+' : WXK_NUMPAD_ADD;
key_code = isChar ? '+' : int(WXK_NUMPAD_ADD);
break;
case GDK_KP_Separator:
// FIXME: what is this?
key_code = isChar ? '.' : WXK_NUMPAD_SEPARATOR;
key_code = isChar ? '.' : int(WXK_NUMPAD_SEPARATOR);
break;
case GDK_KP_Subtract:
key_code = isChar ? '-' : WXK_NUMPAD_SUBTRACT;
key_code = isChar ? '-' : int(WXK_NUMPAD_SUBTRACT);
break;
case GDK_KP_Decimal:
key_code = isChar ? '.' : WXK_NUMPAD_DECIMAL;
key_code = isChar ? '.' : int(WXK_NUMPAD_DECIMAL);
break;
case GDK_KP_Divide:
key_code = isChar ? '/' : WXK_NUMPAD_DIVIDE;
key_code = isChar ? '/' : int(WXK_NUMPAD_DIVIDE);
break;

View File

@@ -875,7 +875,7 @@ wxRichTextLine* wxRichTextParagraphLayoutBox::GetLineAtPosition(long pos, bool c
// If the position is end-of-paragraph, then return the last line of
// of the paragraph.
(range.GetEnd() == child->GetRange().GetEnd()-1) && (pos == child->GetRange().GetEnd()))
((range.GetEnd() == child->GetRange().GetEnd()-1) && (pos == child->GetRange().GetEnd())))
return line;
node2 = node2->GetNext();
@@ -5943,7 +5943,7 @@ wxString wxRichTextBuffer::GetExtWildcard(bool combine, bool save, wxArrayInt* t
while (node)
{
wxRichTextFileHandler* handler = (wxRichTextFileHandler*) node->GetData();
if (handler->IsVisible() && ((save && handler->CanSave()) || !save && handler->CanLoad()))
if (handler->IsVisible() && ((save && handler->CanSave()) || (!save && handler->CanLoad())))
{
if (combine)
{
@@ -7774,6 +7774,7 @@ wxRichTextFontTable::wxRichTextFontTable()
}
wxRichTextFontTable::wxRichTextFontTable(const wxRichTextFontTable& table)
: wxObject()
{
(*this) = table;
}