[gimp] app: add G_GNUC_PRINTF() to places where the args are a va_list



commit 2eb74becb8f764d326394159d74574f5a1d904c4
Author: Michael Natterer <mitch gimp org>
Date:   Fri Nov 29 00:33:05 2013 +0100

    app: add G_GNUC_PRINTF() to places where the args are a va_list
    
    The trick is to use G_GNUC_PRINTF (n, 0).

 app/core/gimp.h              |    4 +-
 app/display/gimpstatusbar.c  |    2 +-
 app/display/gimpstatusbar.h  |   12 +++++-----
 app/gimp-log.h               |    2 +-
 app/widgets/gimpmessagebox.c |   51 ++++++++++++++++++++++++-----------------
 5 files changed, 40 insertions(+), 31 deletions(-)
---
diff --git a/app/core/gimp.h b/app/core/gimp.h
index dd96409..b5c4fab 100644
--- a/app/core/gimp.h
+++ b/app/core/gimp.h
@@ -203,12 +203,12 @@ void           gimp_message              (Gimp                *gimp,
                                           GObject             *handler,
                                           GimpMessageSeverity  severity,
                                           const gchar         *format,
-                                          ...) G_GNUC_PRINTF(4,5);
+                                          ...) G_GNUC_PRINTF (4, 5);
 void           gimp_message_valist       (Gimp                *gimp,
                                           GObject             *handler,
                                           GimpMessageSeverity  severity,
                                           const gchar         *format,
-                                          va_list              args);
+                                          va_list              args) G_GNUC_PRINTF (4, 0);
 void           gimp_message_literal      (Gimp                *gimp,
                                           GObject             *handler,
                                           GimpMessageSeverity  severity,
diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c
index 2fd8b78..5a342d6 100644
--- a/app/display/gimpstatusbar.c
+++ b/app/display/gimpstatusbar.c
@@ -120,7 +120,7 @@ static gboolean gimp_statusbar_temp_timeout       (GimpStatusbar     *statusbar)
 static void     gimp_statusbar_msg_free           (GimpStatusbarMsg  *msg);
 
 static gchar *  gimp_statusbar_vprintf            (const gchar       *format,
-                                                   va_list            args);
+                                                   va_list            args) G_GNUC_PRINTF (1, 0);
 
 
 G_DEFINE_TYPE_WITH_CODE (GimpStatusbar, gimp_statusbar, GTK_TYPE_STATUSBAR,
diff --git a/app/display/gimpstatusbar.h b/app/display/gimpstatusbar.h
index 0e7c431..ae1d506 100644
--- a/app/display/gimpstatusbar.h
+++ b/app/display/gimpstatusbar.h
@@ -91,12 +91,12 @@ void        gimp_statusbar_push                  (GimpStatusbar       *statusbar
                                                   const gchar         *context,
                                                   const gchar         *stock_id,
                                                   const gchar         *format,
-                                                  ...) G_GNUC_PRINTF(4,5);
+                                                  ...) G_GNUC_PRINTF (4, 5);
 void        gimp_statusbar_push_valist           (GimpStatusbar       *statusbar,
                                                   const gchar         *context,
                                                   const gchar         *stock_id,
                                                   const gchar         *format,
-                                                  va_list              args);
+                                                  va_list              args) G_GNUC_PRINTF (4, 0);
 void        gimp_statusbar_push_coords           (GimpStatusbar       *statusbar,
                                                   const gchar         *context,
                                                   const gchar         *stock_id,
@@ -117,12 +117,12 @@ void        gimp_statusbar_replace               (GimpStatusbar       *statusbar
                                                   const gchar         *context,
                                                   const gchar         *stock_id,
                                                   const gchar         *format,
-                                                  ...) G_GNUC_PRINTF(4,5);
+                                                  ...) G_GNUC_PRINTF (4, 5);
 void        gimp_statusbar_replace_valist        (GimpStatusbar       *statusbar,
                                                   const gchar         *context,
                                                   const gchar         *stock_id,
                                                   const gchar         *format,
-                                                  va_list              args);
+                                                  va_list              args) G_GNUC_PRINTF (4, 0);
 const gchar * gimp_statusbar_peek                (GimpStatusbar       *statusbar,
                                                   const gchar         *context);
 void        gimp_statusbar_pop                   (GimpStatusbar       *statusbar,
@@ -132,12 +132,12 @@ void        gimp_statusbar_push_temp             (GimpStatusbar       *statusbar
                                                   GimpMessageSeverity  severity,
                                                   const gchar         *stock_id,
                                                   const gchar         *format,
-                                                  ...) G_GNUC_PRINTF(4,5);
+                                                  ...) G_GNUC_PRINTF (4, 5);
 void        gimp_statusbar_push_temp_valist      (GimpStatusbar       *statusbar,
                                                   GimpMessageSeverity  severity,
                                                   const gchar         *stock_id,
                                                   const gchar         *format,
-                                                  va_list              args);
+                                                  va_list              args) G_GNUC_PRINTF (4, 0);
 void        gimp_statusbar_pop_temp              (GimpStatusbar       *statusbar);
 
 void        gimp_statusbar_update_cursor         (GimpStatusbar       *statusbar,
diff --git a/app/gimp-log.h b/app/gimp-log.h
index 6b7f2ef..5fc97f8 100644
--- a/app/gimp-log.h
+++ b/app/gimp-log.h
@@ -57,7 +57,7 @@ void   gimp_logv     (GimpLogFlags  flags,
                       const gchar  *function,
                       gint          line,
                       const gchar  *format,
-                      va_list       args);
+                      va_list       args) G_GNUC_PRINTF (4, 0);
 
 
 #ifdef G_HAVE_ISO_VARARGS
