Merge branch 'extra-warn-fixes'

Fix a few harmless warnings given with -Wextra.
This commit is contained in:
Vadim Zeitlin
2017-11-12 17:48:16 +01:00
4 changed files with 12 additions and 2 deletions

View File

@@ -147,6 +147,9 @@ public:
// backwards compatibility and also because wxGTK has it we could start
// using it for the same purpose in wxX11 too some day.
virtual void *GetXVisualInfo()
#ifdef __WXGTK20__
wxOVERRIDE
#endif
{
return wxGLCanvasX11::GetDefaultXVisualInfo();
}

View File

@@ -58,7 +58,7 @@ wx_gdk_screen_get_monitor_workarea(GdkScreen* screen, int monitor, GdkRectangle*
if (GDK_IS_X11_SCREEN(screen))
#endif
{
GdkRectangle rect = { 0 };
GdkRectangle rect = { 0, 0, 0, 0 };
wxGetWorkAreaX11(GDK_SCREEN_XSCREEN(screen),
rect.x, rect.y, rect.width, rect.height);
// in case _NET_WORKAREA result is too large

View File

@@ -285,7 +285,7 @@ wxDynamicLibraryDetailsArray wxDynamicLibrary::ListLoaded()
void* wxDynamicLibrary::GetModuleFromAddress(const void* addr, wxString* path)
{
#ifdef HAVE_DLADDR
Dl_info di = { 0 };
Dl_info di = { }; // 0 initialize whatever fields the struct has
// At least under Solaris dladdr() takes non-const void*.
if ( dladdr(const_cast<void*>(addr), &di) == 0 )

View File

@@ -235,6 +235,11 @@ private:
// helper function to make changing the code later simpler.
static SecretSchema* GetSchema()
{
// SecretSchema struct has some "reserved" fields in it which we don't
// want to initialize, but this results in this warning if it's
// enabled, so just suppress it here.
wxGCC_WARNING_SUPPRESS(missing-field-initializers)
static SecretSchema s_schema =
{
"org.freedesktop.Secret.Generic",
@@ -246,6 +251,8 @@ private:
}
};
wxGCC_WARNING_RESTORE(missing-field-initializers)
return &s_schema;
}