# HG changeset patch
# Node ID 7305eac51d56
# Parent  1ed0cf26a431
diff --git a/demo/talkatudemowindow.c b/demo/talkatudemowindow.c
--- a/demo/talkatudemowindow.c
+++ b/demo/talkatudemowindow.c
@@ -77,7 +77,8 @@
 }
 
 static void
-talkatu_demo_window_insert_html_cb(GtkButton *toggle, gpointer data) {
+talkatu_demo_window_insert_html_cb(G_GNUC_UNUSED GtkButton *toggle,
+                                   gpointer data) {
 	TalkatuDemoWindow *window = TALKATU_DEMO_WINDOW(data);
 	GtkFileChooserNative *dialog = NULL;
 	GtkFileFilter *filter = NULL;
@@ -132,7 +133,8 @@
 }
 
 static void
-talkatu_demo_window_insert_markdown_cb(GtkButton *toggle, gpointer data) {
+talkatu_demo_window_insert_markdown_cb(G_GNUC_UNUSED GtkButton *toggle,
+                                       gpointer data) {
 	TalkatuDemoWindow *window = TALKATU_DEMO_WINDOW(data);
 	GtkFileChooserNative *dialog = NULL;
 	GtkFileFilter *filter = NULL;
@@ -158,7 +160,8 @@
 }
 
 static void
-talkatu_demo_window_buffer_changed_cb(GtkToggleButton *toggle, gpointer data) {
+talkatu_demo_window_buffer_changed_cb(G_GNUC_UNUSED GtkToggleButton *toggle,
+                                      gpointer data) {
 	TalkatuDemoWindow *window = TALKATU_DEMO_WINDOW(data);
 	GtkWidget *view = talkatu_editor_get_input(TALKATU_EDITOR(window->editor));
 
diff --git a/talkatu/talkatuactiongroup.c b/talkatu/talkatuactiongroup.c
--- a/talkatu/talkatuactiongroup.c
+++ b/talkatu/talkatuactiongroup.c
@@ -143,8 +143,8 @@
 
 static void
 talkatu_action_group_action_activated(GSimpleAction *action,
-                                      GVariant      *parameter,
-                                      gpointer       data)
+                                      G_GNUC_UNUSED GVariant *parameter,
+                                      gpointer data)
 {
 	TalkatuActionGroup *ag = TALKATU_ACTION_GROUP(data);
 
@@ -156,8 +156,8 @@
  *****************************************************************************/
 static void
 talkatu_action_group_action_added(GActionGroup *ag,
-                                  gchar        *name,
-                                  gpointer      data)
+                                  gchar *name,
+                                  G_GNUC_UNUSED gpointer data)
 {
 	GAction *action = g_action_map_lookup_action(G_ACTION_MAP(ag), name);
 
@@ -179,8 +179,8 @@
 
 static void
 talkatu_action_group_action_removed(GActionGroup *ag,
-                                    gchar        *name,
-                                    gpointer      data)
+                                    gchar *name,
+                                    G_GNUC_UNUSED gpointer data)
 {
 	GAction *action = g_action_map_lookup_action(G_ACTION_MAP(ag), name);
 
@@ -195,8 +195,8 @@
 
 static void
 talkatu_action_activate(GSimpleAction *action,
-                        GVariant      *parameter,
-                        gpointer       user_data)
+                        G_GNUC_UNUSED GVariant *parameter,
+                        G_GNUC_UNUSED gpointer user_data)
 {
 	g_message(_("activating action %s"), g_action_get_name(G_ACTION(action)));
 
@@ -204,8 +204,8 @@
 
 static void
 talkatu_action_toggle(GSimpleAction *action,
-                      GVariant      *parameter,
-                      gpointer       user_data)
+                      G_GNUC_UNUSED GVariant *parameter,
+                      G_GNUC_UNUSED gpointer user_data)
 {
 	GVariant *state = NULL;
 
@@ -266,7 +266,8 @@
 }
 
 static void
-talkatu_action_reset_activate(GSimpleAction *act, GVariant *parameter,
+talkatu_action_reset_activate(G_GNUC_UNUSED GSimpleAction *act,
+                              G_GNUC_UNUSED GVariant *parameter,
                               gpointer data)
 {
 	TalkatuActionGroup *ag = TALKATU_ACTION_GROUP(data);
@@ -416,7 +417,8 @@
 }
 
 static void
-talkatu_action_attach_file(GSimpleAction *action, GVariant *parameter,
+talkatu_action_attach_file(G_GNUC_UNUSED GSimpleAction *action,
+                           G_GNUC_UNUSED GVariant *parameter,
                            gpointer data)
 {
 	TalkatuActionGroup *ag = TALKATU_ACTION_GROUP(data);
@@ -496,7 +498,8 @@
 }
 
 static void
-talkatu_action_insert_link(GSimpleAction *action, GVariant *parameter,
+talkatu_action_insert_link(G_GNUC_UNUSED GSimpleAction *action,
+                           G_GNUC_UNUSED GVariant *parameter,
                            gpointer data)
 {
 	GtkWidget *link_dialog = talkatu_link_dialog_new();
@@ -566,7 +569,7 @@
 static void
 talkatu_action_group_constructed(GObject *object) {
 	TalkatuActionGroup *ag = TALKATU_ACTION_GROUP(object);
-	gint i;
+	gsize i;
 	GActionEntry entries[] = {
 		{
 			.name = TALKATU_ACTION_FORMAT_BOLD,
@@ -635,7 +638,7 @@
 }
 
 static void
-talkatu_action_group_init(TalkatuActionGroup *group) {
+talkatu_action_group_init(G_GNUC_UNUSED TalkatuActionGroup *group) {
 }
 
 static void
diff --git a/talkatu/talkatubuffer.c b/talkatu/talkatubuffer.c
--- a/talkatu/talkatubuffer.c
+++ b/talkatu/talkatubuffer.c
@@ -82,10 +82,10 @@
  * Callbacks
  *****************************************************************************/
 static void
-talkatu_buffer_action_toggled_cb(GActionGroup *action_group,
-                                 gchar        *name,
-                                 GVariant     *value,
-                                 gpointer      data)
+talkatu_buffer_action_toggled_cb(G_GNUC_UNUSED GActionGroup *action_group,
+                                 gchar *name,
+                                 GVariant *value,
+                                 gpointer data)
 {
 	TalkatuBufferPrivate *priv = talkatu_buffer_get_instance_private(data);
 	const gchar *tag_name = NULL;
@@ -122,7 +122,7 @@
 }
 
 static GSimpleActionGroup *
-talkatu_buffer_default_creation_action_group(TalkatuBuffer *buffer) {
+talkatu_buffer_default_creation_action_group(G_GNUC_UNUSED TalkatuBuffer *buffer) {
 	return g_simple_action_group_new();
 }
 
@@ -130,7 +130,7 @@
  * GtkTextBuffer Stuff
  *****************************************************************************/
 static void
-talkatu_buffer_toggle_tag(GtkTextBuffer *buffer,
+talkatu_buffer_toggle_tag(G_GNUC_UNUSED GtkTextBuffer *buffer,
                           GSimpleActionGroup *action_group,
                           GtkTextTag *tag,
                           gboolean state)
@@ -351,7 +351,7 @@
                            GObjectConstructParam *params)
 {
 	GObjectConstructParam *param;
-	gint i = 0;
+	gsize i = 0;
 
 	for(i = 0, param = params; i < n_params; i++, param++) {
 		const gchar *name = g_param_spec_get_name(param->pspec);
@@ -375,7 +375,7 @@
 }
 
 static void
-talkatu_buffer_init(TalkatuBuffer *buffer) {
+talkatu_buffer_init(G_GNUC_UNUSED TalkatuBuffer *buffer) {
 	// gtk_text_buffer_register_serialize_tagset(GTK_TEXT_BUFFER(buffer), NULL);
 	// gtk_text_buffer_register_deserialize_tagset(GTK_TEXT_BUFFER(buffer), NULL);
 }
diff --git a/talkatu/talkatueditor.c b/talkatu/talkatueditor.c
--- a/talkatu/talkatueditor.c
+++ b/talkatu/talkatueditor.c
@@ -71,12 +71,15 @@
  * Callbacks
  *****************************************************************************/
 static void
-talkatu_editor_view_buffer_changed_handler(GObject *obj, GParamSpec *pspec, gpointer data) {
+talkatu_editor_view_buffer_changed_handler(G_GNUC_UNUSED GObject *obj,
+                                           G_GNUC_UNUSED GParamSpec *pspec,
+                                           gpointer data) {
 	talkatu_editor_buffer_changed(TALKATU_EDITOR(data));
 }
 
 static void
-talkatu_editor_send_button_clicked_cb(GtkButton *button, gpointer data) {
+talkatu_editor_send_button_clicked_cb(G_GNUC_UNUSED GtkButton *button,
+                                      gpointer data) {
 	TalkatuEditor *editor = TALKATU_EDITOR(data);
 
 	talkatu_input_send_message(TALKATU_INPUT(editor->input));
diff --git a/talkatu/talkatuhtmlbuffer.c b/talkatu/talkatuhtmlbuffer.c
--- a/talkatu/talkatuhtmlbuffer.c
+++ b/talkatu/talkatuhtmlbuffer.c
@@ -64,7 +64,7 @@
  * GObject Stuff
  *****************************************************************************/
 static void
-talkatu_html_buffer_init(TalkatuHtmlBuffer *buffer) {
+talkatu_html_buffer_init(G_GNUC_UNUSED TalkatuHtmlBuffer *buffer) {
 	// gtk_text_buffer_register_deserialize_format(
 	// 	GTK_TEXT_BUFFER(buffer),
 	// 	"text/html",
diff --git a/talkatu/talkatuhtmlpangorenderer.c b/talkatu/talkatuhtmlpangorenderer.c
--- a/talkatu/talkatuhtmlpangorenderer.c
+++ b/talkatu/talkatuhtmlpangorenderer.c
@@ -48,8 +48,8 @@
 static void
 talkatu_html_pango_renderer_passthrough_start(TalkatuHtmlPangoRenderer *renderer,
                                               const gchar *name,
-                                              const gchar **attribute_names,
-                                              const gchar **attribute_values)
+                                              G_GNUC_UNUSED const gchar **attribute_names,
+                                              G_GNUC_UNUSED const gchar **attribute_values)
 {
 	g_string_append_printf(renderer->str, "<%s>", name);
 }
@@ -63,16 +63,16 @@
 
 static void
 talkatu_html_pango_renderer_code_start(TalkatuHtmlPangoRenderer *renderer,
-                                       const gchar *name,
-                                       const gchar **attribute_names,
-                                       const gchar **attribute_values)
+                                       G_GNUC_UNUSED const gchar *name,
+                                       G_GNUC_UNUSED const gchar **attribute_names,
+                                       G_GNUC_UNUSED const gchar **attribute_values)
 {
 	g_string_append(renderer->str, "<span font=\"monospace\">");
 }
 
 static void
 talkatu_html_pango_renderer_link_start(TalkatuHtmlPangoRenderer *renderer,
-                                       const gchar *name,
+                                       G_GNUC_UNUSED const gchar *name,
                                        const gchar **attribute_names,
                                        const gchar **attribute_values)
 {
@@ -94,7 +94,7 @@
 
 static void
 talkatu_html_pango_renderer_font_start(TalkatuHtmlPangoRenderer *renderer,
-                                       const gchar *name,
+                                       G_GNUC_UNUSED const gchar *name,
                                        const gchar **attribute_names,
                                        const gchar **attribute_values)
 {
diff --git a/talkatu/talkatuhtmlrenderer.c b/talkatu/talkatuhtmlrenderer.c
--- a/talkatu/talkatuhtmlrenderer.c
+++ b/talkatu/talkatuhtmlrenderer.c
@@ -143,11 +143,11 @@
                        G_TYPE_OBJECT)
 
 static void
-talkatu_html_renderer_init(TalkatuHtmlRenderer *renderer) {
+talkatu_html_renderer_init(G_GNUC_UNUSED TalkatuHtmlRenderer *renderer) {
 }
 
 static void
-talkatu_html_renderer_class_init(TalkatuHtmlRendererClass *klass) {
+talkatu_html_renderer_class_init(G_GNUC_UNUSED TalkatuHtmlRendererClass *klass) {
 }
 
 /******************************************************************************
diff --git a/talkatu/talkatuinput.c b/talkatu/talkatuinput.c
--- a/talkatu/talkatuinput.c
+++ b/talkatu/talkatuinput.c
@@ -164,14 +164,14 @@
 }
 
 static TalkatuContentType
-talkatu_input_get_content_type(TalkatuInput *input) {
+talkatu_input_get_content_type(G_GNUC_UNUSED TalkatuInput *input) {
 	/* TODO: look at our buffer and map it */
 	return TALKATU_CONTENT_TYPE_PLAIN;
 }
 
 static void
 talkatu_input_set_content_type(TalkatuInput *input,
-                               TalkatuContentType content_type)
+                               G_GNUC_UNUSED TalkatuContentType content_type)
 {
 	/* TODO: set the buffer here? */
 
@@ -304,7 +304,8 @@
 }
 
 static void
-talkatu_input_foreach_attachment_helper(gpointer key, gpointer value,
+talkatu_input_foreach_attachment_helper(G_GNUC_UNUSED gpointer key,
+                                        gpointer value,
                                         gpointer data)
 {
 	TalkatuInputForeachAttachmentData *d = (TalkatuInputForeachAttachmentData *)data;
@@ -394,7 +395,9 @@
 }
 
 static void
-talkatu_input_buffer_set_cb(GObject *view, GParamSpec *pspec, gpointer data) {
+talkatu_input_buffer_set_cb(GObject *view,
+                            G_GNUC_UNUSED GParamSpec *pspec,
+                            G_GNUC_UNUSED gpointer data) {
 	TalkatuInput *input = TALKATU_INPUT(view);
 	GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view));
 
@@ -410,6 +413,7 @@
 	}
 }
 
+#if 0
 static void
 talkatu_input_attachment_response_cb(GtkDialog *dialog, gint response,
                                      gpointer data)
@@ -454,7 +458,6 @@
 	g_object_unref(dialog);
 }
 
-#if 0
 static void
 talkatu_input_image_received_cb(GtkClipboard *clipboard, GdkPixbuf *pixbuf,
                                 gpointer data)
diff --git a/talkatu/talkatumarkdownbuffer.c b/talkatu/talkatumarkdownbuffer.c
--- a/talkatu/talkatumarkdownbuffer.c
+++ b/talkatu/talkatumarkdownbuffer.c
@@ -48,12 +48,12 @@
  *****************************************************************************/
 gboolean
 talkatu_markdown_buffer_deserialize_markdown(GtkTextBuffer *register_buffer,
-                                             GtkTextBuffer *content_buffer,
+                                             G_GNUC_UNUSED GtkTextBuffer *content_buffer,
                                              GtkTextIter *iter,
                                              const guint8 *data,
                                              gsize length,
-                                             gboolean create_tags,
-                                             gpointer user_data,
+                                             G_GNUC_UNUSED gboolean create_tags,
+                                             G_GNUC_UNUSED gpointer user_data,
                                              GError **error)
 {
 	GError *real_error = NULL;
@@ -269,7 +269,7 @@
  * GObject Stuff
  *****************************************************************************/
 static void
-talkatu_markdown_buffer_init(TalkatuMarkdownBuffer *buffer) {
+talkatu_markdown_buffer_init(G_GNUC_UNUSED TalkatuMarkdownBuffer *buffer) {
 	// gtk_text_buffer_register_deserialize_format(
 	// 	GTK_TEXT_BUFFER(buffer),
 	// 	"text/markdown",
diff --git a/talkatu/talkatumarkup.c b/talkatu/talkatumarkup.c
--- a/talkatu/talkatumarkup.c
+++ b/talkatu/talkatumarkup.c
@@ -48,7 +48,8 @@
 	GtkTextTag *tag = NULL;
 	GumboVector *children = NULL;
 	const gchar *tag_name = NULL;
-	gint i = 0, start_pos, length = 0;
+	gsize i = 0;
+	gint start_pos, length = 0;
 
 	start_pos = gtk_text_iter_get_offset(pos);
 
@@ -297,12 +298,12 @@
  */
 gboolean
 talkatu_markup_deserialize_html(GtkTextBuffer *register_buffer,
-                                GtkTextBuffer *content_buffer,
+                                G_GNUC_UNUSED GtkTextBuffer *content_buffer,
                                 GtkTextIter *iter,
                                 const guint8 *data,
                                 gsize length,
-                                gboolean create_tags,
-                                gpointer user_data,
+                                G_GNUC_UNUSED gboolean create_tags,
+                                G_GNUC_UNUSED gpointer user_data,
                                 GError **error)
 {
 	GError *real_error = NULL;
@@ -362,7 +363,7 @@
 talkatu_markup_insert_html(TalkatuBuffer *buffer,
                            GtkTextIter *iter,
                            const gchar *text,
-                           gint len)
+                           G_GNUC_UNUSED gint len)
 {
 	GString *str = NULL;
 	GumboOutput *output = NULL;
@@ -417,10 +418,10 @@
  * Returns: (transfer full): The HTML string.
  */
 gchar *
-talkatu_markup_get_html_range(GtkTextBuffer *buffer,
-	                          const GtkTextIter *start,
-	                          const GtkTextIter *end,
-	                          gsize *len)
+talkatu_markup_get_html_range(G_GNUC_UNUSED GtkTextBuffer *buffer,
+                              const GtkTextIter *start,
+                              const GtkTextIter *end,
+                              G_GNUC_UNUSED gsize *len)
 {
 	GSList *stack = NULL, *l = NULL;
 	GtkTextIter *real_start = NULL, *real_end = NULL, *pos = NULL, *next = NULL;
@@ -545,12 +546,12 @@
  * Returns: (transfer full): The serialized HTML data.
  */
 guint8 *
-talkatu_markup_serialize_html(GtkTextBuffer *register_buffer,
+talkatu_markup_serialize_html(G_GNUC_UNUSED GtkTextBuffer *register_buffer,
                               GtkTextBuffer *content_buffer,
                               const GtkTextIter *start,
                               const GtkTextIter *end,
                               gsize *length,
-                              gpointer user_data)
+                              G_GNUC_UNUSED gpointer user_data)
 {
 	gchar *html = NULL;
 
diff --git a/talkatu/talkatusimpleattachment.c b/talkatu/talkatusimpleattachment.c
--- a/talkatu/talkatusimpleattachment.c
+++ b/talkatu/talkatusimpleattachment.c
@@ -230,7 +230,7 @@
 }
 
 static void
-talkatu_simple_attachment_init(TalkatuSimpleAttachment *attachment) {
+talkatu_simple_attachment_init(G_GNUC_UNUSED TalkatuSimpleAttachment *attachment) {
 }
 
 static void
diff --git a/talkatu/talkatuview.c b/talkatu/talkatuview.c
--- a/talkatu/talkatuview.c
+++ b/talkatu/talkatuview.c
@@ -62,7 +62,7 @@
  * Helpers
  *****************************************************************************/
 static const gchar *
-talkatu_view_url_from_iter(TalkatuView *view, GtkTextIter *iter) {
+talkatu_view_url_from_iter(G_GNUC_UNUSED TalkatuView *view, GtkTextIter *iter) {
 	GSList *tag = NULL;
 	gchar *url = NULL;
 
@@ -86,8 +86,9 @@
  * Actions
  *****************************************************************************/
 static void
-talkatu_view_link_open_cb(GtkWidget *widget, const gchar *action_name,
-                          GVariant *parameter)
+talkatu_view_link_open_cb(GtkWidget *widget,
+                          G_GNUC_UNUSED const gchar *action_name,
+                          G_GNUC_UNUSED GVariant *parameter)
 {
 	TalkatuView *view = TALKATU_VIEW(widget);
 	TalkatuViewPrivate *priv = talkatu_view_get_instance_private(view);
@@ -96,8 +97,9 @@
 }
 
 static void
-talkatu_view_link_copy_cb(GtkWidget *widget, const gchar *action_name,
-                          GVariant *parameter)
+talkatu_view_link_copy_cb(GtkWidget *widget,
+                          G_GNUC_UNUSED const gchar *action_name,
+                          G_GNUC_UNUSED GVariant *parameter)
 {
 	TalkatuView *view = TALKATU_VIEW(widget);
 	TalkatuViewPrivate *priv = talkatu_view_get_instance_private(view);
@@ -115,7 +117,8 @@
  * Signal Handlers
  *****************************************************************************/
 static void
-talkatu_view_pressed_cb(GtkGestureClick *gesture, guint n_press, double wx,
+talkatu_view_pressed_cb(GtkGestureClick *gesture,
+                        G_GNUC_UNUSED guint n_press, double wx,
                         double wy, gpointer data)
 {
 	TalkatuView *view = TALKATU_VIEW(data);
@@ -152,8 +155,8 @@
 }
 
 static void
-talkatu_view_motion_cb(GtkEventControllerMotion *controller, gdouble wx,
-                       gdouble wy, gpointer data)
+talkatu_view_motion_cb(G_GNUC_UNUSED GtkEventControllerMotion *controller,
+                       gdouble wx, gdouble wy, gpointer data)
 {
 	TalkatuView *view = TALKATU_VIEW(data);
 	GtkTextIter iter;
@@ -178,7 +181,9 @@
 }
 
 static void
-talkatu_view_buffer_set_cb(GObject *view, GParamSpec *pspec, gpointer data) {
+talkatu_view_buffer_set_cb(GObject *view,
+                           G_GNUC_UNUSED GParamSpec *pspec,
+                           G_GNUC_UNUSED gpointer data) {
 	TalkatuViewPrivate *priv = talkatu_view_get_instance_private(TALKATU_VIEW(view));
 	GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view));
 
@@ -236,7 +241,7 @@
  * GtkTextViewClass overrides
  *****************************************************************************/
 static GtkTextBuffer *
-talkatu_view_create_buffer(GtkTextView *view) {
+talkatu_view_create_buffer(G_GNUC_UNUSED GtkTextView *view) {
 	return talkatu_buffer_new(NULL);
 }
 
diff --git a/talkatu/talkatuwholebuffer.c b/talkatu/talkatuwholebuffer.c
--- a/talkatu/talkatuwholebuffer.c
+++ b/talkatu/talkatuwholebuffer.c
@@ -61,7 +61,7 @@
                                  GObjectConstructParam *params)
 {
 	GObjectConstructParam *param;
-	gint i = 0;
+	gsize i = 0;
 
 	for(i = 0, param = params; i < n_params; i++, param++) {
 		const gchar *name = g_param_spec_get_name(param->pspec);
@@ -74,7 +74,7 @@
 }
 
 static void
-talkatu_whole_buffer_init(TalkatuWholeBuffer *whole_buffer) {
+talkatu_whole_buffer_init(G_GNUC_UNUSED TalkatuWholeBuffer *whole_buffer) {
 }
 
 static void
