From f9c2a443074f2c54f6fba1c54af6b53a8dc410aa Mon Sep 17 00:00:00 2001 From: Jonathan Boeing Date: Wed, 15 Sep 2021 03:26:30 -0700 Subject: [PATCH] Fix -Wunused-function warnings --- src/addressbook.c | 5 --- src/gtk/gtkutils.c | 61 --------------------------- src/plugins/fancy/fancy_viewer.c | 2 + src/plugins/litehtml_viewer/lh_viewer.c | 40 +----------------- src/plugins/notification/notification_prefs.c | 18 -------- src/plugins/pgpinline/pgpinline.c | 2 - src/plugins/python/accounttype.c | 10 ----- src/plugins/python/python_plugin.c | 38 ----------------- 8 files changed, 4 insertions(+), 172 deletions(-) diff --git a/src/addressbook.c b/src/addressbook.c index 60727bc68..d96109c8b 100644 --- a/src/addressbook.c +++ b/src/addressbook.c @@ -393,11 +393,6 @@ static GtkTargetEntry addressbook_drag_types[] = static GtkTargetList *addressbook_target_list = NULL; -static void about_show_cb(GtkAction *action, gpointer data) -{ - about_show(); -} - static GtkActionEntry addressbook_entries[] = { {"Menu", NULL, "Menu", NULL, NULL, NULL }, diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c index 02f140581..85f532d8e 100644 --- a/src/gtk/gtkutils.c +++ b/src/gtk/gtkutils.c @@ -1143,67 +1143,6 @@ GtkWidget *face_get_from_header(const gchar *o_face) return image; } -static GdkCursor *hand_cursor = NULL; - -static void link_btn_enter(GtkButton *button, gpointer data) -{ - GdkWindow *gdkwin; - GtkWidget *window = (GtkWidget *)data; - - gdkwin = gtk_widget_get_window(window); - - if (!hand_cursor) - hand_cursor = gdk_cursor_new_for_display( - gdk_window_get_display(gdkwin), GDK_HAND2); - if (window && gdkwin) - gdk_window_set_cursor(gdkwin, hand_cursor); - - gtk_button_set_relief(button, GTK_RELIEF_NONE); - gtk_widget_set_state_flags(GTK_WIDGET(button), GTK_STATE_FLAG_NORMAL, TRUE); -} - -static void link_btn_leave(GtkButton *button, gpointer data) -{ - GdkWindow *gdkwin; - GtkWidget *window = (GtkWidget *)data; - - gdkwin = gtk_widget_get_window(window); - - if (window && gdkwin) - gdk_window_set_cursor(gdkwin, NULL); - - gtk_button_set_relief(button, GTK_RELIEF_NONE); - gtk_widget_set_state_flags(GTK_WIDGET(button), GTK_STATE_FLAG_NORMAL, TRUE); -} - -static void link_btn_pressed(GtkButton *button, gpointer data) -{ - gtk_button_set_relief(button, GTK_RELIEF_NONE); - gtk_widget_set_state_flags(GTK_WIDGET(button), GTK_STATE_FLAG_NORMAL, TRUE); -} - -static void link_btn_released(GtkButton *button, gpointer data) -{ - gtk_button_set_relief(button, GTK_RELIEF_NONE); - gtk_widget_set_state_flags(GTK_WIDGET(button), GTK_STATE_FLAG_NORMAL, TRUE); -} - -static void link_btn_clicked(GtkButton *button, gpointer data) -{ - gchar *url = (gchar *)data; - gtk_button_set_relief(button, GTK_RELIEF_NONE); - gtk_widget_set_state_flags(GTK_WIDGET(button), GTK_STATE_FLAG_NORMAL, TRUE); - open_uri(url, prefs_common_get_uri_cmd()); -} - -static void link_btn_unrealize(GtkButton *button, gpointer data) -{ - gchar *url = (gchar *)data; - g_signal_handlers_disconnect_by_func(G_OBJECT(button), - G_CALLBACK(link_btn_clicked), url); - g_free(url); -} - static gboolean _combobox_separator_func(GtkTreeModel *model, GtkTreeIter *iter, gpointer data) { diff --git a/src/plugins/fancy/fancy_viewer.c b/src/plugins/fancy/fancy_viewer.c index 03cbe0cce..30e5090ed 100644 --- a/src/plugins/fancy/fancy_viewer.c +++ b/src/plugins/fancy/fancy_viewer.c @@ -48,9 +48,11 @@ load_progress_cb(WebKitWebView *view, GParamSpec *param, FancyViewer *viewer); static MimeViewerFactory fancy_viewer_factory; +/* static gboolean fancy_text_search(MimeViewer *_viewer, gboolean backward, const gchar *str, gboolean case_sens); +*/ static void viewer_menu_handler(GtkWidget *menuitem, FancyViewer *viewer); diff --git a/src/plugins/litehtml_viewer/lh_viewer.c b/src/plugins/litehtml_viewer/lh_viewer.c index 20d11619c..13b85a364 100644 --- a/src/plugins/litehtml_viewer/lh_viewer.c +++ b/src/plugins/litehtml_viewer/lh_viewer.c @@ -43,44 +43,6 @@ static GtkWidget *lh_get_widget(MimeViewer *_viewer) return viewer->vbox; } -static gchar *get_utf8_string(const gchar *string) { - gchar *utf8 = NULL; - gsize length; - GError *error = NULL; - gchar *locale = NULL; - - if (!g_utf8_validate(string, -1, NULL)) { - const gchar *cur_locale = conv_get_current_locale(); - gchar* split = g_strstr_len(cur_locale, -1, "."); - if (split) { - locale = ++split; - } else { - locale = (gchar *) cur_locale; - } - debug_print("Try converting to UTF-8 from %s\n", locale); - if (g_ascii_strcasecmp("utf-8", locale) != 0) { - utf8 = g_convert(string, -1, "utf-8", locale, NULL, &length, &error); - if (error) { - debug_print("Failed convertion to current locale: %s\n", error->message); - g_clear_error(&error); - } - } - if (!utf8) { - debug_print("Use iso-8859-1 as last resort\n"); - utf8 = g_convert(string, -1, "utf-8", "iso-8859-1", NULL, &length, &error); - if (error) { - debug_print("Charset detection failed. Use text as is\n"); - utf8 = g_strdup(string); - g_clear_error(&error); - } - } - } else { - utf8 = g_strdup(string); - } - - return utf8; -} - static void lh_show_mimepart(MimeViewer *_viewer, const gchar *infile, MimeInfo *partinfo) { @@ -132,6 +94,7 @@ static void lh_destroy_viewer(MimeViewer *_viewer) g_free(viewer); } +/* static void lh_print_viewer (MimeViewer *_viewer) { debug_print("LH: print_viewer\n"); @@ -139,6 +102,7 @@ static void lh_print_viewer (MimeViewer *_viewer) LHViewer* viewer = (LHViewer *) _viewer; lh_widget_print(viewer->widget); } +*/ static gboolean lh_scroll_page(MimeViewer *_viewer, gboolean up) diff --git a/src/plugins/notification/notification_prefs.c b/src/plugins/notification/notification_prefs.c index 1c71a1bbc..7a9afc85c 100644 --- a/src/plugins/notification/notification_prefs.c +++ b/src/plugins/notification/notification_prefs.c @@ -394,8 +394,6 @@ static void notify_hotkeys_enable_set_sensitivity(GtkToggleButton*, gpointer); #endif /* NOTIFICATION_HOTKEYS */ -static gint conv_color_to_int(GdkColor*); - void notify_gtk_init(void) { static gchar *path[3]; @@ -1919,19 +1917,3 @@ static void notify_hotkeys_enable_set_sensitivity(GtkToggleButton *button, gtk_widget_set_sensitive(hotkeys_page.hotkeys_cont_enable, active); } #endif /* hotkeys */ - - -/* This feels so wrong... */ -static gint conv_color_to_int(GdkColor *color) -{ - gint result; - guint red, green, blue; - - red = (guint) ((gdouble)(color->red) /65535.*255.); - green = (guint) ((gdouble)(color->green) /65535.*255.); - blue = (guint) ((gdouble)(color->blue) /65535.*255.); - - result = (gint) (blue | (green<<8)| (red<<16)); - - return result; -} diff --git a/src/plugins/pgpinline/pgpinline.c b/src/plugins/pgpinline/pgpinline.c index 5bd38775f..4dbd2befb 100644 --- a/src/plugins/pgpinline/pgpinline.c +++ b/src/plugins/pgpinline/pgpinline.c @@ -62,8 +62,6 @@ typedef struct _PGPInlineTaskData static PrivacySystem pgpinline_system; -static gint pgpinline_check_signature(MimeInfo *mimeinfo); - static PrivacyDataPGP *pgpinline_new_privacydata() { PrivacyDataPGP *data; diff --git a/src/plugins/python/accounttype.c b/src/plugins/python/accounttype.c index 0fb30f23f..123d23840 100644 --- a/src/plugins/python/accounttype.c +++ b/src/plugins/python/accounttype.c @@ -41,16 +41,6 @@ static void Account_dealloc(clawsmail_AccountObject* self) Py_TYPE(self)->tp_free((PyObject*)self); } -static int Account_compare(clawsmail_AccountObject *obj1, clawsmail_AccountObject *obj2) -{ - if(obj1->account->account_id < obj2->account->account_id) - return -1; - else if(obj1->account->account_id > obj2->account->account_id) - return 1; - else - return 0; -} - static PyObject* Account_str(clawsmail_AccountObject *self) { if(self->account && self->account->account_name) diff --git a/src/plugins/python/python_plugin.c b/src/plugins/python/python_plugin.c index 99a0b2fb2..ef84a75fc 100644 --- a/src/plugins/python/python_plugin.c +++ b/src/plugins/python/python_plugin.c @@ -621,44 +621,6 @@ done: return inst_StringIO; } -static char* get_exception_information(PyObject *inst_StringIO) -{ - char *retval = NULL; - PyObject *meth_getvalue = NULL; - PyObject *result_getvalue = NULL; - - if(!inst_StringIO) - goto done; - - if(PySys_SetObject("stderr", inst_StringIO) != 0) { - debug_print("Error getting traceback: Could not set sys.stderr to a StringIO instance\n"); - goto done; - } - - meth_getvalue = PyObject_GetAttrString(inst_StringIO, "getvalue"); - if(!meth_getvalue) { - debug_print("Error getting traceback: Could not get the getvalue method of the StringIO instance\n"); - goto done; - } - - PyErr_Print(); - - result_getvalue = PyObject_CallObject(meth_getvalue, NULL); - if(!result_getvalue) { - debug_print("Error getting traceback: Could not call the getvalue method of the StringIO instance\n"); - goto done; - } - - retval = g_strdup(PyBytes_AsString(result_getvalue)); - -done: - - Py_XDECREF(meth_getvalue); - Py_XDECREF(result_getvalue); - - return retval ? retval : g_strdup("Unspecified error occurred"); -} - static void log_func(const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) { } -- 2.11.4.GIT