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:
@@ -478,7 +478,9 @@ public:
|
|||||||
: m_text(text), m_icon(icon)
|
: m_text(text), m_icon(icon)
|
||||||
{ }
|
{ }
|
||||||
wxDataViewIconText( const wxDataViewIconText &other )
|
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; }
|
void SetText( const wxString &text ) { m_text = text; }
|
||||||
wxString GetText() const { return m_text; }
|
wxString GetText() const { return m_text; }
|
||||||
|
@@ -114,7 +114,7 @@ private:
|
|||||||
|
|
||||||
virtual void DoDrawArc(wxCoord, wxCoord, wxCoord, wxCoord, wxCoord, wxCoord);
|
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);
|
virtual void DoDrawCheckMark(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
|
||||||
|
|
||||||
|
@@ -31,6 +31,7 @@ public:
|
|||||||
InitFromStream(stream, lenFile);
|
InitFromStream(stream, lenFile);
|
||||||
}
|
}
|
||||||
wxMemoryInputStream(wxMemoryInputStream& stream)
|
wxMemoryInputStream(wxMemoryInputStream& stream)
|
||||||
|
: wxInputStream()
|
||||||
{
|
{
|
||||||
InitFromStream(stream, wxInvalidOffset);
|
InitFromStream(stream, wxInvalidOffset);
|
||||||
}
|
}
|
||||||
|
@@ -176,7 +176,7 @@ wxIcon wxIconBundle::GetIcon(const wxSize& size) const
|
|||||||
|
|
||||||
// the best icon is by default (arbitrarily) the first one but
|
// the best icon is by default (arbitrarily) the first one but
|
||||||
// if we find a system-sized icon, take it instead
|
// 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;
|
iconBest = icon;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -282,12 +282,14 @@ bool wxRegExImpl::Compile(const wxString& expr, int flags)
|
|||||||
// translate our flags to regcomp() ones
|
// translate our flags to regcomp() ones
|
||||||
int flagsRE = 0;
|
int flagsRE = 0;
|
||||||
if ( !(flags & wxRE_BASIC) )
|
if ( !(flags & wxRE_BASIC) )
|
||||||
|
{
|
||||||
#ifndef WX_NO_REGEX_ADVANCED
|
#ifndef WX_NO_REGEX_ADVANCED
|
||||||
if (flags & wxRE_ADVANCED)
|
if (flags & wxRE_ADVANCED)
|
||||||
flagsRE |= REG_ADVANCED;
|
flagsRE |= REG_ADVANCED;
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
flagsRE |= REG_EXTENDED;
|
flagsRE |= REG_EXTENDED;
|
||||||
|
}
|
||||||
if ( flags & wxRE_ICASE )
|
if ( flags & wxRE_ICASE )
|
||||||
flagsRE |= REG_ICASE;
|
flagsRE |= REG_ICASE;
|
||||||
if ( flags & wxRE_NOSUB )
|
if ( flags & wxRE_NOSUB )
|
||||||
|
@@ -370,7 +370,8 @@ bool wxGenericValidator::TransferToWindow(void)
|
|||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
; // to match the last 'else' above
|
{ // to match the last 'else' above
|
||||||
|
}
|
||||||
|
|
||||||
// unrecognized control, or bad pointer
|
// unrecognized control, or bad pointer
|
||||||
return false;
|
return false;
|
||||||
|
@@ -1080,7 +1080,7 @@ static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent)
|
|||||||
|
|
||||||
// open file
|
// open file
|
||||||
// ---------
|
// ---------
|
||||||
bool bOk wxDUMMY_INITIALIZE(false);
|
bool bOk = false;
|
||||||
if ( wxFile::Exists(filename) ) {
|
if ( wxFile::Exists(filename) ) {
|
||||||
bool bAppend = false;
|
bool bAppend = false;
|
||||||
wxString strMsg;
|
wxString strMsg;
|
||||||
|
@@ -208,9 +208,9 @@ void wxGenericPrintDialog::Init(wxWindow * WXUNUSED(parent))
|
|||||||
if (factory->HasStatusLine())
|
if (factory->HasStatusLine())
|
||||||
{
|
{
|
||||||
flex->Add( new wxStaticText( this, wxID_ANY, _("Status:") ),
|
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() ),
|
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 );
|
mainsizer->Add( topsizer, 0, wxLEFT|wxTOP|wxRIGHT|wxGROW, 10 );
|
||||||
@@ -361,10 +361,12 @@ bool wxGenericPrintDialog::TransferDataToWindow()
|
|||||||
if (m_printDialogData.GetToPage() > 0)
|
if (m_printDialogData.GetToPage() > 0)
|
||||||
m_toText->SetValue(wxString::Format(_T("%d"), m_printDialogData.GetToPage()));
|
m_toText->SetValue(wxString::Format(_T("%d"), m_printDialogData.GetToPage()));
|
||||||
if(m_rangeRadioBox)
|
if(m_rangeRadioBox)
|
||||||
|
{
|
||||||
if (m_printDialogData.GetAllPages() || m_printDialogData.GetFromPage() == 0)
|
if (m_printDialogData.GetAllPages() || m_printDialogData.GetFromPage() == 0)
|
||||||
m_rangeRadioBox->SetSelection(0);
|
m_rangeRadioBox->SetSelection(0);
|
||||||
else
|
else
|
||||||
m_rangeRadioBox->SetSelection(1);
|
m_rangeRadioBox->SetSelection(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -592,8 +592,8 @@ bool wxVarScrollHelperBase::DoScrollToUnit(size_t unit)
|
|||||||
// finally refresh the display -- but only redraw as few units as possible
|
// 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
|
// to avoid flicker. We can't do this if we have children because they
|
||||||
// won't be scrolled
|
// won't be scrolled
|
||||||
if ( m_targetWindow->GetChildren().empty() &&
|
if ( (m_targetWindow->GetChildren().empty() &&
|
||||||
GetVisibleBegin() >= unitLastOld || GetVisibleEnd() <= unitFirstOld )
|
GetVisibleBegin() >= unitLastOld) || GetVisibleEnd() <= unitFirstOld )
|
||||||
{
|
{
|
||||||
// the simplest case: we don't have any old units left, just redraw
|
// the simplest case: we don't have any old units left, just redraw
|
||||||
// everything
|
// everything
|
||||||
|
@@ -902,8 +902,8 @@ void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
|
|||||||
const bool hasAlpha = HasAlpha();
|
const bool hasAlpha = HasAlpha();
|
||||||
// allow access if bpp is valid and matches existence of alpha
|
// allow access if bpp is valid and matches existence of alpha
|
||||||
if (pixbuf != NULL && (
|
if (pixbuf != NULL && (
|
||||||
bpp == 24 && !hasAlpha ||
|
(bpp == 24 && !hasAlpha) ||
|
||||||
bpp == 32 && hasAlpha))
|
(bpp == 32 && hasAlpha)))
|
||||||
{
|
{
|
||||||
data.m_height = gdk_pixbuf_get_height( pixbuf );
|
data.m_height = gdk_pixbuf_get_height( pixbuf );
|
||||||
data.m_width = gdk_pixbuf_get_width( pixbuf );
|
data.m_width = gdk_pixbuf_get_width( pixbuf );
|
||||||
|
@@ -500,11 +500,11 @@ static long wxTranslateKeySymToWXKey(KeySym keysym, bool isChar)
|
|||||||
case GDK_KP_7:
|
case GDK_KP_7:
|
||||||
case GDK_KP_8:
|
case GDK_KP_8:
|
||||||
case GDK_KP_9:
|
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;
|
break;
|
||||||
|
|
||||||
case GDK_KP_Space:
|
case GDK_KP_Space:
|
||||||
key_code = isChar ? ' ' : WXK_NUMPAD_SPACE;
|
key_code = isChar ? ' ' : int(WXK_NUMPAD_SPACE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GDK_KP_Tab:
|
case GDK_KP_Tab:
|
||||||
@@ -576,32 +576,32 @@ static long wxTranslateKeySymToWXKey(KeySym keysym, bool isChar)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case GDK_KP_Equal:
|
case GDK_KP_Equal:
|
||||||
key_code = isChar ? '=' : WXK_NUMPAD_EQUAL;
|
key_code = isChar ? '=' : int(WXK_NUMPAD_EQUAL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GDK_KP_Multiply:
|
case GDK_KP_Multiply:
|
||||||
key_code = isChar ? '*' : WXK_NUMPAD_MULTIPLY;
|
key_code = isChar ? '*' : int(WXK_NUMPAD_MULTIPLY);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GDK_KP_Add:
|
case GDK_KP_Add:
|
||||||
key_code = isChar ? '+' : WXK_NUMPAD_ADD;
|
key_code = isChar ? '+' : int(WXK_NUMPAD_ADD);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GDK_KP_Separator:
|
case GDK_KP_Separator:
|
||||||
// FIXME: what is this?
|
// FIXME: what is this?
|
||||||
key_code = isChar ? '.' : WXK_NUMPAD_SEPARATOR;
|
key_code = isChar ? '.' : int(WXK_NUMPAD_SEPARATOR);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GDK_KP_Subtract:
|
case GDK_KP_Subtract:
|
||||||
key_code = isChar ? '-' : WXK_NUMPAD_SUBTRACT;
|
key_code = isChar ? '-' : int(WXK_NUMPAD_SUBTRACT);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GDK_KP_Decimal:
|
case GDK_KP_Decimal:
|
||||||
key_code = isChar ? '.' : WXK_NUMPAD_DECIMAL;
|
key_code = isChar ? '.' : int(WXK_NUMPAD_DECIMAL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GDK_KP_Divide:
|
case GDK_KP_Divide:
|
||||||
key_code = isChar ? '/' : WXK_NUMPAD_DIVIDE;
|
key_code = isChar ? '/' : int(WXK_NUMPAD_DIVIDE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
@@ -875,7 +875,7 @@ wxRichTextLine* wxRichTextParagraphLayoutBox::GetLineAtPosition(long pos, bool c
|
|||||||
|
|
||||||
// If the position is end-of-paragraph, then return the last line of
|
// If the position is end-of-paragraph, then return the last line of
|
||||||
// of the paragraph.
|
// 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;
|
return line;
|
||||||
|
|
||||||
node2 = node2->GetNext();
|
node2 = node2->GetNext();
|
||||||
@@ -5943,7 +5943,7 @@ wxString wxRichTextBuffer::GetExtWildcard(bool combine, bool save, wxArrayInt* t
|
|||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
wxRichTextFileHandler* handler = (wxRichTextFileHandler*) node->GetData();
|
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)
|
if (combine)
|
||||||
{
|
{
|
||||||
@@ -7774,6 +7774,7 @@ wxRichTextFontTable::wxRichTextFontTable()
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxRichTextFontTable::wxRichTextFontTable(const wxRichTextFontTable& table)
|
wxRichTextFontTable::wxRichTextFontTable(const wxRichTextFontTable& table)
|
||||||
|
: wxObject()
|
||||||
{
|
{
|
||||||
(*this) = table;
|
(*this) = table;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user