[beast/devel: 3/35] SFI: adapt to Rapicorn updates, use string_format() in particular
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast/devel: 3/35] SFI: adapt to Rapicorn updates, use string_format() in particular
- Date: Tue, 14 May 2013 19:38:10 +0000 (UTC)
commit 4f4388c58513171cf30d80583f31d05568cb4254
Author: Tim Janik <timj gnu org>
Date: Sun May 12 04:31:06 2013 +0200
SFI: adapt to Rapicorn updates, use string_format() in particular
sfi/sfiglueproxy.cc | 2 +-
sfi/sfiserial.cc | 7 ++++---
sfi/sfiwrapper.cc | 8 +++++++-
3 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/sfi/sfiglueproxy.cc b/sfi/sfiglueproxy.cc
index f8d11ae..6614874 100644
--- a/sfi/sfiglueproxy.cc
+++ b/sfi/sfiglueproxy.cc
@@ -8,7 +8,7 @@
#include <sfi/gbsearcharray.hh>
#define SDEBUG(...) BSE_KEY_DEBUG ("signals", __VA_ARGS__)
-#define invalid_proxy(proxy) Rapicorn::debug_critical (__FILE__, __LINE__, "invalid proxy id:
%zu", size_t (proxy))
+#define invalid_proxy(proxy) RAPICORN_CRITICAL ("invalid proxy id: %u", proxy)
/* --- structures --- */
typedef struct {
diff --git a/sfi/sfiserial.cc b/sfi/sfiserial.cc
index a62e8ae..c2779bd 100644
--- a/sfi/sfiserial.cc
+++ b/sfi/sfiserial.cc
@@ -128,7 +128,8 @@ string_to_cescape (const String &str) // FIXME: move
/* --- storage helpers --- */
#define gstring_puts(gstring, string) g_string_append (gstring, string)
#define gstring_putc(gstring, vchar) g_string_append_c (gstring, vchar)
-#define gstring_printf g_string_append_printf
+#define gstring_printf(gstring, ...) g_string_append (gstring, Rapicorn::string_format
(__VA_ARGS__).c_str())
+
static void
gstring_break (GString *gstring,
gboolean *needs_break,
@@ -453,9 +454,9 @@ sfi_serialize_primitives (SfiSCategory scat,
guint i;
gstring_puts (gstring, "(");
if (fblock->n_values)
- g_string_append (gstring, Bse::string_printf ("%.9g", fblock->values[0]).c_str());
+ gstring_printf (gstring, "%.9g", fblock->values[0]);
for (i = 1; i < fblock->n_values; i++)
- g_string_append (gstring, Bse::string_printf (" %.9g", fblock->values[i]).c_str());
+ gstring_printf (gstring, " %.9g", fblock->values[i]);
gstring_puts (gstring, ")");
}
}
diff --git a/sfi/sfiwrapper.cc b/sfi/sfiwrapper.cc
index d32b825..a28101b 100644
--- a/sfi/sfiwrapper.cc
+++ b/sfi/sfiwrapper.cc
@@ -16,8 +16,14 @@ bse_debug (const char *key, const char *file_path, const int line, const char *f
{
va_list vargs;
va_start (vargs, format);
- envkey_debug_message ("BSE_DEBUG", key, file_path, line, format, vargs, &_cached_bse_debug);
+ char *str = NULL;
+ int ret = vasprintf (&str, format, vargs);
va_end (vargs);
+ if (ret >= 0 && str)
+ {
+ envkey_debug_message ("BSE_DEBUG", key, file_path, line, str, &_cached_bse_debug);
+ free (str);
+ }
}
#ifdef DOXYGEN
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]