gplugin/gplugin

Parents 197847a9814e
Children b6ddb0b3e45b
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 @@
NULL,
};
-G_DEFINE_TYPE(GPluginGtkPluginInfo, gplugin_gtk_plugin_info, GTK_TYPE_BOX);
+G_DEFINE_TYPE(GPluginGtkPluginInfo, gplugin_gtk_plugin_info, GTK_TYPE_BOX)
/******************************************************************************
* Callbacks
@@ -261,7 +261,10 @@
* Callbacks
*****************************************************************************/
static void
-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,
+ gpointer data)
{
_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 @@
GtkListStore parent;
};
-G_DEFINE_TYPE(GPluginGtkStore, gplugin_gtk_store, GTK_TYPE_LIST_STORE);
+G_DEFINE_TYPE(GPluginGtkStore, gplugin_gtk_store, GTK_TYPE_LIST_STORE)
/******************************************************************************
* Globals
@@ -143,7 +143,7 @@
static gboolean
gplugin_gtk_store_update_plugin_state_cb(
GtkTreeModel *model,
- GtkTreePath *path,
+ G_GNUC_UNUSED GtkTreePath *path,
GtkTreeIter *iter,
gpointer data)
{
@@ -202,7 +202,7 @@
*****************************************************************************/
static void
gplugin_gtk_store_plugin_loaded_cb(
- GObject *manager,
+ G_GNUC_UNUSED GObject *manager,
GPluginPlugin *plugin,
gpointer data)
{
@@ -211,7 +211,7 @@
static void
gplugin_gtk_store_plugin_unloaded_cb(
- GObject *manager,
+ G_GNUC_UNUSED GObject *manager,
GPluginPlugin *plugin,
gpointer data)
{
--- 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 @@
*****************************************************************************/
static void
gplugin_gtk_view_plugin_toggled_cb(
- GtkCellRendererToggle *rend,
+ G_GNUC_UNUSED GtkCellRendererToggle *rend,
gchar *path,
gpointer data)
{
@@ -127,7 +127,7 @@
/******************************************************************************
* GObject Implementation
*****************************************************************************/
-G_DEFINE_TYPE(GPluginGtkView, gplugin_gtk_view, GTK_TYPE_TREE_VIEW);
+G_DEFINE_TYPE(GPluginGtkView, gplugin_gtk_view, GTK_TYPE_TREE_VIEW)
static void
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(
GPluginLoader,
gplugin_loader,
- G_TYPE_OBJECT);
+ G_TYPE_OBJECT)
/******************************************************************************
* Helpers
--- 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 @@
gboolean refresh_needed;
} GPluginManagerPrivate;
-G_DEFINE_TYPE_WITH_PRIVATE(GPluginManager, gplugin_manager, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE(GPluginManager, gplugin_manager, G_TYPE_OBJECT)
/******************************************************************************
* Globals
@@ -191,7 +191,7 @@
gplugin_manager_load_dependencies(
GPluginManager *manager,
GPluginPlugin *plugin,
- GPluginPluginInfo *info,
+ G_GNUC_UNUSED GPluginPluginInfo *info,
GError **error)
{
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 @@
gplugin_manager,
GPLUGIN,
MANAGER,
- GObject);
+ GObject)
typedef void (*GPluginManagerForeachFunc)(
const gchar *id,
--- 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 @@
GPluginLoader parent;
};
-G_DEFINE_TYPE(GPluginNativeLoader, gplugin_native_loader, GPLUGIN_TYPE_LOADER);
+G_DEFINE_TYPE(GPluginNativeLoader, gplugin_native_loader, GPLUGIN_TYPE_LOADER)
/******************************************************************************
* Helpers
--- 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 @@
G_TYPE_TYPE_MODULE,
G_IMPLEMENT_INTERFACE(
GPLUGIN_TYPE_PLUGIN,
- gplugin_native_plugin_iface_init));
+ gplugin_native_plugin_iface_init))
static void
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 @@
0,
};
-G_DEFINE_INTERFACE(GPluginPlugin, gplugin_plugin, G_TYPE_INVALID);
+G_DEFINE_INTERFACE(GPluginPlugin, gplugin_plugin, G_TYPE_INVALID)
/******************************************************************************
* Object Stuff
--- 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)
static void
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,
GSList *plugins,
- gpointer data)
+ G_GNUC_UNUSED gpointer data)
{
GPluginManager *manager = gplugin_manager_get_default();
GSList *l = NULL;
@@ -40,7 +40,7 @@
test_gplugin_manager_foreach_unload_plugins(
G_GNUC_UNUSED const gchar *id,
GSList *plugins,
- gpointer data)
+ G_GNUC_UNUSED gpointer data)
{
GPluginManager *manager = gplugin_manager_get_default();
GSList *l = NULL;
--- 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)
static void
-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 @@
};
static void
-test_gplugin_plugin_iface_init(GPluginPluginInterface *iface)
+test_gplugin_plugin_iface_init(G_GNUC_UNUSED GPluginPluginInterface *iface)
{
}
@@ -136,7 +136,7 @@
}
static void
-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)
static void
-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 @@
* Helpers
*****************************************************************************/
static void
-_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 @@
GPluginLoader parent;
};
-G_DEFINE_DYNAMIC_TYPE(
- GPluginLuaLoader,
- gplugin_lua_loader,
- GPLUGIN_TYPE_LOADER);
+G_DEFINE_DYNAMIC_TYPE(GPluginLuaLoader, gplugin_lua_loader, GPLUGIN_TYPE_LOADER)
/******************************************************************************
* Helpers
@@ -126,7 +123,7 @@
static gboolean
gplugin_lua_loader_load(
- GPluginLoader *loader,
+ G_GNUC_UNUSED GPluginLoader *loader,
GPluginPlugin *plugin,
GError **error)
{
@@ -157,7 +154,7 @@
static gboolean
gplugin_lua_loader_unload(
- GPluginLoader *loader,
+ G_GNUC_UNUSED GPluginLoader *loader,
GPluginPlugin *plugin,
gboolean shutdown,
GError **error)
--- 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 @@
gplugin_lua_plugin,
G_TYPE_OBJECT,
0,
- 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 @@
endif
endif
+if compiler.has_argument('-Wextra')
+ add_project_arguments('-Wextra', language : 'c')
+endif
+
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 @@
G_DEFINE_DYNAMIC_TYPE(
GPluginPython3Loader,
gplugin_python3_loader,
- GPLUGIN_TYPE_LOADER);
+ GPLUGIN_TYPE_LOADER)
/******************************************************************************
* 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 @@
0,
G_IMPLEMENT_INTERFACE(
GPLUGIN_TYPE_PLUGIN,
- gplugin_python3_plugin_iface_init));
+ gplugin_python3_plugin_iface_init))
/******************************************************************************
* GPluginPlugin Implementation