Merge pull request #2151 from MaartenBent/clang-warnings
Fix clang warnings and replace tabs.
This commit is contained in:
@@ -40,4 +40,8 @@ ELSE(WEBKIT2_FOUND)
|
||||
SET( WEBKIT2_LIBRARIES )
|
||||
ENDIF(WEBKIT2_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(WEBKIT2_LIBRARY WEBKIT2_LIBRARIES WEBKIT2_INCLUDE_DIR)
|
||||
MARK_AS_ADVANCED(WEBKIT2_LIBRARY
|
||||
WEBKIT2_LIBRARIES
|
||||
WEBKIT2_INCLUDE_DIR
|
||||
WEBKIT2_JS_LIBRARY
|
||||
)
|
||||
|
@@ -218,7 +218,7 @@ void wxAuiGtkTabArt::DrawTab(wxDC& dc, wxWindow* wnd, const wxAuiNotebookPage& p
|
||||
if (!page.active)
|
||||
tab_rect.y += 2 * GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder;
|
||||
gap_rect_y = tab_rect.y + tab_rect.height - GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder / 2;
|
||||
// fall through
|
||||
wxFALLTHROUGH;
|
||||
case wxAUI_NB_BOTTOM:
|
||||
gap_start = tab_rect.x - GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_vborder / 2;
|
||||
gap_width = tab_rect.width;
|
||||
|
@@ -1799,7 +1799,6 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat))
|
||||
format.Replace("%y","%Y");
|
||||
return format;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( "Unknown locale info" );
|
||||
|
@@ -148,8 +148,8 @@ wxChar wxTextInputStream::GetChar()
|
||||
// remember the second one for the next call, as there is no
|
||||
// way to fit both of them into a single wxChar in this case.
|
||||
m_lastWChar = wbuf[1];
|
||||
#endif // SIZEOF_WCHAR_T == 2
|
||||
wxFALLTHROUGH;
|
||||
#endif // SIZEOF_WCHAR_T == 2
|
||||
|
||||
case 1:
|
||||
m_validBegin = inlen + 1;
|
||||
|
@@ -716,7 +716,7 @@ size_t wxStrlen(const wxChar16 *s )
|
||||
{
|
||||
if (!s) return 0;
|
||||
size_t i=0;
|
||||
while (*s!=0) { ++i; ++s; };
|
||||
while (*s!=0) { ++i; ++s; }
|
||||
return i;
|
||||
}
|
||||
|
||||
|
@@ -288,7 +288,7 @@ private:
|
||||
case wxTE_HT_BELOW:
|
||||
// This shouldn't happen for single line control.
|
||||
wxFAIL_MSG( "Unreachable" );
|
||||
// fall through
|
||||
wxFALLTHROUGH;
|
||||
|
||||
case wxTE_HT_BEYOND:
|
||||
// Select the last field.
|
||||
|
@@ -393,7 +393,7 @@ void wxAnyButton::DoSetBitmapPosition(wxDirection dir)
|
||||
{
|
||||
default:
|
||||
wxFAIL_MSG( "invalid position" );
|
||||
// fall through
|
||||
wxFALLTHROUGH;
|
||||
|
||||
case wxLEFT:
|
||||
gtkpos = GTK_POS_LEFT;
|
||||
|
@@ -301,7 +301,7 @@ static void wxgtk_main_do_event(GdkEvent* event, void* data)
|
||||
// examine the event itself to distinguish between the two cases but
|
||||
// this would be unnecessarily complicated).
|
||||
cat2 = wxEVT_CATEGORY_CLIPBOARD;
|
||||
// Fall through.
|
||||
wxFALLTHROUGH;
|
||||
|
||||
case GDK_PROXIMITY_IN:
|
||||
case GDK_PROXIMITY_OUT:
|
||||
|
@@ -901,7 +901,7 @@ void wxMenu::GtkAppend(wxMenuItem* mitem, int pos)
|
||||
break;
|
||||
default:
|
||||
wxFAIL_MSG("unexpected menu item kind");
|
||||
// fall through
|
||||
wxFALLTHROUGH;
|
||||
case wxITEM_NORMAL:
|
||||
#ifdef __WXGTK4__
|
||||
//TODO GtkImageMenuItem is gone, have to implement it ourselves with
|
||||
|
@@ -279,7 +279,7 @@ int wxMessageDialog::ShowModal()
|
||||
{
|
||||
default:
|
||||
wxFAIL_MSG(wxT("unexpected GtkMessageDialog return code"));
|
||||
// fall through
|
||||
wxFALLTHROUGH;
|
||||
|
||||
case GTK_RESPONSE_CANCEL:
|
||||
case GTK_RESPONSE_DELETE_EVENT:
|
||||
|
@@ -189,7 +189,7 @@ GtkPolicyType GtkPolicyFromWX(wxScrollbarVisibility visibility)
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( wxS("unknown scrollbar visibility") );
|
||||
// fall through
|
||||
wxFALLTHROUGH;
|
||||
|
||||
case wxSHOW_SB_ALWAYS:
|
||||
policy = GTK_POLICY_ALWAYS;
|
||||
|
@@ -404,7 +404,7 @@ void wxGtkStyleContext::Bg(wxColour& color, int state) const
|
||||
const int i = stride * (cairo_image_surface_get_height(surf) / 2);
|
||||
const unsigned* p = reinterpret_cast<const unsigned*>(data + i);
|
||||
const unsigned pixel = *p;
|
||||
guchar r, g, b, a = 0xff;
|
||||
guchar r = 0, g = 0, b = 0, a = 0xff;
|
||||
switch (cairo_image_surface_get_format(surf))
|
||||
{
|
||||
case CAIRO_FORMAT_ARGB32:
|
||||
|
@@ -572,7 +572,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
|
||||
break;
|
||||
default:
|
||||
wxFAIL_MSG("unknown toolbar child type");
|
||||
// fall through
|
||||
wxFALLTHROUGH;
|
||||
case wxITEM_DROPDOWN:
|
||||
case wxITEM_NORMAL:
|
||||
tool->m_item = gtk_tool_button_new(NULL, "");
|
||||
|
@@ -136,6 +136,7 @@ void wx_tree_entry_set_destroy_func(wxTreeEntry* entry,
|
||||
/* private */
|
||||
static void wx_tree_entry_class_init(void* g_class, void* class_data)
|
||||
{
|
||||
(void)class_data;
|
||||
GObjectClass* gobject_class = G_OBJECT_CLASS(g_class);
|
||||
gobject_class->dispose = wx_tree_entry_dispose;
|
||||
parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class));
|
||||
|
@@ -5181,7 +5181,7 @@ void wxWindowGTK::GTKSendPaintEvents(const GdkRegion* region)
|
||||
break;
|
||||
}
|
||||
}
|
||||
// fall through
|
||||
wxFALLTHROUGH;
|
||||
|
||||
case wxBG_STYLE_SYSTEM:
|
||||
if ( GetThemeEnabled() )
|
||||
|
@@ -464,14 +464,14 @@ bool wxChmInputStream::Eof() const
|
||||
return (m_content==NULL ||
|
||||
m_contentStream==NULL ||
|
||||
m_contentStream->Eof() ||
|
||||
m_pos>m_size);
|
||||
(size_t)m_pos>m_size);
|
||||
}
|
||||
|
||||
|
||||
|
||||
size_t wxChmInputStream::OnSysRead(void *buffer, size_t bufsize)
|
||||
{
|
||||
if ( m_pos >= m_size )
|
||||
if ( (size_t)m_pos >= m_size )
|
||||
{
|
||||
m_lasterror = wxSTREAM_EOF;
|
||||
return 0;
|
||||
@@ -854,7 +854,7 @@ wxFSFile* wxChmFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs),
|
||||
/**
|
||||
* Doku see wxFileSystemHandler
|
||||
*/
|
||||
wxString wxChmFSHandler::FindFirst(const wxString& spec, int flags)
|
||||
wxString wxChmFSHandler::FindFirst(const wxString& spec, int WXUNUSED(flags))
|
||||
{
|
||||
wxString right = GetRightLocation(spec);
|
||||
wxString left = GetLeftLocation(spec);
|
||||
|
@@ -472,6 +472,7 @@ wxFont::wxFont(wxOSXSystemFont font)
|
||||
break;
|
||||
case wxOSX_SYSTEM_FONT_FIXED:
|
||||
uifont = kCTFontUIFontUserFixedPitch;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@@ -197,7 +197,7 @@ WXImage wxOSXGetSystemImage(const wxString& name)
|
||||
return nsimage;
|
||||
}
|
||||
|
||||
wxBitmap wxOSXCreateSystemBitmap(const wxString& name, const wxString &client, const wxSize& sizeHint)
|
||||
wxBitmap wxOSXCreateSystemBitmap(const wxString& name, const wxString &WXUNUSED(client), const wxSize& WXUNUSED(sizeHint))
|
||||
{
|
||||
NSImage* nsimage = wxOSXGetSystemImage(name);
|
||||
if ( nsimage )
|
||||
|
@@ -137,7 +137,7 @@ private:
|
||||
wxWidgetImplType* wxWidgetImpl::CreateChoice( wxWindowMac* wxpeer,
|
||||
wxWindowMac* WXUNUSED(parent),
|
||||
wxWindowID WXUNUSED(id),
|
||||
wxMenu* menu,
|
||||
wxMenu* WXUNUSED(menu),
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long WXUNUSED(style),
|
||||
|
@@ -1929,6 +1929,8 @@ outlineView:(NSOutlineView*)outlineView
|
||||
|
||||
-(BOOL) textShouldBeginEditing:(NSText*)textEditor
|
||||
{
|
||||
wxUnusedVar(textEditor);
|
||||
|
||||
currentlyEditedColumn = [self editedColumn];
|
||||
currentlyEditedRow = [self editedRow];
|
||||
|
||||
@@ -2743,7 +2745,6 @@ wxDataObjectComposite* wxCocoaDataViewControl::GetDnDDataObjects(NSData* dataObj
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
@@ -3426,7 +3427,7 @@ wxIMPLEMENT_CLASS(wxDataViewCheckIconText, wxDataViewIconText);
|
||||
wxDataViewCheckIconTextRenderer::wxDataViewCheckIconTextRenderer
|
||||
(
|
||||
wxDataViewCellMode mode,
|
||||
int align
|
||||
int WXUNUSED(align)
|
||||
)
|
||||
: wxDataViewRenderer(GetDefaultType(), mode,mode)
|
||||
{
|
||||
|
@@ -164,7 +164,7 @@ wxDateTimeWidgetImpl::CreateDateTimePicker(wxDateTimePickerCtrl* wxpeer,
|
||||
const wxDateTime& dt,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
long WXUNUSED(style),
|
||||
wxDateTimeWidgetKind kind)
|
||||
{
|
||||
NSRect r = wxOSXGetFrameForControl(wxpeer, pos, size);
|
||||
|
@@ -89,7 +89,7 @@ public:
|
||||
[m_item setData:(NSData*) data forType:(NSString*) format];
|
||||
}
|
||||
|
||||
NSPasteboardItem* GetNative() { return m_item; };
|
||||
NSPasteboardItem* GetNative() { return m_item; }
|
||||
private:
|
||||
NSPasteboardItem* m_item;
|
||||
};
|
||||
@@ -157,7 +157,7 @@ public:
|
||||
return (CFDataRef) [m_item dataForType:(NSString*) type];
|
||||
}
|
||||
|
||||
NSPasteboardItem* GetNative() { return m_item; };
|
||||
NSPasteboardItem* GetNative() { return m_item; }
|
||||
private:
|
||||
NSPasteboardItem* m_item;
|
||||
NSPasteboard* m_pasteboard;
|
||||
@@ -318,6 +318,9 @@ wxDragResult NSDragOperationToWxDragResult(NSDragOperation code)
|
||||
|
||||
- (NSDragOperation)draggingSession:(nonnull NSDraggingSession *)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context
|
||||
{
|
||||
wxUnusedVar(session);
|
||||
wxUnusedVar(context);
|
||||
|
||||
NSDragOperation allowedDragOperations = NSDragOperationEvery;
|
||||
|
||||
// NSDragOperationGeneric also makes a drag to the trash possible
|
||||
@@ -471,6 +474,7 @@ typedef NSString* NSPasteboardType;
|
||||
|
||||
- (nonnull NSArray<NSPasteboardType> *)writableTypesForPasteboard:(nonnull NSPasteboard *)pasteboard
|
||||
{
|
||||
wxUnusedVar(pasteboard);
|
||||
wxCFMutableArrayRef<CFStringRef> typesarray;
|
||||
if ( m_data )
|
||||
m_data->AddSupportedTypes(typesarray, wxDataObjectBase::Direction::Get);
|
||||
|
@@ -419,7 +419,7 @@ int wxFileDialog::ShowModal()
|
||||
m_firstFileTypeFilter = -1;
|
||||
|
||||
if ( m_useFileTypeFilter
|
||||
&& m_filterIndex >= 0 && m_filterIndex < m_filterExtensions.GetCount() )
|
||||
&& m_filterIndex >= 0 && (size_t)m_filterIndex < m_filterExtensions.GetCount() )
|
||||
{
|
||||
m_firstFileTypeFilter = m_filterIndex;
|
||||
}
|
||||
|
@@ -87,7 +87,7 @@ WXGLPixelFormat WXGLChoosePixelFormat(const int *GLAttrs,
|
||||
if ( GLAttrs && n1 > 1 )
|
||||
{
|
||||
n1--; // skip the ending '0'
|
||||
while ( p < n1 )
|
||||
while ( p < (unsigned)n1 )
|
||||
{
|
||||
data[p] = (NSOpenGLPixelFormatAttribute) GLAttrs[p];
|
||||
p++;
|
||||
@@ -98,7 +98,7 @@ WXGLPixelFormat WXGLChoosePixelFormat(const int *GLAttrs,
|
||||
{
|
||||
n2--; // skip the ending '0'
|
||||
unsigned p2 = 0;
|
||||
while ( p2 < n2 )
|
||||
while ( p2 < (unsigned)n2 )
|
||||
data[p++] = (NSOpenGLPixelFormatAttribute) ctxAttrs[p2++];
|
||||
}
|
||||
|
||||
|
@@ -209,6 +209,7 @@ private:
|
||||
|
||||
- (void)playerItemDidReachEnd:(NSNotification *)notification
|
||||
{
|
||||
wxUnusedVar(notification);
|
||||
if ( m_backend )
|
||||
{
|
||||
if ( m_backend->SendStopEvent() )
|
||||
@@ -538,7 +539,7 @@ wxSize wxAVMediaBackend::GetVideoSize() const
|
||||
return m_bestSize;
|
||||
}
|
||||
|
||||
void wxAVMediaBackend::Move(int x, int y, int w, int h)
|
||||
void wxAVMediaBackend::Move(int WXUNUSED(x), int WXUNUSED(y), int WXUNUSED(w), int WXUNUSED(h))
|
||||
{
|
||||
// as we have a native player, no need to move the video area
|
||||
}
|
||||
|
@@ -316,7 +316,7 @@ void* wxMessageDialog::ConstructNSAlert()
|
||||
m_buttonId[ m_buttonCount++ ] = wxID_HELP;
|
||||
}
|
||||
|
||||
wxASSERT_MSG( m_buttonCount <= WXSIZEOF(m_buttonId), "Too many buttons" );
|
||||
wxASSERT_MSG( m_buttonCount <= (int)WXSIZEOF(m_buttonId), "Too many buttons" );
|
||||
|
||||
return alert;
|
||||
}
|
||||
|
@@ -663,6 +663,9 @@ extern int wxOSXGetIdFromSelector(SEL action );
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
||||
{
|
||||
wxUnusedVar(keyPath);
|
||||
wxUnusedVar(change);
|
||||
|
||||
if (context == EffectiveAppearanceContext)
|
||||
{
|
||||
wxNonOwnedWindowCocoaImpl* windowimpl = [(NSWindow*)object WX_implementation];
|
||||
@@ -719,7 +722,7 @@ void wxNonOwnedWindowCocoaImpl::WillBeDestroyed()
|
||||
}
|
||||
}
|
||||
|
||||
void wxNonOwnedWindowCocoaImpl::Create( wxWindow* parent, const wxPoint& pos, const wxSize& size,
|
||||
void wxNonOwnedWindowCocoaImpl::Create( wxWindow* WXUNUSED(parent), const wxPoint& pos, const wxSize& size,
|
||||
long style, long extraStyle, const wxString& WXUNUSED(name) )
|
||||
{
|
||||
static wxNonOwnedWindowController* controller = NULL;
|
||||
|
@@ -219,6 +219,7 @@ int wxUserNotificationMsgImpl::ms_notifIdBase = 1000;
|
||||
|
||||
- (void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification
|
||||
{
|
||||
wxUnusedVar(center);
|
||||
NSString* notifId = [notification.userInfo objectForKey:@"wxId"];
|
||||
if (notifId)
|
||||
wxUserNotificationMsgImpl::NotificationActivated(wxCFStringRef::AsString(notifId), notification.activationType);
|
||||
|
@@ -81,6 +81,7 @@
|
||||
|
||||
- (void)drawRect:(NSRect)dirtyRect
|
||||
{
|
||||
wxUnusedVar(dirtyRect);
|
||||
[self.bitmapImageRep drawInRect:[self bounds]];
|
||||
}
|
||||
|
||||
|
@@ -236,7 +236,7 @@ private:
|
||||
OnSelectPageForTool(tool);
|
||||
}
|
||||
|
||||
void OnClose(wxCloseEvent& e)
|
||||
void OnClose(wxCloseEvent& WXUNUSED(e))
|
||||
{
|
||||
// Instead of destroying the window, just hide it, it could be
|
||||
// reused again by another invocation of the editor.
|
||||
|
@@ -206,16 +206,14 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
|
||||
case wxSYS_DEFAULT_GUI_FONT :
|
||||
{
|
||||
return wxFont(wxOSX_SYSTEM_FONT_SMALL) ;
|
||||
} ;
|
||||
break ;
|
||||
}
|
||||
case wxSYS_OEM_FIXED_FONT :
|
||||
case wxSYS_ANSI_FIXED_FONT :
|
||||
case wxSYS_SYSTEM_FIXED_FONT :
|
||||
default :
|
||||
{
|
||||
return wxFont(wxOSX_SYSTEM_FONT_FIXED) ;
|
||||
} ;
|
||||
break ;
|
||||
}
|
||||
|
||||
}
|
||||
return *wxNORMAL_FONT;
|
||||
|
@@ -71,6 +71,10 @@
|
||||
- (NSArray *)control:(NSControl *)control textView:(NSTextView *)textView completions:(NSArray *)words
|
||||
forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(int*)index
|
||||
{
|
||||
wxUnusedVar(control);
|
||||
wxUnusedVar(words);
|
||||
wxUnusedVar(index);
|
||||
|
||||
NSMutableArray* matches = NULL;
|
||||
NSString* partialString;
|
||||
|
||||
|
@@ -65,7 +65,7 @@ public :
|
||||
{
|
||||
}
|
||||
|
||||
void SetLabel( const wxString& title, wxFontEncoding encoding ) wxOVERRIDE
|
||||
void SetLabel( const wxString& WXUNUSED(title), wxFontEncoding WXUNUSED(encoding) ) wxOVERRIDE
|
||||
{
|
||||
// although NSControl has this method, NSImageView throws an exception if it is called
|
||||
}
|
||||
@@ -106,7 +106,7 @@ void wxStaticBitmap::SetScaleMode(ScaleMode scaleMode)
|
||||
wxWidgetImplType* wxWidgetImpl::CreateStaticBitmap( wxWindowMac* wxpeer,
|
||||
wxWindowMac* WXUNUSED(parent),
|
||||
wxWindowID WXUNUSED(id),
|
||||
const wxBitmap& bitmap,
|
||||
const wxBitmap& WXUNUSED(bitmap),
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long WXUNUSED(style),
|
||||
|
@@ -153,6 +153,7 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil;
|
||||
|
||||
- (BOOL)getObjectValue:(id *)obj forString:(NSString *)string errorDescription:(NSString **)error
|
||||
{
|
||||
wxUnusedVar(error);
|
||||
*obj = [NSString stringWithString:string];
|
||||
return YES;
|
||||
}
|
||||
@@ -160,9 +161,14 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil;
|
||||
- (BOOL)isPartialStringValid:(NSString **)partialStringPtr proposedSelectedRange:(NSRangePointer)proposedSelRangePtr
|
||||
originalString:(NSString *)origString originalSelectedRange:(NSRange)origSelRange errorDescription:(NSString **)error
|
||||
{
|
||||
wxUnusedVar(proposedSelRangePtr);
|
||||
wxUnusedVar(origString);
|
||||
wxUnusedVar(origSelRange);
|
||||
wxUnusedVar(error);
|
||||
|
||||
if ( maxLength > 0 )
|
||||
{
|
||||
if ( [*partialStringPtr length] > maxLength )
|
||||
if ( [*partialStringPtr length] > (unsigned)maxLength )
|
||||
{
|
||||
field->SendMaxLenEvent();
|
||||
return NO;
|
||||
@@ -431,6 +437,7 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil;
|
||||
|
||||
- (void)changeColor:(id)sender
|
||||
{
|
||||
wxUnusedVar(sender);
|
||||
// Define this just to block the color change messages - these are sent from
|
||||
// the shared color/font panel resulting in unwanted changes of color when
|
||||
// shared color panel is used (as when using wxColourPickerCtrl for example).
|
||||
@@ -475,6 +482,7 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil;
|
||||
|
||||
-(BOOL)textView:(NSTextView *)aTextView clickedOnLink:(id)link atIndex:(NSUInteger)charIndex
|
||||
{
|
||||
wxUnusedVar(link);
|
||||
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( aTextView );
|
||||
if ( impl )
|
||||
{
|
||||
@@ -592,6 +600,10 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil;
|
||||
- (NSArray *)control:(NSControl *)control textView:(NSTextView *)textView completions:(NSArray *)words
|
||||
forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger*)index
|
||||
{
|
||||
wxUnusedVar(control);
|
||||
wxUnusedVar(words);
|
||||
wxUnusedVar(index);
|
||||
|
||||
NSMutableArray* matches = [NSMutableArray array];
|
||||
|
||||
wxTextWidgetImpl* impl = (wxNSTextFieldControl * ) wxWidgetImpl::FindFromWXWidget( self );
|
||||
@@ -897,7 +909,7 @@ bool wxNSTextViewControl::PositionToXY(long pos, long *x, long *y) const
|
||||
wxCHECK_MSG( pos >= 0, false, wxS("Invalid character position") );
|
||||
|
||||
NSString* txt = [m_textView string];
|
||||
if ( pos > [txt length] )
|
||||
if ( (unsigned)pos > [txt length] )
|
||||
return false;
|
||||
|
||||
// Last valid position is past the last character
|
||||
@@ -975,7 +987,7 @@ long wxNSTextViewControl::XYToPosition(long x, long y) const
|
||||
|
||||
// Return error if given x position
|
||||
// is past the line.
|
||||
if ( x >= lineRng.length )
|
||||
if ( (unsigned)x >= lineRng.length )
|
||||
return -1;
|
||||
|
||||
return lineRng.location + x;
|
||||
@@ -1440,7 +1452,7 @@ bool wxNSTextFieldControl::PositionToXY(long pos, long *x, long *y) const
|
||||
{
|
||||
wxCHECK_MSG( pos >= 0, false, wxS("Invalid character position") );
|
||||
|
||||
if ( pos > [[m_textField stringValue] length] )
|
||||
if ( (unsigned)pos > [[m_textField stringValue] length] )
|
||||
return false;
|
||||
|
||||
if ( y )
|
||||
@@ -1457,7 +1469,7 @@ long wxNSTextFieldControl::XYToPosition(long x, long y) const
|
||||
wxCHECK_MSG( x >= 0 && y >= 0, -1, wxS("Invalid line/column number") );
|
||||
|
||||
// Last valid position is after the last character.
|
||||
if ( y != 0 || x > [[m_textField stringValue] length] )
|
||||
if ( y != 0 || (unsigned)x > [[m_textField stringValue] length] )
|
||||
return -1;
|
||||
|
||||
return x;
|
||||
|
@@ -416,6 +416,7 @@ private:
|
||||
|
||||
- (void)setSelectable:(bool) value
|
||||
{
|
||||
wxUnusedVar(value);
|
||||
m_isSelectable = true;
|
||||
}
|
||||
|
||||
|
@@ -69,6 +69,7 @@ void wxBell()
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)notification
|
||||
{
|
||||
wxUnusedVar(notification);
|
||||
[NSApp stop:nil];
|
||||
wxTheApp->OSXOnDidFinishLaunching();
|
||||
}
|
||||
@@ -93,6 +94,9 @@ void wxBell()
|
||||
- (NSApplicationPrintReply)application:(NSApplication *)sender printFiles:(NSArray *)fileNames withSettings:(NSDictionary *)printSettings showPrintPanels:(BOOL)showPrintPanels
|
||||
{
|
||||
wxUnusedVar(sender);
|
||||
wxUnusedVar(printSettings);
|
||||
wxUnusedVar(showPrintPanels);
|
||||
|
||||
wxArrayString fileList;
|
||||
size_t i;
|
||||
const size_t count = [fileNames count];
|
||||
@@ -141,6 +145,8 @@ void wxBell()
|
||||
- (void)handleQuitAppEvent:(NSAppleEventDescriptor *)event
|
||||
withReplyEvent:(NSAppleEventDescriptor *)replyEvent
|
||||
{
|
||||
wxUnusedVar(event);
|
||||
wxUnusedVar(replyEvent);
|
||||
if ( wxTheApp->OSXOnShouldTerminate() )
|
||||
{
|
||||
wxTheApp->OSXOnWillTerminate();
|
||||
@@ -151,6 +157,7 @@ void wxBell()
|
||||
- (void)handleOpenAppEvent:(NSAppleEventDescriptor *)event
|
||||
withReplyEvent:(NSAppleEventDescriptor *)replyEvent
|
||||
{
|
||||
wxUnusedVar(event);
|
||||
wxUnusedVar(replyEvent);
|
||||
}
|
||||
|
||||
|
@@ -939,7 +939,7 @@ static void SetDrawingEnabledIfFrozenRecursive(wxWidgetCocoaImpl *impl, bool ena
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (NSView *)hitTest:(NSPoint)aPoint;
|
||||
- (NSView *)hitTest:(NSPoint)aPoint
|
||||
{
|
||||
wxWidgetCocoaImpl* viewimpl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
|
||||
if ( viewimpl && viewimpl->GetWXPeer() && !viewimpl->GetWXPeer()->IsEnabled() )
|
||||
@@ -980,6 +980,7 @@ void wxOSX_insertText(NSView* self, SEL _cmd, NSString* text);
|
||||
|
||||
- (void)insertText:(id)aString replacementRange:(NSRange)replacementRange
|
||||
{
|
||||
wxUnusedVar(replacementRange);
|
||||
wxOSX_insertText(self, @selector(insertText:), aString);
|
||||
}
|
||||
|
||||
@@ -992,6 +993,9 @@ void wxOSX_insertText(NSView* self, SEL _cmd, NSString* text);
|
||||
|
||||
- (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange
|
||||
{
|
||||
wxUnusedVar(aString);
|
||||
wxUnusedVar(selectedRange);
|
||||
wxUnusedVar(replacementRange);
|
||||
}
|
||||
|
||||
- (void)unmarkText
|
||||
@@ -1015,6 +1019,8 @@ void wxOSX_insertText(NSView* self, SEL _cmd, NSString* text);
|
||||
|
||||
- (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange
|
||||
{
|
||||
wxUnusedVar(aRange);
|
||||
wxUnusedVar(actualRange);
|
||||
return nil;
|
||||
}
|
||||
|
||||
@@ -1025,10 +1031,13 @@ void wxOSX_insertText(NSView* self, SEL _cmd, NSString* text);
|
||||
|
||||
- (NSRect)firstRectForCharacterRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange
|
||||
{
|
||||
wxUnusedVar(aRange);
|
||||
wxUnusedVar(actualRange);
|
||||
return NSMakeRect(0, 0, 0, 0);
|
||||
}
|
||||
- (NSUInteger)characterIndexForPoint:(NSPoint)aPoint
|
||||
{
|
||||
wxUnusedVar(aPoint);
|
||||
return NSNotFound;
|
||||
}
|
||||
|
||||
@@ -1128,7 +1137,7 @@ void wxOSX_insertText(NSView* self, SEL _cmd, NSString* text)
|
||||
impl->insertText(text, self, _cmd);
|
||||
}
|
||||
|
||||
void wxOSX_panGestureEvent(NSView* self, SEL _cmd, NSPanGestureRecognizer* panGestureRecognizer)
|
||||
void wxOSX_panGestureEvent(NSView* self, SEL WXUNUSED(_cmd), NSPanGestureRecognizer* panGestureRecognizer)
|
||||
{
|
||||
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
|
||||
if ( impl == NULL )
|
||||
@@ -1137,7 +1146,7 @@ void wxOSX_panGestureEvent(NSView* self, SEL _cmd, NSPanGestureRecognizer* panGe
|
||||
impl->PanGestureEvent(panGestureRecognizer);
|
||||
}
|
||||
|
||||
void wxOSX_zoomGestureEvent(NSView* self, SEL _cmd, NSMagnificationGestureRecognizer* magnificationGestureRecognizer)
|
||||
void wxOSX_zoomGestureEvent(NSView* self, SEL WXUNUSED(_cmd), NSMagnificationGestureRecognizer* magnificationGestureRecognizer)
|
||||
{
|
||||
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
|
||||
if ( impl == NULL )
|
||||
@@ -1146,7 +1155,7 @@ void wxOSX_zoomGestureEvent(NSView* self, SEL _cmd, NSMagnificationGestureRecogn
|
||||
impl->ZoomGestureEvent(magnificationGestureRecognizer);
|
||||
}
|
||||
|
||||
void wxOSX_rotateGestureEvent(NSView* self, SEL _cmd, NSRotationGestureRecognizer* rotationGestureRecognizer)
|
||||
void wxOSX_rotateGestureEvent(NSView* self, SEL WXUNUSED(_cmd), NSRotationGestureRecognizer* rotationGestureRecognizer)
|
||||
{
|
||||
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
|
||||
if ( impl == NULL )
|
||||
@@ -1155,7 +1164,7 @@ void wxOSX_rotateGestureEvent(NSView* self, SEL _cmd, NSRotationGestureRecognize
|
||||
impl->RotateGestureEvent(rotationGestureRecognizer);
|
||||
}
|
||||
|
||||
void wxOSX_longPressEvent(NSView* self, SEL _cmd, NSPressGestureRecognizer* pressGestureRecognizer)
|
||||
void wxOSX_longPressEvent(NSView* self, SEL WXUNUSED(_cmd), NSPressGestureRecognizer* pressGestureRecognizer)
|
||||
{
|
||||
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
|
||||
if ( impl ==NULL )
|
||||
@@ -1164,7 +1173,7 @@ void wxOSX_longPressEvent(NSView* self, SEL _cmd, NSPressGestureRecognizer* pres
|
||||
impl->LongPressEvent(pressGestureRecognizer);
|
||||
}
|
||||
|
||||
void wxOSX_touchesBegan(NSView* self, SEL _cmd, NSEvent *event)
|
||||
void wxOSX_touchesBegan(NSView* self, SEL WXUNUSED(_cmd), NSEvent *event)
|
||||
{
|
||||
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
|
||||
if ( impl == NULL )
|
||||
@@ -1173,7 +1182,7 @@ void wxOSX_touchesBegan(NSView* self, SEL _cmd, NSEvent *event)
|
||||
impl->TouchesBegan(event);
|
||||
}
|
||||
|
||||
void wxOSX_touchesMoved(NSView* self, SEL _cmd, NSEvent *event)
|
||||
void wxOSX_touchesMoved(NSView* self, SEL WXUNUSED(_cmd), NSEvent *event)
|
||||
{
|
||||
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
|
||||
if ( impl == NULL )
|
||||
@@ -1182,7 +1191,7 @@ void wxOSX_touchesMoved(NSView* self, SEL _cmd, NSEvent *event)
|
||||
impl->TouchesMoved(event);
|
||||
}
|
||||
|
||||
void wxOSX_touchesEnded(NSView* self, SEL _cmd, NSEvent *event)
|
||||
void wxOSX_touchesEnded(NSView* self, SEL WXUNUSED(_cmd), NSEvent *event)
|
||||
{
|
||||
wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self );
|
||||
if ( impl == NULL )
|
||||
@@ -2016,7 +2025,7 @@ void wxCocoaGesturesImpl::TouchesMoved(NSEvent* event)
|
||||
|
||||
// Iterate through all moving touches to check if the touch corresponding to "press"
|
||||
// in Press and Tap event is moving.
|
||||
for ( int i = 0; i < [array count]; ++i )
|
||||
for ( unsigned i = 0; i < [array count]; ++i )
|
||||
{
|
||||
NSTouch* touch = [array objectAtIndex:i];
|
||||
|
||||
@@ -2099,7 +2108,7 @@ void wxCocoaGesturesImpl::TouchesEnded(NSEvent* event)
|
||||
bool isPressTouch = false;
|
||||
|
||||
// Iterate through all ended touches
|
||||
for( int i = 0; i < [array count]; ++i )
|
||||
for( unsigned i = 0; i < [array count]; ++i )
|
||||
{
|
||||
NSTouch* touch = [array objectAtIndex:i];
|
||||
|
||||
@@ -2189,7 +2198,7 @@ void wxWidgetCocoaImpl::insertText(NSString* text, WXWidget slf, void *_cmd)
|
||||
}
|
||||
}
|
||||
|
||||
void wxWidgetCocoaImpl::doCommandBySelector(void* sel, WXWidget slf, void* _cmd)
|
||||
void wxWidgetCocoaImpl::doCommandBySelector(void* sel, WXWidget slf, void* WXUNUSED(_cmd))
|
||||
{
|
||||
wxLogTrace(TRACE_KEYS, "Selector %s for %s",
|
||||
wxDumpSelector((SEL)sel), wxDumpNSView(slf));
|
||||
|
@@ -249,10 +249,8 @@ int wxCFEventLoop::DoDispatchTimeout(unsigned long timeout)
|
||||
break;
|
||||
case kCFRunLoopRunStopped:
|
||||
return 0;
|
||||
break;
|
||||
case kCFRunLoopRunTimedOut:
|
||||
return -1;
|
||||
break;
|
||||
case kCFRunLoopRunHandledSource:
|
||||
default:
|
||||
break;
|
||||
|
@@ -57,8 +57,6 @@ static int CalculateUIEventMaskFromEventCategory(wxEventCategory cat)
|
||||
NSOtherMouseUpMask = 1 << NSOtherMouseUp,
|
||||
NSOtherMouseDraggedMask = 1 << NSOtherMouseDragged,
|
||||
|
||||
|
||||
|
||||
NSKeyDownMask = 1 << NSKeyDown,
|
||||
NSKeyUpMask = 1 << NSKeyUp,
|
||||
NSFlagsChangedMask = 1 << NSFlagsChanged,
|
||||
|
@@ -60,11 +60,9 @@ CGEventType CGEventTypeForMouseDrag(int button)
|
||||
{
|
||||
case wxMOUSE_BTN_LEFT:
|
||||
return kCGEventLeftMouseDragged;
|
||||
break;
|
||||
|
||||
case wxMOUSE_BTN_RIGHT:
|
||||
return kCGEventRightMouseDragged;
|
||||
break;
|
||||
|
||||
// All the other buttons use the constant OtherMouseDown but we still
|
||||
// want to check for invalid parameters so assert first
|
||||
@@ -74,7 +72,6 @@ CGEventType CGEventTypeForMouseDrag(int button)
|
||||
|
||||
case wxMOUSE_BTN_MIDDLE:
|
||||
return kCGEventOtherMouseDragged;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -450,7 +450,7 @@ bool wxWebViewWebKit::RunScript(const wxString& javascript, wxString* output)
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxWebViewWebKit::OnSize(wxSizeEvent &event)
|
||||
void wxWebViewWebKit::OnSize(wxSizeEvent &WXUNUSED(event))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -743,6 +743,8 @@ void wxWebViewWebKit::RegisterHandler(wxSharedPtr<wxWebViewHandler> handler)
|
||||
- (void)webView:(WebView *)sender
|
||||
didStartProvisionalLoadForFrame:(WebFrame *)frame
|
||||
{
|
||||
wxUnusedVar(sender);
|
||||
wxUnusedVar(frame);
|
||||
webKitWindow->m_busy = true;
|
||||
}
|
||||
|
||||
@@ -906,6 +908,8 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out)
|
||||
- (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title
|
||||
forFrame:(WebFrame *)frame
|
||||
{
|
||||
wxUnusedVar(sender);
|
||||
|
||||
wxString target = wxCFStringRef::AsString([frame name]);
|
||||
wxWebViewEvent event(wxEVT_WEBVIEW_TITLE_CHANGED,
|
||||
webKitWindow->GetId(),
|
||||
@@ -936,6 +940,8 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out)
|
||||
frame:(WebFrame *)frame
|
||||
decisionListener:(id<WebPolicyDecisionListener>)listener
|
||||
{
|
||||
wxUnusedVar(sender);
|
||||
wxUnusedVar(actionInformation);
|
||||
wxUnusedVar(frame);
|
||||
|
||||
NSString *url = [[request URL] absoluteString];
|
||||
@@ -983,6 +989,9 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out)
|
||||
newFrameName:(NSString *)frameName
|
||||
decisionListener:(id < WebPolicyDecisionListener >)listener
|
||||
{
|
||||
wxUnusedVar(sender);
|
||||
wxUnusedVar(frameName);
|
||||
|
||||
NSString *url = [[request URL] absoluteString];
|
||||
|
||||
wxWebViewNavigationActionFlags flags = wxWEBVIEW_NAV_ACTION_USER;
|
||||
@@ -1112,6 +1121,7 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out)
|
||||
// This method is called when window.open() is used in javascript with a target != _self
|
||||
// request is always nil, so it can't be used for event generation
|
||||
// Mark the next navigation as "new window"
|
||||
wxUnusedVar(request);
|
||||
webKitWindow->m_nextNavigationIsNewWindow = true;
|
||||
return sender;
|
||||
}
|
||||
@@ -1127,6 +1137,9 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out)
|
||||
- (NSArray *)webView:(WebView *)sender contextMenuItemsForElement:(NSDictionary *)element
|
||||
defaultMenuItems:(NSArray *) defaultMenuItems
|
||||
{
|
||||
wxUnusedVar(sender);
|
||||
wxUnusedVar(element);
|
||||
|
||||
if(webKitWindow->IsContextMenuEnabled())
|
||||
return defaultMenuItems;
|
||||
else
|
||||
|
@@ -58,6 +58,7 @@
|
||||
|
||||
- (void)mouseEntered:(NSEvent *)evt
|
||||
{
|
||||
wxUnusedVar(evt);
|
||||
wxMouseEvent wxevent(wxEVT_ENTER_WINDOW);
|
||||
wxevent.SetEventObject(m_wxWin);
|
||||
m_wxWin->ProcessWindowEvent(wxevent);
|
||||
@@ -65,6 +66,7 @@
|
||||
|
||||
- (void)mouseExited:(NSEvent *)evt
|
||||
{
|
||||
wxUnusedVar(evt);
|
||||
wxMouseEvent wxevent(wxEVT_LEAVE_WINDOW);
|
||||
wxevent.SetEventObject(m_wxWin);
|
||||
m_wxWin->ProcessWindowEvent(wxevent);
|
||||
|
@@ -252,6 +252,9 @@ void* wxDynamicLibrary::GetModuleFromAddress(const void* addr, wxString* path)
|
||||
*path = di.dli_fname;
|
||||
|
||||
return di.dli_fbase;
|
||||
#else
|
||||
wxUnusedVar(addr);
|
||||
wxUnusedVar(path);
|
||||
#endif // HAVE_DLADDR
|
||||
|
||||
return NULL;
|
||||
|
@@ -229,7 +229,7 @@ void wxNativeFontInfo::SetStyle(wxFontStyle style)
|
||||
break;
|
||||
default:
|
||||
wxFAIL_MSG( "unknown font style" );
|
||||
// fall through
|
||||
wxFALLTHROUGH;
|
||||
case wxFONTSTYLE_NORMAL:
|
||||
pango_font_description_set_style( description, PANGO_STYLE_NORMAL );
|
||||
break;
|
||||
|
@@ -69,18 +69,18 @@ public:
|
||||
m_data(NULL), m_evtHandler(NULL) {}
|
||||
virtual ~wxSoundBackendSDL();
|
||||
|
||||
wxString GetName() const { return wxT("Simple DirectMedia Layer"); }
|
||||
int GetPriority() const { return 9; }
|
||||
bool IsAvailable() const;
|
||||
bool HasNativeAsyncPlayback() const { return true; }
|
||||
wxString GetName() const wxOVERRIDE { return wxT("Simple DirectMedia Layer"); }
|
||||
int GetPriority() const wxOVERRIDE { return 9; }
|
||||
bool IsAvailable() const wxOVERRIDE;
|
||||
bool HasNativeAsyncPlayback() const wxOVERRIDE { return true; }
|
||||
bool Play(wxSoundData *data, unsigned flags,
|
||||
volatile wxSoundPlaybackStatus *status);
|
||||
volatile wxSoundPlaybackStatus *status) wxOVERRIDE;
|
||||
|
||||
void FillAudioBuffer(Uint8 *stream, int len);
|
||||
void FinishedPlayback();
|
||||
|
||||
void Stop();
|
||||
bool IsPlaying() const { return m_playing; }
|
||||
void Stop() wxOVERRIDE;
|
||||
bool IsPlaying() const wxOVERRIDE { return m_playing; }
|
||||
|
||||
private:
|
||||
bool OpenAudio();
|
||||
|
@@ -437,9 +437,9 @@ bool wxUIActionSimulatorX11Impl::MouseMove(long x, long y)
|
||||
}
|
||||
|
||||
return ret;
|
||||
#endif
|
||||
|
||||
#else
|
||||
return DoX11MouseMove(x, y);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool wxUIActionSimulatorX11Impl::MouseUp(int button)
|
||||
|
@@ -282,7 +282,7 @@ static void wxWinHintsSetLayer(Display *display, Window rootWnd,
|
||||
#ifdef __WXGTK20__
|
||||
static bool wxQueryWMspecSupport(Display* WXUNUSED(display),
|
||||
Window WXUNUSED(rootWnd),
|
||||
Atom (feature))
|
||||
Atom feature)
|
||||
{
|
||||
GdkAtom gatom = gdk_x11_xatom_to_atom(feature);
|
||||
return gdk_x11_screen_supports_net_wm_hint(gdk_screen_get_default(), gatom);
|
||||
|
Reference in New Issue
Block a user