[beast/devel: 13/35] SFI: replace g_string_aprintf with g_string_add_format



commit 599cfd03487f5def6c964ea01d77cf6e38055f8e
Author: Tim Janik <timj gnu org>
Date:   Sun May 12 19:33:38 2013 +0200

    SFI: replace g_string_aprintf with g_string_add_format

 beast-gtk/bstusermessage.cc |   10 +++++-----
 sfi/glib-extra.hh           |    5 ++---
 sfi/sfitime.cc              |    2 +-
 3 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/beast-gtk/bstusermessage.cc b/beast-gtk/bstusermessage.cc
index 7c72ae0..d80ab26 100644
--- a/beast-gtk/bstusermessage.cc
+++ b/beast-gtk/bstusermessage.cc
@@ -211,15 +211,15 @@ bst_msg_dialog_update (GxkDialog        *dialog,
       GString *gstring = g_string_new (msg->details);
       while (gstring->len && gstring->str[gstring->len - 1] == '\n')
         g_string_erase (gstring, gstring->len - 1, 1);
-      g_string_aprintf (gstring, "\n\n");
+      g_string_add_format (gstring, "\n\n");
       if (hastext (proc_name))
-        g_string_aprintf (gstring, _("Procedure: %s\nScript: %s\n"), proc_name, script_name);
+        g_string_add_format (gstring, _("Procedure: %s\nScript: %s\n"), proc_name, script_name);
       if (hastext (msg->process))
-        g_string_aprintf (gstring, _("Process: %s\n"), msg->process);
+        g_string_add_format (gstring, _("Process: %s\n"), msg->process);
       if (hastext (msg->log_domain) && !hastext (proc_name) && !hastext (msg->process))
-        g_string_aprintf (gstring, _("Origin:  %s\n"), msg->log_domain);
+        g_string_add_format (gstring, _("Origin:  %s\n"), msg->log_domain);
       if (msg->pid && BST_DVL_HINTS)
-          g_string_aprintf (gstring, _("PID:     %u\n"), msg->pid);
+          g_string_add_format (gstring, _("PID:     %u\n"), msg->pid);
       while (gstring->len && gstring->str[gstring->len - 1] == '\n')
         g_string_erase (gstring, gstring->len - 1, 1);
       gchar *text = adapt_message_spacing (NULL, gstring->str, NULL);
diff --git a/sfi/glib-extra.hh b/sfi/glib-extra.hh
index a054965..6ffa99f 100644
--- a/sfi/glib-extra.hh
+++ b/sfi/glib-extra.hh
@@ -30,8 +30,6 @@ G_BEGIN_DECLS
 
 
 /* --- provide (historic) aliases --- */
-#define        g_string_printfa        g_string_append_printf
-#define        g_string_aprintf        g_string_append_printf
 #define        g_scanner_add_symbol( scanner, symbol, value )  G_STMT_START { \
   g_scanner_scope_add_symbol ((scanner), 0, (symbol), (value)); \
 } G_STMT_END
@@ -57,7 +55,8 @@ void g_object_disconnect_any (gpointer object,
                               gpointer data); /* workaorund for g_object_disconnect() */
 
 // == printf variants ==
-#define g_intern_format(...)    g_intern_string (Rapicorn::string_format (__VA_ARGS__).c_str())
+#define g_intern_format(...)            g_intern_string (Rapicorn::string_format (__VA_ARGS__).c_str())
+#define        g_string_add_format(gstr, ...)  g_string_append (gstr, Rapicorn::string_format 
(__VA_ARGS__).c_str())
 
 /* --- string functions --- */
 const gchar*    g_printf_find_localised_directive (const gchar *format);
diff --git a/sfi/sfitime.cc b/sfi/sfitime.cc
index e478602..ce88032 100644
--- a/sfi/sfitime.cc
+++ b/sfi/sfitime.cc
@@ -640,7 +640,7 @@ sfi_time_from_string_err (const gchar *time_string,
            g_string_append (gstring, ", ");
          g_string_append (gstring, (char*) ring->data);
        }
-      g_string_aprintf (gstring, " in date: \"%s\"", time_string);
+      g_string_add_format (gstring, " in date: \"%s\"", time_string);
       *error_p = g_string_free (gstring, FALSE);
     }
   else if (error_p)


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