Skip to content

Commit

Permalink
maint: Suppress unused-parameter warnings for callback functions
Browse files Browse the repository at this point in the history
  • Loading branch information
andy5995 committed Feb 18, 2024
1 parent 04ec1ac commit 54a6a2b
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion pinner.c
Expand Up @@ -145,18 +145,23 @@ is_duplicate(const gchar* file_name)
static void
pin_document_key_cb(guint key_id)
{
(void)key_id;

pin_activate_cb(NULL, NULL);
}

static void
unpin_document_key_cb(guint key_id)
{
(void)key_id;
unpin_activate_cb(NULL, NULL);
}

static void
pin_activate_cb(GtkMenuItem* menuitem, gpointer pdata)
{
(void)menuitem;

gchar* ptr_file_name = NULL;
if (pdata == NULL) {
GeanyDocument* doc = document_get_current();
Expand Down Expand Up @@ -205,6 +210,9 @@ pin_activate_cb(GtkMenuItem* menuitem, gpointer pdata)
static void
unpin_activate_cb(GtkMenuItem* menuitem, gpointer pdata)
{
(void)pdata;
(void)menuitem;

GeanyDocument* doc = document_get_current();
if (doc == NULL)
return;
Expand All @@ -219,8 +227,10 @@ unpin_activate_cb(GtkMenuItem* menuitem, gpointer pdata)
}

static gboolean
on_button_press_cb(GtkWidget* widget, GdkEventButton* event, gpointer data)
on_button_press_cb(GtkWidget* widget, GdkEventButton* event, gpointer pdata)
{
(void)pdata;

if (event->type == GDK_BUTTON_PRESS && event->button == GDK_BUTTON_PRIMARY) {
// Check if the clicked widget is an event box
if (GTK_IS_EVENT_BOX(widget)) {
Expand Down Expand Up @@ -255,6 +265,10 @@ on_button_press_cb(GtkWidget* widget, GdkEventButton* event, gpointer data)
static gboolean
pin_init(GeanyPlugin* plugin, gpointer pdata)
{
// Keep the function declaration as-is for now, but suppress the compiler
// warning that the value is not used.
(void)pdata;

GtkWidget** tools_item =
g_new0(GtkWidget*,
3); // Allocate memory for 3 pointers (2 items + NULL terminator)
Expand Down Expand Up @@ -317,6 +331,8 @@ pin_init(GeanyPlugin* plugin, gpointer pdata)
static void
pin_cleanup(GeanyPlugin* plugin, gpointer pdata)
{
(void)plugin;

if (doc_to_widget_map != NULL) {
g_hash_table_destroy(doc_to_widget_map);
doc_to_widget_map = NULL;
Expand Down

0 comments on commit 54a6a2b

Please sign in to comment.