diff --git a/app/widgets/gimpmessagebox.c b/app/widgets/gimpmessagebox.c
index 9b8c33f..54725bb 100644
--- a/app/widgets/gimpmessagebox.c
+++ b/app/widgets/gimpmessagebox.c
@@ -42,27 +42,36 @@ enum
 };
 
 
-static void   gimp_message_box_constructed   (GObject        *object);
-static void   gimp_message_box_dispose       (GObject        *object);
-static void   gimp_message_box_finalize      (GObject        *object);
-static void   gimp_message_box_set_property  (GObject        *object,
-                                              guint           property_id,
-                                              const GValue   *value,
-                                              GParamSpec     *pspec);
-static void   gimp_message_box_get_property  (GObject        *object,
-                                              guint           property_id,
-                                              GValue         *value,
-                                              GParamSpec     *pspec);
-
-static void   gimp_message_box_forall        (GtkContainer   *container,
-                                              gboolean        include_internals,
-                                              GtkCallback     callback,
-                                              gpointer        callback_data);
-
-static void   gimp_message_box_size_request  (GtkWidget      *widget,
-                                              GtkRequisition *requisition);
-static void   gimp_message_box_size_allocate (GtkWidget      *widget,
-                                              GtkAllocation  *allocation);
+static void   gimp_message_box_constructed      (GObject        *object);
+static void   gimp_message_box_dispose          (GObject        *object);
+static void   gimp_message_box_finalize         (GObject        *object);
+static void   gimp_message_box_set_property     (GObject        *object,
+                                                 guint           property_id,
+                                                 const GValue   *value,
+                                                 GParamSpec     *pspec);
+static void   gimp_message_box_get_property     (GObject        *object,
+                                                 guint           property_id,
+                                                 GValue         *value,
+                                                 GParamSpec     *pspec);
+
+static void   gimp_message_box_forall           (GtkContainer   *container,
+                                                 gboolean        include_internals,
+                                                 GtkCallback     callback,
+                                                 gpointer        callback_data);
+
+static void   gimp_message_box_size_request     (GtkWidget      *widget,
+                                                 GtkRequisition *requisition);
+static void   gimp_message_box_size_allocate    (GtkWidget      *widget,
+                                                 GtkAllocation  *allocation);
+
+static void   gimp_message_box_set_label_text   (GimpMessageBox *box,
+                                                 gint            n,
+                                                 const gchar    *format,
+                                                 va_list         args) G_GNUC_PRINTF (3, 0);
+static void   gimp_message_box_set_label_markup (GimpMessageBox *box,
+                                                 gint            n,
+                                                 const gchar    *format,
+                                                 va_list         args) G_GNUC_PRINTF (3, 0);
 
 
 G_DEFINE_TYPE (GimpMessageBox, gimp_message_box, GTK_TYPE_BOX)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]