[beast/devel: 16/35] SFI: use Rapicorn::string_format() for bse_debug arguments
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast/devel: 16/35] SFI: use Rapicorn::string_format() for bse_debug arguments
- Date: Tue, 14 May 2013 19:39:15 +0000 (UTC)
commit d106c2067fd7702b52a4fc3308f0f0c8195a4cf2
Author: Tim Janik <timj gnu org>
Date: Mon May 13 00:35:56 2013 +0200
SFI: use Rapicorn::string_format() for bse_debug arguments
sfi/sfiwrapper.cc | 13 ++-----------
sfi/sfiwrapper.hh | 8 +++-----
2 files changed, 5 insertions(+), 16 deletions(-)
---
diff --git a/sfi/sfiwrapper.cc b/sfi/sfiwrapper.cc
index a28101b..7338f31 100644
--- a/sfi/sfiwrapper.cc
+++ b/sfi/sfiwrapper.cc
@@ -12,18 +12,9 @@ bool volatile _cached_bse_debug = true;
/// Issue a debugging message, configurable via #$BSE_DEBUG.
void
-bse_debug (const char *key, const char *file_path, const int line, const char *format, ...)
+bse_debug (const char *key, const char *file_path, const int line, const String &message)
{
- va_list vargs;
- va_start (vargs, format);
- 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);
- }
+ envkey_debug_message ("BSE_DEBUG", key, file_path, line, message, &_cached_bse_debug);
}
#ifdef DOXYGEN
diff --git a/sfi/sfiwrapper.hh b/sfi/sfiwrapper.hh
index 2605dd1..4f16be5 100644
--- a/sfi/sfiwrapper.hh
+++ b/sfi/sfiwrapper.hh
@@ -15,11 +15,11 @@ using namespace Rapicorn;
// == Debugging ==
/// Issue a general purpose debugging message, configurable via #$BSE_DEBUG.
-#define BSE_DEBUG(...) do { if (BSE_UNLIKELY (Bse::_cached_bse_debug)) Bse::bse_debug (NULL,
RAPICORN_PRETTY_FILE, __LINE__, __VA_ARGS__); } while (0)
+#define BSE_DEBUG(...) do { if (BSE_UNLIKELY (Bse::_cached_bse_debug)) Bse::bse_debug (NULL,
RAPICORN_PRETTY_FILE, __LINE__, Rapicorn::string_format (__VA_ARGS__)); } while (0)
/// Issue a debugging message if debugging for @a key is enabled via #$BSE_DEBUG.
-#define BSE_KEY_DEBUG(key,...) do { if (BSE_UNLIKELY (Bse::_cached_bse_debug)) Bse::bse_debug (key,
RAPICORN_PRETTY_FILE, __LINE__, __VA_ARGS__); } while (0)
+#define BSE_KEY_DEBUG(key,...) do { if (BSE_UNLIKELY (Bse::_cached_bse_debug)) Bse::bse_debug (key,
RAPICORN_PRETTY_FILE, __LINE__, Rapicorn::string_format (__VA_ARGS__)); } while (0)
extern bool volatile _cached_bse_debug;
-void bse_debug (const char*, const char*, int, const char*, ...) RAPICORN_PRINTF (4, 5);
+void bse_debug (const char*, const char*, int, const String&);
bool _bse_debug_enabled (const char *key);
inline bool bse_debug_enabled (const char *key = NULL) { return BSE_UNLIKELY (_cached_bse_debug) &&
_bse_debug_enabled (key); }
bool bse_flipper_check (const char *key);
@@ -60,8 +60,6 @@ bool birnet_file_equals (const char *file1,
#define sfi_warning(...) RAPICORN_CRITICAL (__VA_ARGS__)
#define sfi_info(...) BSE_DEBUG (__VA_ARGS__)
#define sfi_diag(...) BSE_DEBUG (__VA_ARGS__)
-#define sfi_debug(lvl, ...) BSE_DEBUG (__VA_ARGS__)
-#define sfi_nodebug(lvl, ...) do { /* nothing */ } while (0)
/* --- url handling --- */
void sfi_url_show (const char *url);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]