Turn on -Wextra if it's available and clean the warnings it found.
I also fixed most of the -Wpedantic warnings, but didn't turn it on as there
are a bunch of issues with it involving function pointers.
Testing Done:
Compiled and ran the unit tests.
Reviewed at https://reviews.imfreedom.org/r/989/
--- a/gplugin-gtk3/gplugin-gtk-plugin-info.c Sun Oct 03 01:44:30 2021 -0500
+++ b/gplugin-gtk3/gplugin-gtk-plugin-info.c Sun Oct 03 01:45:30 2021 -0500
@@ -79,7 +79,7 @@
-G_DEFINE_TYPE(GPluginGtkPluginInfo, gplugin_gtk_plugin_info, GTK_TYPE_BOX);
+G_DEFINE_TYPE(GPluginGtkPluginInfo, gplugin_gtk_plugin_info, GTK_TYPE_BOX) /******************************************************************************
@@ -261,7 +261,10 @@
*****************************************************************************/
-gplugin_gtk_plugin_info_state_cb(GObject *obj, GParamSpec *pspec, gpointer data)
+gplugin_gtk_plugin_info_state_cb( + G_GNUC_UNUSED GObject *obj, + G_GNUC_UNUSED GParamSpec *pspec, _gplugin_gtk_plugin_info_refresh(GPLUGIN_GTK_PLUGIN_INFO(data));
--- a/gplugin-gtk3/gplugin-gtk-store.c Sun Oct 03 01:44:30 2021 -0500
+++ b/gplugin-gtk3/gplugin-gtk-store.c Sun Oct 03 01:45:30 2021 -0500
@@ -55,7 +55,7 @@
-G_DEFINE_TYPE(GPluginGtkStore, gplugin_gtk_store, GTK_TYPE_LIST_STORE);
+G_DEFINE_TYPE(GPluginGtkStore, gplugin_gtk_store, GTK_TYPE_LIST_STORE) /******************************************************************************
@@ -143,7 +143,7 @@
gplugin_gtk_store_update_plugin_state_cb(
+ G_GNUC_UNUSED GtkTreePath *path, @@ -202,7 +202,7 @@
*****************************************************************************/
gplugin_gtk_store_plugin_loaded_cb(
+ G_GNUC_UNUSED GObject *manager, @@ -211,7 +211,7 @@
gplugin_gtk_store_plugin_unloaded_cb(
+ G_GNUC_UNUSED GObject *manager, --- a/gplugin-gtk3/gplugin-gtk-view.c Sun Oct 03 01:44:30 2021 -0500
+++ b/gplugin-gtk3/gplugin-gtk-view.c Sun Oct 03 01:45:30 2021 -0500
@@ -67,7 +67,7 @@
*****************************************************************************/
gplugin_gtk_view_plugin_toggled_cb(
- GtkCellRendererToggle *rend,
+ G_GNUC_UNUSED GtkCellRendererToggle *rend, @@ -127,7 +127,7 @@
/******************************************************************************
*****************************************************************************/
-G_DEFINE_TYPE(GPluginGtkView, gplugin_gtk_view, GTK_TYPE_TREE_VIEW);
+G_DEFINE_TYPE(GPluginGtkView, gplugin_gtk_view, GTK_TYPE_TREE_VIEW) gplugin_gtk_view_set_property(
--- a/gplugin/gplugin-loader.c Sun Oct 03 01:44:30 2021 -0500
+++ b/gplugin/gplugin-loader.c Sun Oct 03 01:45:30 2021 -0500
@@ -69,7 +69,7 @@
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE(
/******************************************************************************
--- a/gplugin/gplugin-manager.c Sun Oct 03 01:44:30 2021 -0500
+++ b/gplugin/gplugin-manager.c Sun Oct 03 01:45:30 2021 -0500
@@ -86,7 +86,7 @@
-G_DEFINE_TYPE_WITH_PRIVATE(GPluginManager, gplugin_manager, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE(GPluginManager, gplugin_manager, G_TYPE_OBJECT) /******************************************************************************
@@ -191,7 +191,7 @@
gplugin_manager_load_dependencies(
- GPluginPluginInfo *info,
+ G_GNUC_UNUSED GPluginPluginInfo *info, GSList *dependencies = NULL, *l = NULL;
--- a/gplugin/gplugin-manager.h Sun Oct 03 01:44:30 2021 -0500
+++ b/gplugin/gplugin-manager.h Sun Oct 03 01:45:30 2021 -0500
@@ -35,7 +35,7 @@
typedef void (*GPluginManagerForeachFunc)(
--- a/gplugin/gplugin-native-loader.c Sun Oct 03 01:44:30 2021 -0500
+++ b/gplugin/gplugin-native-loader.c Sun Oct 03 01:45:30 2021 -0500
@@ -58,7 +58,7 @@
-G_DEFINE_TYPE(GPluginNativeLoader, gplugin_native_loader, GPLUGIN_TYPE_LOADER);
+G_DEFINE_TYPE(GPluginNativeLoader, gplugin_native_loader, GPLUGIN_TYPE_LOADER) /******************************************************************************
--- a/gplugin/gplugin-native-plugin.c Sun Oct 03 01:44:30 2021 -0500
+++ b/gplugin/gplugin-native-plugin.c Sun Oct 03 01:45:30 2021 -0500
@@ -199,7 +199,7 @@
- gplugin_native_plugin_iface_init));
+ gplugin_native_plugin_iface_init)) gplugin_native_plugin_get_property(
--- a/gplugin/gplugin-plugin.c Sun Oct 03 01:44:30 2021 -0500
+++ b/gplugin/gplugin-plugin.c Sun Oct 03 01:45:30 2021 -0500
@@ -77,7 +77,7 @@
-G_DEFINE_INTERFACE(GPluginPlugin, gplugin_plugin, G_TYPE_INVALID);
+G_DEFINE_INTERFACE(GPluginPlugin, gplugin_plugin, G_TYPE_INVALID) /******************************************************************************
--- a/gplugin/gplugin-version.c Sun Oct 03 01:44:30 2021 -0500
+++ b/gplugin/gplugin-version.c Sun Oct 03 01:45:30 2021 -0500
@@ -223,8 +223,8 @@
return "gplugin version too old (major mismatch)";
- /* disable the pvs-studio suppression after 1.0.0 is released */
- if(major < GPLUGIN_MAJOR_VERSION) { //-V547
+ /* This will warn until 1.0.0 is released. */ + if(major < GPLUGIN_MAJOR_VERSION) { return "gplugin version too new (major mismatch)";
--- a/gplugin/tests/dynamic-type/dynamic-type-provider.c Sun Oct 03 01:44:30 2021 -0500
+++ b/gplugin/tests/dynamic-type/dynamic-type-provider.c Sun Oct 03 01:45:30 2021 -0500
@@ -21,7 +21,7 @@
#include "dynamic-test.h"
-G_DEFINE_DYNAMIC_TYPE(DynamicTest, dynamic_test, G_TYPE_OBJECT);
+G_DEFINE_DYNAMIC_TYPE(DynamicTest, dynamic_test, G_TYPE_OBJECT) dynamic_test_init(G_GNUC_UNUSED DynamicTest *inst)
--- a/gplugin/tests/test-find-plugins.c Sun Oct 03 01:44:30 2021 -0500
+++ b/gplugin/tests/test-find-plugins.c Sun Oct 03 01:45:30 2021 -0500
@@ -26,7 +26,7 @@
test_gplugin_manager_foreach_load_plugins(
G_GNUC_UNUSED const gchar *id,
+ G_GNUC_UNUSED gpointer data) GPluginManager *manager = gplugin_manager_get_default();
@@ -40,7 +40,7 @@
test_gplugin_manager_foreach_unload_plugins(
G_GNUC_UNUSED const gchar *id,
+ G_GNUC_UNUSED gpointer data) GPluginManager *manager = gplugin_manager_get_default();
--- a/gplugin/tests/test-loader-registration.c Sun Oct 03 01:44:30 2021 -0500
+++ b/gplugin/tests/test-loader-registration.c Sun Oct 03 01:45:30 2021 -0500
@@ -73,7 +73,7 @@
G_DEFINE_TYPE(TestGPluginLoader, test_gplugin_loader, GPLUGIN_TYPE_LOADER)
-test_gplugin_loader_init(TestGPluginLoader *loader)
+test_gplugin_loader_init(G_GNUC_UNUSED TestGPluginLoader *loader) --- a/gplugin/tests/test-loader.c Sun Oct 03 01:44:30 2021 -0500
+++ b/gplugin/tests/test-loader.c Sun Oct 03 01:45:30 2021 -0500
@@ -51,7 +51,7 @@
-test_gplugin_plugin_iface_init(GPluginPluginInterface *iface)
+test_gplugin_plugin_iface_init(G_GNUC_UNUSED GPluginPluginInterface *iface) @@ -136,7 +136,7 @@
-test_gplugin_plugin_init(TestGPluginPlugin *plugin)
+test_gplugin_plugin_init(G_GNUC_UNUSED TestGPluginPlugin *plugin) @@ -229,7 +229,7 @@
G_DEFINE_TYPE(TestGPluginLoader, test_gplugin_loader, GPLUGIN_TYPE_LOADER)
-test_gplugin_loader_init(TestGPluginLoader *loader)
+test_gplugin_loader_init(G_GNUC_UNUSED TestGPluginLoader *loader) --- a/gplugin/tests/test-versioned-dependencies.c Sun Oct 03 01:44:30 2021 -0500
+++ b/gplugin/tests/test-versioned-dependencies.c Sun Oct 03 01:45:30 2021 -0500
@@ -23,7 +23,7 @@
*****************************************************************************/
-_test_plugin_loaded(GPluginPlugin *dependent, const gchar *id)
+_test_plugin_loaded(G_GNUC_UNUSED GPluginPlugin *dependent, const gchar *id) GPluginManager *manager = gplugin_manager_get_default();
GPluginPlugin *plugin = NULL;
--- a/lua/gplugin-lua-loader.c Sun Oct 03 01:44:30 2021 -0500
+++ b/lua/gplugin-lua-loader.c Sun Oct 03 01:45:30 2021 -0500
@@ -29,10 +29,7 @@
+G_DEFINE_DYNAMIC_TYPE(GPluginLuaLoader, gplugin_lua_loader, GPLUGIN_TYPE_LOADER) /******************************************************************************
@@ -126,7 +123,7 @@
+ G_GNUC_UNUSED GPluginLoader *loader, @@ -157,7 +154,7 @@
gplugin_lua_loader_unload(
+ G_GNUC_UNUSED GPluginLoader *loader, --- a/lua/gplugin-lua-plugin.c Sun Oct 03 01:44:30 2021 -0500
+++ b/lua/gplugin-lua-plugin.c Sun Oct 03 01:45:30 2021 -0500
@@ -60,7 +60,7 @@
- G_IMPLEMENT_INTERFACE(GPLUGIN_TYPE_PLUGIN, gplugin_lua_plugin_iface_init));
+ G_IMPLEMENT_INTERFACE(GPLUGIN_TYPE_PLUGIN, gplugin_lua_plugin_iface_init)) /******************************************************************************
* GPluginPlugin Implementation
--- a/meson.build Sun Oct 03 01:44:30 2021 -0500
+++ b/meson.build Sun Oct 03 01:45:30 2021 -0500
@@ -99,6 +99,10 @@
+if compiler.has_argument('-Wextra') + add_project_arguments('-Wextra', language : 'c') toplevel_inc = include_directories('.')
###############################################################################
--- a/python3/gplugin-python3-loader.c Sun Oct 03 01:44:30 2021 -0500
+++ b/python3/gplugin-python3-loader.c Sun Oct 03 01:45:30 2021 -0500
@@ -34,7 +34,7 @@
/******************************************************************************
* GPluginLoader Implementation
--- a/python3/gplugin-python3-plugin.c Sun Oct 03 01:44:30 2021 -0500
+++ b/python3/gplugin-python3-plugin.c Sun Oct 03 01:45:30 2021 -0500
@@ -68,7 +68,7 @@
- gplugin_python3_plugin_iface_init));
+ gplugin_python3_plugin_iface_init)) /******************************************************************************
* GPluginPlugin Implementation