[beast/devel: 14/35] SFI: replace g_strdup_printf with g_strdup_format()
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast/devel: 14/35] SFI: replace g_strdup_printf with g_strdup_format()
- Date: Tue, 14 May 2013 19:39:05 +0000 (UTC)
commit 9cc4c3032d10a1f87ab59714e9015143a6abefd1
Author: Tim Janik <timj gnu org>
Date: Sun May 12 19:59:04 2013 +0200
SFI: replace g_strdup_printf with g_strdup_format()
beast-gtk/bstapp.cc | 8 +++---
beast-gtk/bstauxdialogs.cc | 2 +-
beast-gtk/bstdbmeter.cc | 2 +-
beast-gtk/bstfiledialog.cc | 12 ++++----
beast-gtk/bstitemseqdialog.cc | 4 +-
beast-gtk/bstkeybindings.cc | 12 ++++----
beast-gtk/bstparam-automation.cc | 10 +++---
beast-gtk/bstparam-choice.cc | 2 +-
beast-gtk/bstparam-color-spinner.cc | 2 +-
beast-gtk/bstparam-item-seq.cc | 4 +-
beast-gtk/bstprofiler.cc | 14 +++++-----
beast-gtk/bstsampleeditor.cc | 4 +-
beast-gtk/bstscrollgraph.cc | 2 +-
beast-gtk/bstsnetrouter.cc | 2 +-
beast-gtk/bsttrackview.cc | 12 ++++----
beast-gtk/bsttreestores.cc | 4 +-
beast-gtk/bstusermessage.cc | 18 ++++++------
beast-gtk/bstutils.cc | 4 +-
beast-gtk/bstwaveeditor.cc | 6 ++--
beast-gtk/gxk/gxkparam.cc | 4 +-
beast-gtk/gxk/gxkradget.cc | 4 +-
beast-gtk/gxk/gxkradgetfactory.cc | 2 +-
beast-gtk/gxk/gxktexttools.cc | 10 +++---
bse/bseautodoc.cc | 8 +++---
bse/bseconstant.cc | 32 +++++++++++-----------
bse/bsecontextmerger.cc | 4 +-
bse/bsedevice.cc | 2 +-
bse/bseengine.cc | 2 +-
bse/bseglue.cc | 2 +-
bse/bseinstrumentinput.cc | 2 +-
bse/bseinstrumentoutput.cc | 2 +-
bse/bsejanitor.cc | 12 ++++----
bse/bseladspa.cc | 12 ++++----
bse/bseloader-bsewave.cc | 6 ++--
bse/bseloader-guspatch.cc | 2 +-
bse/bseloader-oggvorbis.cc | 2 +-
bse/bsemididevice-null.cc | 2 +-
bse/bsemididevice-oss.cc | 14 +++++-----
bse/bseobject.cc | 4 +-
bse/bseparasite.cc | 4 +-
bse/bsepcmdevice-null.cc | 2 +-
bse/bsepcmdevice-oss.cc | 10 +++---
bse/bseprocidl.cc | 2 +-
bse/bseproject.cc | 4 +-
bse/bsescripthelper.cc | 12 ++++----
bse/bseserver.cc | 2 +-
bse/bseserver.proc | 2 +-
bse/bsesnet.cc | 4 +-
bse/bsestorage.cc | 7 +++--
bse/bsesubiport.cc | 14 +++++-----
bse/bsesuboport.cc | 14 +++++-----
bse/bsesubsynth.cc | 30 ++++++++++----------
bse/bsetype.cc | 2 +-
bse/bseutils.cc | 2 +-
bse/gslcommon.cc | 2 +-
bse/gsldatahandle.cc | 4 +-
bse/tests/loophandle.cc | 2 +-
bse/tests/resamplehandle.cc | 4 +-
drivers/bse-portaudio/bsepcmdevice-portaudio.cc | 8 +++---
drivers/bsemididevice-alsa.cc | 18 ++++++------
drivers/bsepcmdevice-alsa.cc | 18 ++++++------
plugins/bsemixer.cc | 32 +++++++++++-----------
plugins/bsesimpleadsr.cc | 2 +-
sfi/glib-extra.hh | 6 +++-
sfi/sficomport.cc | 2 +-
sfi/sficomwire.cc | 10 +++---
sfi/sfidl-parser.hh | 2 +-
sfi/sfiglue.cc | 2 +-
sfi/sfiglueproxy.cc | 4 +-
sfi/sfinote.cc | 4 +-
sfi/sfitime.cc | 22 ++++++++--------
sfi/tests/misctests.cc | 4 +-
shell/bsescminterp.cc | 6 ++--
tools/bsewavetool.cc | 12 ++++----
tools/bwtwave.cc | 2 +-
75 files changed, 266 insertions(+), 263 deletions(-)
---
diff --git a/beast-gtk/bstapp.cc b/beast-gtk/bstapp.cc
index dd09d21..6c2c35a 100644
--- a/beast-gtk/bstapp.cc
+++ b/beast-gtk/bstapp.cc
@@ -503,17 +503,17 @@ bst_app_add_page_item (BstApp *self,
else if (BSE_IS_SONG (item))
{
stock = BST_STOCK_MINI_SONG;
- tip = g_strdup_printf (_("Song: %s"), name);
+ tip = g_strdup_format (_("Song: %s"), name);
}
else if (BSE_IS_MIDI_SYNTH (item))
{
stock = BST_STOCK_MINI_MIDI_SYNTH;
- tip = g_strdup_printf (_("MIDI Synthesizer: %s"), name);
+ tip = g_strdup_format (_("MIDI Synthesizer: %s"), name);
}
else
{
stock = BST_STOCK_MINI_CSYNTH;
- tip = g_strdup_printf (_("Synthesizer: %s"), name);
+ tip = g_strdup_format (_("Synthesizer: %s"), name);
}
GtkWidget *page = NULL;
if (BSE_IS_SUPER (item))
@@ -759,7 +759,7 @@ skin_entries_setup (void)
char *name = bst_file_scan_find_key (file, "skin-name", "");
static guint statici = 1;
if (!name)
- name = g_strdup_printf ("skin-%u", statici++);
+ name = g_strdup_format ("skin-%u", statici++);
if (name && n_skin_entries < 0xffff)
{
guint i = n_skin_entries++;
diff --git a/beast-gtk/bstauxdialogs.cc b/beast-gtk/bstauxdialogs.cc
index 382be45..c3c417f 100644
--- a/beast-gtk/bstauxdialogs.cc
+++ b/beast-gtk/bstauxdialogs.cc
@@ -370,7 +370,7 @@ bst_key_combo_popup (const gchar *function,
}
if (function && function[0])
{
- gchar *str = g_strdup_printf (_("Please press the keyboard shortcut to be installed for function:
%s"), function);
+ gchar *str = g_strdup_format (_("Please press the keyboard shortcut to be installed for function:
%s"), function);
gtk_label_set_text (GTK_LABEL (label), str);
g_free (str);
}
diff --git a/beast-gtk/bstdbmeter.cc b/beast-gtk/bstdbmeter.cc
index 663bcd6..5dc58f2 100644
--- a/beast-gtk/bstdbmeter.cc
+++ b/beast-gtk/bstdbmeter.cc
@@ -268,7 +268,7 @@ static PangoLayout*
bst_db_labeling_create_layout (BstDBLabeling *self,
double dB)
{
- gchar *buffer = g_strdup_printf ("%u", (int) (0.5 + ABS (dB)));
+ gchar *buffer = g_strdup_format ("%u", (int) (0.5 + ABS (dB)));
PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (self), buffer);
g_free (buffer);
return layout;
diff --git a/beast-gtk/bstfiledialog.cc b/beast-gtk/bstfiledialog.cc
index bfb3736..231a4a9 100644
--- a/beast-gtk/bstfiledialog.cc
+++ b/beast-gtk/bstfiledialog.cc
@@ -491,7 +491,7 @@ store_bse_file (SfiProxy project,
gboolean want_overwrite)
{
BseErrorType error = bse_project_store_bse (project, super, file_name, self_contained);
- gchar *title = g_strdup_printf (saving_message_format, bse_item_get_name (super ? super : project));
+ gchar *title = g_strdup_format (saving_message_format, bse_item_get_name (super ? super : project));
gboolean handled = TRUE;
gchar *msg = NULL;
/* handle file exists cases */
@@ -499,7 +499,7 @@ store_bse_file (SfiProxy project,
{
if (!want_overwrite)
{
- gchar *text = g_strdup_printf (_("Failed to save\n`%s'\nto\n`%s':\n%s"), bse_item_get_name
(project), file_name, bse_error_blurb (error));
+ gchar *text = g_strdup_format (_("Failed to save\n`%s'\nto\n`%s':\n%s"), bse_item_get_name
(project), file_name, bse_error_blurb (error));
GtkWidget *choice = bst_choice_dialog_createv (BST_CHOICE_TITLE (title),
BST_CHOICE_TEXT (text),
BST_CHOICE_D (1, BST_STOCK_OVERWRITE, NONE),
@@ -516,7 +516,7 @@ store_bse_file (SfiProxy project,
while (error == BSE_ERROR_FILE_EXISTS)
{
g_free (temp_file);
- temp_file = g_strdup_printf ("%s.tmp%06xyXXXXXX", file_name, rand() & 0xfffffd);
+ temp_file = g_strdup_format ("%s.tmp%06xyXXXXXX", file_name, rand() & 0xfffffd);
char *result = mktemp (temp_file); /* this is save, due to use of: O_CREAT | O_EXCL */
(void) result;
error = bse_project_store_bse (project, super, temp_file, self_contained);
@@ -525,12 +525,12 @@ store_bse_file (SfiProxy project,
if (error != BSE_ERROR_NONE)
{
unlink (temp_file); /* error != BSE_ERROR_FILE_EXISTS */
- msg = g_strdup_printf (_("Failed to save to file\n`%s'\ndue to:\n%s"), file_name,
bse_error_blurb (error));
+ msg = g_strdup_format (_("Failed to save to file\n`%s'\ndue to:\n%s"), file_name,
bse_error_blurb (error));
}
else if (rename (temp_file, file_name) < 0)
{
unlink (temp_file);
- msg = g_strdup_printf (_("Failed to replace file\n`%s'\ndue to:\n%s"), file_name, g_strerror
(errno));
+ msg = g_strdup_format (_("Failed to replace file\n`%s'\ndue to:\n%s"), file_name, g_strerror
(errno));
}
else /* success */
;
@@ -539,7 +539,7 @@ store_bse_file (SfiProxy project,
handled = FALSE; /* exists && !overwrite */
}
else if (error != BSE_ERROR_NONE)
- msg = g_strdup_printf (_("Failed to save to file\n`%s'\ndue to:\n%s"), file_name, bse_error_blurb
(error));
+ msg = g_strdup_format (_("Failed to save to file\n`%s'\ndue to:\n%s"), file_name, bse_error_blurb
(error));
/* report errors */
if (msg)
{
diff --git a/beast-gtk/bstitemseqdialog.cc b/beast-gtk/bstitemseqdialog.cc
index eb835c5..0019862 100644
--- a/beast-gtk/bstitemseqdialog.cc
+++ b/beast-gtk/bstitemseqdialog.cc
@@ -140,10 +140,10 @@ bst_item_seq_dialog_popup (gpointer parent_widget,
/* construct add/remove button tooltips */
gchar *string;
- string = g_strdup_printf (_("Adds the selection from the \"%s\" list to the \"%s\" list"),
candidate_label, item_label);
+ string = g_strdup_format (_("Adds the selection from the \"%s\" list to the \"%s\" list"),
candidate_label, item_label);
gxk_widget_set_tooltip (gxk_radget_find (radget, "button-add"), string);
g_free (string);
- string = g_strdup_printf (_("Removes the selection from the \"%s\" list"), item_label);
+ string = g_strdup_format (_("Removes the selection from the \"%s\" list"), item_label);
gxk_widget_set_tooltip (gxk_radget_find (radget, "button-remove"), string);
g_free (string);
diff --git a/beast-gtk/bstkeybindings.cc b/beast-gtk/bstkeybindings.cc
index d854c21..9e6f613 100644
--- a/beast-gtk/bstkeybindings.cc
+++ b/beast-gtk/bstkeybindings.cc
@@ -333,12 +333,12 @@ key_binding_fill_binding_value (GtkWidget *self,
param = kbinding->keys[nb].param;
switch (kbinding->funcs[kbinding->keys[nb].func_index].ptype)
{
- case BST_KEY_BINDING_PARAM_m1_p1: str = g_strdup_printf ("%+.7f", param); break;
- case BST_KEY_BINDING_PARAM_0_p1: str = g_strdup_printf ("% .7f", param); break;
- case BST_KEY_BINDING_PARAM_m1_0: str = g_strdup_printf ("%+.7f", param); break;
- case BST_KEY_BINDING_PARAM_PERC: str = g_strdup_printf ("% 3.2f", param); break;
- case BST_KEY_BINDING_PARAM_SHORT: str = g_strdup_printf ("% d", (gint) param); break;
- case BST_KEY_BINDING_PARAM_USHORT: str = g_strdup_printf ("% d", (gint) param); break;
+ case BST_KEY_BINDING_PARAM_m1_p1: str = g_strdup_format ("%+.7f", param); break;
+ case BST_KEY_BINDING_PARAM_0_p1: str = g_strdup_format ("% .7f", param); break;
+ case BST_KEY_BINDING_PARAM_m1_0: str = g_strdup_format ("%+.7f", param); break;
+ case BST_KEY_BINDING_PARAM_PERC: str = g_strdup_format ("% 3.2f", param); break;
+ case BST_KEY_BINDING_PARAM_SHORT: str = g_strdup_format ("% d", (gint) param); break;
+ case BST_KEY_BINDING_PARAM_USHORT: str = g_strdup_format ("% d", (gint) param); break;
case BST_KEY_BINDING_PARAM_NOTE: str = sfi_note_to_string (param); break;
default: str = g_strdup (""); break;
}
diff --git a/beast-gtk/bstparam-automation.cc b/beast-gtk/bstparam-automation.cc
index 08183ee..e9dd62a 100644
--- a/beast-gtk/bstparam-automation.cc
+++ b/beast-gtk/bstparam-automation.cc
@@ -178,15 +178,15 @@ param_automation_update (GxkParam *param,
{
content = g_strdup ("--");
/* TRANSLATORS: %s is substituted with a property name */
- tip = g_strdup_printf (_("%s: automation disabled"), g_param_spec_get_nick (param->pspec));
+ tip = g_strdup_format (_("%s: automation disabled"), g_param_spec_get_nick (param->pspec));
}
else if (midi_channel)
{
- content = g_strdup_printf ("%u:%s%02d", midi_channel, prefix, control_type);
+ content = g_strdup_format ("%u:%s%02d", midi_channel, prefix, control_type);
if (cv)
{
/* TRANSLATORS: %s is substituted with a property name, %s is substituted with midi control
type */
- tip = g_strdup_printf (_("%s: automation from MIDI control: %s (MIDI channel: %d)"),
+ tip = g_strdup_format (_("%s: automation from MIDI control: %s (MIDI channel: %d)"),
g_param_spec_get_nick (param->pspec),
cv->choice_label ? cv->choice_label : cv->choice_ident,
midi_channel);
@@ -194,11 +194,11 @@ param_automation_update (GxkParam *param,
}
else
{
- content = g_strdup_printf ("%s%02d", prefix, control_type);
+ content = g_strdup_format ("%s%02d", prefix, control_type);
if (cv)
{
/* TRANSLATORS: %s is substituted with a property name, %s is substituted with midi control
type */
- tip = g_strdup_printf (_("%s: automation from MIDI control: %s"),
+ tip = g_strdup_format (_("%s: automation from MIDI control: %s"),
g_param_spec_get_nick (param->pspec),
cv->choice_label ? cv->choice_label : cv->choice_ident);
}
diff --git a/beast-gtk/bstparam-choice.cc b/beast-gtk/bstparam-choice.cc
index 17ae4f9..83616cd 100644
--- a/beast-gtk/bstparam-choice.cc
+++ b/beast-gtk/bstparam-choice.cc
@@ -72,7 +72,7 @@ param_choice_create (GxkParam *param,
{
SfiProxy proxy = bst_param_get_proxy (param);
g_object_set (widget, "menu", menu, NULL);
- str = g_strdup_printf ("<BEAST-ParamChoice>/%s(%s::%llx)",
+ str = g_strdup_format ("<BEAST-ParamChoice>/%s(%s::%llx)",
param->pspec->name,
proxy ? bse_item_get_type (proxy) : "0",
(long long unsigned) sfi_pspec_get_choice_hash (param->pspec));
diff --git a/beast-gtk/bstparam-color-spinner.cc b/beast-gtk/bstparam-color-spinner.cc
index 424a91a..6ec5071 100644
--- a/beast-gtk/bstparam-color-spinner.cc
+++ b/beast-gtk/bstparam-color-spinner.cc
@@ -25,7 +25,7 @@ param_color_spinner_output (GtkSpinButton *spin_button,
GxkParam *param)
{
guint n = spin_button->adjustment->value;
- gchar *string = g_strdup_printf ("#%06x", n);
+ gchar *string = g_strdup_format ("#%06x", n);
gxk_param_entry_set_text (param, GTK_WIDGET (spin_button), string);
g_free (string);
return TRUE;
diff --git a/beast-gtk/bstparam-item-seq.cc b/beast-gtk/bstparam-item-seq.cc
index 5d8e3f6..239624c 100644
--- a/beast-gtk/bstparam-item-seq.cc
+++ b/beast-gtk/bstparam-item-seq.cc
@@ -91,9 +91,9 @@ param_item_seq_update (GxkParam *param,
if (iseq)
{
if (iseq->n_items == 1)
- content = g_strdup_printf ("%s", bse_item_get_name_or_type (iseq->items[0]));
+ content = g_strdup_format ("%s", bse_item_get_name_or_type (iseq->items[0]));
else if (iseq->n_items > 1 && (!pc->partitions || pc->partitions->n_types == 0))
- content = g_strdup_printf ("#%u", iseq->n_items);
+ content = g_strdup_format ("#%u", iseq->n_items);
else if (iseq->n_items > 1) /* && partitions->n_types */
{
guint i, j, other = 0, *partitions = g_newa (guint, pc->partitions->n_types);
diff --git a/beast-gtk/bstprofiler.cc b/beast-gtk/bstprofiler.cc
index a71bf9c..6d83b56 100644
--- a/beast-gtk/bstprofiler.cc
+++ b/beast-gtk/bstprofiler.cc
@@ -35,25 +35,25 @@ thread_info_cell_fill_value (GtkWidget *profiler,
switch (column)
{
case TCOL_NAME:
- sfi_value_take_string (value, g_strdup_printf ("%s", info->name.c_str()));
+ sfi_value_take_string (value, g_strdup_format ("%s", info->name.c_str()));
break;
case TCOL_PROC:
- sfi_value_take_string (value, info->processor ? g_strdup_printf ("%d", info->processor) : g_strdup
(""));
+ sfi_value_take_string (value, info->processor ? g_strdup_format ("%d", info->processor) : g_strdup
(""));
break;
case TCOL_TID:
- sfi_value_take_string (value, info->task_id ? g_strdup_printf ("%u", info->task_id) : g_strdup (""));
+ sfi_value_take_string (value, info->task_id ? g_strdup_format ("%u", info->task_id) : g_strdup (""));
break;
case TCOL_PRIO:
- sfi_value_take_string (value, info->task_id ? g_strdup_printf ("%d", info->priority) : g_strdup (""));
+ sfi_value_take_string (value, info->task_id ? g_strdup_format ("%d", info->priority) : g_strdup (""));
break;
case TCOL_PERC:
- sfi_value_take_string (value, g_strdup_printf ("%5.2f%%", (info->utime + info->stime) * 0.0001));
+ sfi_value_take_string (value, g_strdup_format ("%5.2f%%", (info->utime + info->stime) * 0.0001));
break;
case TCOL_UTIME:
- sfi_value_take_string (value, g_strdup_printf ("%7.3f", info->utime * 0.001));
+ sfi_value_take_string (value, g_strdup_format ("%7.3f", info->utime * 0.001));
break;
case TCOL_STIME:
- sfi_value_take_string (value, g_strdup_printf ("%7.3f", info->stime * 0.001));
+ sfi_value_take_string (value, g_strdup_format ("%7.3f", info->stime * 0.001));
break;
}
}
diff --git a/beast-gtk/bstsampleeditor.cc b/beast-gtk/bstsampleeditor.cc
index e73fcf3..134c061 100644
--- a/beast-gtk/bstsampleeditor.cc
+++ b/beast-gtk/bstsampleeditor.cc
@@ -206,10 +206,10 @@ qsampler_set_selection (BstQSampler *qsampler,
bst_qsampler_scroll_show (qs, m1);
else if (visible_mark == 2)
bst_qsampler_scroll_show (qs, m2);
- s = g_strdup_printf ("%d", MIN (m1, m2));
+ s = g_strdup_format ("%d", MIN (m1, m2));
gtk_entry_set_text (editor->sstart, s);
g_free (s);
- s = g_strdup_printf ("%d", MAX (m1, m2));
+ s = g_strdup_format ("%d", MAX (m1, m2));
gtk_entry_set_text (editor->send, s);
g_free (s);
}
diff --git a/beast-gtk/bstscrollgraph.cc b/beast-gtk/bstscrollgraph.cc
index f9fff7f..78be1ee 100644
--- a/beast-gtk/bstscrollgraph.cc
+++ b/beast-gtk/bstscrollgraph.cc
@@ -679,7 +679,7 @@ bst_scrollgraph_build_dialog (GtkWidget *alive_object,
g_signal_connect_object (scg, "resize-values", G_CALLBACK (scrollgraph_resize_alignment), alignment,
G_CONNECT_AFTER);
}
GtkWidget *dialog = (GtkWidget*) gxk_dialog_new (NULL, (GtkObject*) alive_object, GxkDialogFlags (0),
"Scrollgraph", (GtkWidget*) radget);
- gchar *title = g_strdup_printf ("Spectrogram: %%s (%s)", bse_source_ochannel_label (source, ochannel));
+ gchar *title = g_strdup_format ("Spectrogram: %%s (%s)", bse_source_ochannel_label (source, ochannel));
bst_window_sync_title_to_proxy (dialog, source, title);
g_free (title);
return dialog;
diff --git a/beast-gtk/bstsnetrouter.cc b/beast-gtk/bstsnetrouter.cc
index 1a94a11..371ec01 100644
--- a/beast-gtk/bstsnetrouter.cc
+++ b/beast-gtk/bstsnetrouter.cc
@@ -667,7 +667,7 @@ bst_snet_router_root_event (BstSNetRouter *self,
choice = bst_choice_menu_createv ("<BEAST-SNetRouter>/ModuleChannelPopup", NULL);
for (int i = 0; i < bse_source_n_ochannels (csource->source); i++)
{
- gchar *name = g_strdup_printf ("%d: %s", i + 1, bse_source_ochannel_label
(csource->source, i));
+ gchar *name = g_strdup_format ("%d: %s", i + 1, bse_source_ochannel_label
(csource->source, i));
bst_choice_menu_add_choice_and_free (choice, BST_CHOICE (monitor_ids + i, name, NONE));
g_free (name);
}
diff --git a/beast-gtk/bsttrackview.cc b/beast-gtk/bsttrackview.cc
index 89d6c32..98e07b3 100644
--- a/beast-gtk/bsttrackview.cc
+++ b/beast-gtk/bsttrackview.cc
@@ -124,7 +124,7 @@ track_view_fill_value (BstItemView *iview,
BseItemSeq *iseq;
SfiSeq *seq;
case COL_SEQID:
- sfi_value_take_string (value, g_strdup_printf ("%03d", seqid));
+ sfi_value_take_string (value, g_strdup_format ("%03d", seqid));
break;
case COL_NAME:
g_value_set_string (value, bse_item_get_name (item));
@@ -135,7 +135,7 @@ track_view_fill_value (BstItemView *iview,
break;
case COL_VOICES:
bse_proxy_get (item, "n_voices", &vint, NULL);
- sfi_value_take_string (value, g_strdup_printf ("%2d", vint));
+ sfi_value_take_string (value, g_strdup_format ("%2d", vint));
break;
case COL_SYNTH:
snet = 0;
@@ -144,15 +144,15 @@ track_view_fill_value (BstItemView *iview,
break;
case COL_MIDI_CHANNEL:
bse_proxy_get (item, "midi-channel", &vint, NULL);
- sfi_value_take_string (value, g_strdup_printf ("%2d", vint));
+ sfi_value_take_string (value, g_strdup_format ("%2d", vint));
break;
case COL_OUTPUTS:
bse_proxy_get (item, "outputs", &seq, NULL);
iseq = bse_item_seq_from_seq (seq);
if (iseq && iseq->n_items == 1)
- g_value_take_string (value, g_strdup_printf ("%s", bse_item_get_name_or_type (iseq->items[0])));
+ g_value_take_string (value, g_strdup_format ("%s", bse_item_get_name_or_type (iseq->items[0])));
else if (iseq && iseq->n_items > 1)
- g_value_take_string (value, g_strdup_printf ("#%u", iseq ? iseq->n_items : 0));
+ g_value_take_string (value, g_strdup_format ("#%u", iseq ? iseq->n_items : 0));
else
g_value_set_string (value, "");
bse_item_seq_free (iseq);
@@ -715,7 +715,7 @@ track_view_action_exec (gpointer data,
item = bse_song_create_track (song);
if (item)
{
- gchar *string = g_strdup_printf ("Track-%02X", bse_item_get_seqid (item));
+ gchar *string = g_strdup_format ("Track-%02X", bse_item_get_seqid (item));
bse_item_set_name (item, string);
g_free (string);
bst_item_view_select (item_view, item);
diff --git a/beast-gtk/bsttreestores.cc b/beast-gtk/bsttreestores.cc
index a02f7e2..e832b23 100644
--- a/beast-gtk/bsttreestores.cc
+++ b/beast-gtk/bsttreestores.cc
@@ -433,7 +433,7 @@ child_list_wrapper_fill_value (GxkListWrapper *self,
const gchar *string;
SfiProxy item;
case BST_PROXY_STORE_SEQID:
- g_value_set_string_take_ownership (value, g_strdup_printf ("%03u", seqid));
+ g_value_set_string_take_ownership (value, g_strdup_format ("%03u", seqid));
break;
case BST_PROXY_STORE_NAME:
item = bst_child_list_wrapper_get_proxy (self, row);
@@ -480,7 +480,7 @@ item_seq_store_fill_value (GxkListWrapper *self,
SfiProxy item;
case BST_PROXY_STORE_SEQID:
item = bst_item_seq_store_get_proxy (model, row);
- g_value_set_string_take_ownership (value, g_strdup_printf ("%03u", bse_item_get_seqid (item)));
+ g_value_set_string_take_ownership (value, g_strdup_format ("%03u", bse_item_get_seqid (item)));
break;
case BST_PROXY_STORE_NAME:
item = bst_item_seq_store_get_proxy (model, row);
diff --git a/beast-gtk/bstusermessage.cc b/beast-gtk/bstusermessage.cc
index d80ab26..eeb7027 100644
--- a/beast-gtk/bstusermessage.cc
+++ b/beast-gtk/bstusermessage.cc
@@ -122,12 +122,12 @@ strdup_msg_hashkey (const BstMessage *msg)
{
/* prefer hashing by janitor/process name over PID */
if (msg->janitor)
- return g_strdup_printf ("## %x ## %s ## %s ## J%s:%s", msg->type, msg->primary, msg->secondary,
+ return g_strdup_format ("## %x ## %s ## %s ## J%s:%s", msg->type, msg->primary, msg->secondary,
bse_janitor_get_script_name (msg->janitor), bse_janitor_get_proc_name
(msg->janitor));
else if (msg->process)
- return g_strdup_printf ("## %x ## %s ## %s ## P%s", msg->type, msg->primary, msg->secondary,
msg->process);
+ return g_strdup_format ("## %x ## %s ## %s ## P%s", msg->type, msg->primary, msg->secondary,
msg->process);
else
- return g_strdup_printf ("## %x ## %s ## %s ## N%x", msg->type, msg->primary, msg->secondary, msg->pid);
+ return g_strdup_format ("## %x ## %s ## %s ## N%x", msg->type, msg->primary, msg->secondary, msg->pid);
}
static void
@@ -356,7 +356,7 @@ repeat_dialog (GxkDialog *dialog)
if (label)
{
gint count = g_object_get_int (dialog, "BEAST-user-message-count");
- gchar *rstr = g_strdup_printf (dngettext (BEAST_GETTEXT_DOMAIN, _("Message has been repeated %u
time"), _("Message has been repeated %u times"), count), count);
+ gchar *rstr = g_strdup_format (dngettext (BEAST_GETTEXT_DOMAIN, _("Message has been repeated %u
time"), _("Message has been repeated %u times"), count), count);
g_object_set_int (dialog, "BEAST-user-message-count", count + 1);
gtk_label_set_text (label, rstr);
g_free (rstr);
@@ -500,11 +500,11 @@ message_fill_from_script (BstMessage *msg,
else
{
gchar *script_base = g_path_get_basename (script_name);
- msg->secondary = g_strdup_printf (_("Executing procedure '%s' from script '%s'."), proc_name,
script_base);
+ msg->secondary = g_strdup_format (_("Executing procedure '%s' from script '%s'."), proc_name,
script_base);
g_free (script_base);
}
if (!janitor && hastext (proc_name))
- msg->details = g_strdup_printf (_("Procedure: %s\nScript: %s\n"), proc_name, script_name);
+ msg->details = g_strdup_format (_("Procedure: %s\nScript: %s\n"), proc_name, script_name);
else
msg->details = NULL;
msg->config_check = NULL;
@@ -548,7 +548,7 @@ janitor_progress (GxkDialog *dialog,
SfiProxy janitor = (SfiProxy) g_object_get_data (G_OBJECT (dialog), "user-data");
const gchar *script = bse_janitor_get_script_name (janitor);
const gchar *sbname = strrchr (script, '/');
- gchar *exec_name = g_strdup_printf ("%s", sbname ? sbname + 1 : script);
+ gchar *exec_name = g_strdup_format ("%s", sbname ? sbname + 1 : script);
// bse_janitor_get_proc_name (janitor);
gxk_status_window_push (dialog);
if (progress < 0)
@@ -577,7 +577,7 @@ janitor_unconnected (GxkDialog *dialog)
if (exit_reason)
{
BstMessage msg = { 0, };
- gchar *error_msg = g_strdup_printf (_("An error occoured during execution of script procedure
'%s': %s"), proc_name, exit_reason);
+ gchar *error_msg = g_strdup_format (_("An error occoured during execution of script procedure
'%s': %s"), proc_name, exit_reason);
message_fill_from_script (&msg, BST_MSG_ERROR, 0, _("Script execution error."), script_name,
proc_name, error_msg);
g_free (error_msg);
bst_message_handler (&msg);
@@ -740,7 +740,7 @@ server_script_error (SfiProxy server,
{
/* this signal is emitted (without janitor) when script execution failed */
BstMessage msg = { 0, };
- gchar *error_msg = g_strdup_printf (_("Failed to execute script procedure '%s': %s"), proc_name, reason);
+ gchar *error_msg = g_strdup_format (_("Failed to execute script procedure '%s': %s"), proc_name, reason);
message_fill_from_script (&msg, BST_MSG_ERROR, 0, _("Script execution error."), script_name, proc_name,
error_msg);
g_free (error_msg);
bst_message_handler (&msg);
diff --git a/beast-gtk/bstutils.cc b/beast-gtk/bstutils.cc
index 7f4a086..17b8898 100644
--- a/beast-gtk/bstutils.cc
+++ b/beast-gtk/bstutils.cc
@@ -1025,7 +1025,7 @@ bst_gmask_pack (BstGMask *mask)
/* ensure expansion happens outside of columns */
if (dislodge_columns)
{
- gchar *dummy_name = g_strdup_printf ("GMask-dummy-dislodge-%u", MAX (gmask->column, 1) - 1);
+ gchar *dummy_name = g_strdup_format ("GMask-dummy-dislodge-%u", MAX (gmask->column, 1) - 1);
GtkWidget *dislodge = (GtkWidget*) g_object_get_data (G_OBJECT (table), dummy_name);
if (!dislodge)
@@ -1056,7 +1056,7 @@ bst_gmask_pack (BstGMask *mask)
c++;
if (!aux2 && !dislodge_columns)
{
- char *dummy_name = g_strdup_printf ("GMask-dummy-aux2-%u", gmask->column);
+ char *dummy_name = g_strdup_format ("GMask-dummy-aux2-%u", gmask->column);
aux2 = (GtkWidget*) g_object_get_data (G_OBJECT (table), dummy_name);
/* need to have at least 1 (dummy) aux2-child per table column to eat up
diff --git a/beast-gtk/bstwaveeditor.cc b/beast-gtk/bstwaveeditor.cc
index a181637..a4a5e80 100644
--- a/beast-gtk/bstwaveeditor.cc
+++ b/beast-gtk/bstwaveeditor.cc
@@ -668,13 +668,13 @@ wave_chunk_fill_value (BstWaveEditor *self,
{
const gchar *string;
case COL_OSC_FREQ:
- g_value_set_string_take_ownership (value, g_strdup_printf ("%.2f", bse_wave_chunk_get_osc_freq (wave,
cidx)));
+ g_value_set_string_take_ownership (value, g_strdup_format ("%.2f", bse_wave_chunk_get_osc_freq (wave,
cidx)));
break;
case COL_MIX_FREQ:
- g_value_set_string_take_ownership (value, g_strdup_printf ("%.2f", bse_wave_chunk_get_mix_freq (wave,
cidx)));
+ g_value_set_string_take_ownership (value, g_strdup_format ("%.2f", bse_wave_chunk_get_mix_freq (wave,
cidx)));
break;
case COL_LOOP:
- g_value_set_string_take_ownership (value, g_strdup_printf ("L:%u {0x%08x,0x%08x}", 0, 0, 0));
+ g_value_set_string_take_ownership (value, g_strdup_format ("L:%u {0x%08x,0x%08x}", 0, 0, 0));
break;
case COL_WAVE_NAME:
bse_proxy_get (wave, "wave-name", &string, NULL);
diff --git a/beast-gtk/gxk/gxkparam.cc b/beast-gtk/gxk/gxkparam.cc
index 0bead69..af549fd 100644
--- a/beast-gtk/gxk/gxkparam.cc
+++ b/beast-gtk/gxk/gxkparam.cc
@@ -269,9 +269,9 @@ gxk_param_dup_tooltip (GxkParam *param)
if (!_param_devel_tips)
tooltip = g_strdup (ctip);
else if (ctip)
- tooltip = g_strdup_printf ("(%s): %s", g_param_spec_get_name (param->pspec), ctip);
+ tooltip = g_strdup_format ("(%s): %s", g_param_spec_get_name (param->pspec), ctip);
else
- tooltip = g_strdup_printf ("(%s)", g_param_spec_get_name (param->pspec));
+ tooltip = g_strdup_format ("(%s)", g_param_spec_get_name (param->pspec));
return tooltip;
}
diff --git a/beast-gtk/gxk/gxkradget.cc b/beast-gtk/gxk/gxkradget.cc
index e12b138..42240d1 100644
--- a/beast-gtk/gxk/gxkradget.cc
+++ b/beast-gtk/gxk/gxkradget.cc
@@ -986,7 +986,7 @@ toplevel_get_size_group (GtkWidget *toplevel,
const gchar *name,
gchar type)
{
- gchar *key = g_strdup_printf ("gxk-toplevel-%cgroup#%s", type, name);
+ gchar *key = g_strdup_format ("gxk-toplevel-%cgroup#%s", type, name);
GtkSizeGroup *sg = (GtkSizeGroup*) g_object_get_data ((GObject*) toplevel, key);
if (!sg)
{
@@ -2319,7 +2319,7 @@ mf_floatcollect (GSList *args,
}
if (strcmp (name, "avg") == 0 && n)
accu /= n;
- return g_strdup_printf ("%.17g", accu);
+ return g_strdup_format ("%.17g", accu);
}
static gchar*
diff --git a/beast-gtk/gxk/gxkradgetfactory.cc b/beast-gtk/gxk/gxkradgetfactory.cc
index 59f5093..374f411 100644
--- a/beast-gtk/gxk/gxkradgetfactory.cc
+++ b/beast-gtk/gxk/gxkradgetfactory.cc
@@ -248,7 +248,7 @@ radget_factory_action_list_added (gpointer client_data,
{
const gchar *domain = gxk_radget_get_domain (self);
const gchar *wname = GTK_WIDGET (self->window)->name;
- gchar *path_prefix = wname ? g_strdup_printf ("<%s>/%s/", wname, prefix) : NULL;
+ gchar *path_prefix = wname ? g_strdup_format ("<%s>/%s/", wname, prefix) : NULL;
GSList *slist;
guint i;
if (self->per_list)
diff --git a/beast-gtk/gxk/gxktexttools.cc b/beast-gtk/gxk/gxktexttools.cc
index 7261ed4..809044f 100644
--- a/beast-gtk/gxk/gxktexttools.cc
+++ b/beast-gtk/gxk/gxktexttools.cc
@@ -81,7 +81,7 @@ text_buffer_add_error (GtkTextBuffer *tbuffer,
va_start (args, format);
text = g_strdup_vprintf (format, args);
va_end (args);
- string = g_strdup_printf ("\n%s\n", text);
+ string = g_strdup_format ("\n%s\n", text);
g_free (text);
gtk_text_buffer_insert_with_tags (tbuffer, &iter, string, strlen (string), tag, NULL);
g_free (string);
@@ -524,7 +524,7 @@ tsm_start_element (GMarkupParseContext *context,
if (attribute_names[i])
{
const gchar *errtname = attribute_values[i];
- gchar *tname = g_strdup_printf ("%u-%s", md->tagns, attribute_values[i]);
+ gchar *tname = g_strdup_format ("%u-%s", md->tagns, attribute_values[i]);
text_buffer_tagdef (md->tbuffer, tname, NULL, NULL);
for (i = 0; attribute_names[i]; i++)
if (strcmp (attribute_names[i], "name") != 0 &&
@@ -702,7 +702,7 @@ tsm_end_element (GMarkupParseContext *context,
if (ml->tag_name)
{
GtkTextTagTable *ttable = gtk_text_buffer_get_tag_table (md->tbuffer);
- gchar *tname = g_strdup_printf ("%u-%s", md->tagns, ml->tag_name);
+ gchar *tname = g_strdup_format ("%u-%s", md->tagns, ml->tag_name);
GtkTextTag *tag = gtk_text_tag_table_lookup (ttable, tname);
g_free (tname);
if (tag)
@@ -887,7 +887,7 @@ gxk_text_buffer_insert (GtkTextBuffer *tbuffer,
/* ensure certain icon sizes */
for (n = 0; n < n_icon_sizes; n++)
{
- name = g_strdup_printf ("%ux%u", icon_square_sizes[n], icon_square_sizes[n]);
+ name = g_strdup_format ("%ux%u", icon_square_sizes[n], icon_square_sizes[n]);
if (gtk_icon_size_from_name (name) == GTK_ICON_SIZE_INVALID)
gtk_icon_size_register (name, icon_square_sizes[n], icon_square_sizes[n]);
@@ -928,7 +928,7 @@ gxk_text_buffer_insert (GtkTextBuffer *tbuffer,
g_object_unref (md.style);
}
- name = g_strdup_printf ("gxk-text-tools-indent-%u", indent);
+ name = g_strdup_format ("gxk-text-tools-indent-%u", indent);
tag = gtk_text_tag_table_lookup (ttable, name);
if (!tag)
{
diff --git a/bse/bseautodoc.cc b/bse/bseautodoc.cc
index 77165df..874a4a4 100644
--- a/bse/bseautodoc.cc
+++ b/bse/bseautodoc.cc
@@ -17,9 +17,9 @@ beauty_float (gdouble f)
{
gchar *s;
if (ABS (f) <= 18446744073709551616.)
- s = g_strdup_printf ("%.7f", f);
+ s = g_strdup_format ("%.7f", f);
else
- s = g_strdup_printf ("%.7g", f);
+ s = g_strdup_format ("%.7g", f);
const gchar *c;
if (strchr (s, '.'))
{
@@ -93,14 +93,14 @@ type_name (GParamSpec *pspec)
case SFI_SCAT_SEQ:
btag = lookup_boxed_tag (sfi_pspec_get_seq_element (pspec));
if (btag)
- return g_strdup_printf ("%s*", btag);
+ return g_strdup_format ("%s*", btag);
else
return g_strdup ("SfiSeq*");
case SFI_SCAT_REC:
rfields = sfi_pspec_get_rec_fields (pspec);
btag = rfields.n_fields ? lookup_boxed_tag (rfields.fields[0]) : NULL;
if (btag)
- return g_strdup_printf ("%s*", btag);
+ return g_strdup_format ("%s*", btag);
else
return g_strdup ("SfiRec*");
case SFI_SCAT_PROXY: return g_strdup ("SfiProxy");
diff --git a/bse/bseconstant.cc b/bse/bseconstant.cc
index 214c048..262b39d 100644
--- a/bse/bseconstant.cc
+++ b/bse/bseconstant.cc
@@ -87,18 +87,18 @@ bse_constant_class_init (BseConstantClass *klass)
for (i = 1; i <= BSE_CONSTANT_N_OUTPUTS; i++)
{
- gchar *ident, *label, *blurb, *group = g_strdup_printf (_("Constant Output %u"), i);
+ gchar *ident, *label, *blurb, *group = g_strdup_format (_("Constant Output %u"), i);
- ident = g_strdup_printf ("value_%u", i);
- label = g_strdup_printf ("%s", _("Value [float]"));
+ ident = g_strdup_format ("value_%u", i);
+ label = g_strdup_format ("%s", _("Value [float]"));
bse_object_class_add_param (object_class, group, PARAM_VALUE + (i - 1) * 3,
sfi_pspec_real (ident, label, _("Constant signal value"),
1.0, -1.0, 1.0, 0.01,
SFI_PARAM_STANDARD ":dial"));
g_free (ident);
g_free (label);
- ident = g_strdup_printf ("frequency_%u", i);
- label = g_strdup_printf ("%s", _("Frequency"));
+ ident = g_strdup_format ("frequency_%u", i);
+ label = g_strdup_format ("%s", _("Frequency"));
bse_object_class_add_param (object_class, group, PARAM_FREQ + (i - 1) * 3,
sfi_pspec_log_scale (ident, label, _("Constant signal value interpreted as
frequency value in Hertz"),
BSE_MAX_FREQUENCY,
@@ -108,17 +108,17 @@ bse_constant_class_init (BseConstantClass *klass)
SFI_PARAM_GUI ":dial"));
g_free (ident);
g_free (label);
- ident = g_strdup_printf ("note_%u", i);
- label = g_strdup_printf ("%s", _("Note"));
+ ident = g_strdup_format ("note_%u", i);
+ label = g_strdup_format ("%s", _("Note"));
bse_object_class_add_param (object_class, group, PARAM_NOTE + (i - 1) * 3,
sfi_pspec_note (ident, label, _("Constant signal value as note, converted
to Hertz according to the current musical tuning"),
SFI_KAMMER_NOTE, SFI_MIN_NOTE, SFI_MAX_NOTE,
TRUE, SFI_PARAM_GUI));
g_free (ident);
g_free (label);
- ident = g_strdup_printf ("const-out%u", i);
- label = g_strdup_printf (_("Const Out%u"), i);
- blurb = g_strdup_printf (_("Constant Output %u"), i);
+ ident = g_strdup_format ("const-out%u", i);
+ label = g_strdup_format (_("Const Out%u"), i);
+ blurb = g_strdup_format (_("Constant Output %u"), i);
ochannel = bse_source_class_add_ochannel (source_class, ident, label, blurb);
g_assert (ochannel == i - 1);
g_free (ident);
@@ -158,20 +158,20 @@ bse_constant_set_property (GObject *object,
case PARAM_VALUE - PARAM_VALUE:
self->constants[n] = sfi_value_get_real (value);
bse_constant_update_modules (self, NULL);
- prop = g_strdup_printf ("frequency_%u", n + 1);
+ prop = g_strdup_format ("frequency_%u", n + 1);
g_object_notify (object, prop);
g_free (prop);
- prop = g_strdup_printf ("note_%u", n + 1);
+ prop = g_strdup_format ("note_%u", n + 1);
g_object_notify (object, prop);
g_free (prop);
break;
case PARAM_FREQ - PARAM_VALUE:
self->constants[n] = BSE_VALUE_FROM_FREQ (sfi_value_get_real (value));
bse_constant_update_modules (self, NULL);
- prop = g_strdup_printf ("value_%u", n + 1);
+ prop = g_strdup_format ("value_%u", n + 1);
g_object_notify (object, prop);
g_free (prop);
- prop = g_strdup_printf ("note_%u", n + 1);
+ prop = g_strdup_format ("note_%u", n + 1);
g_object_notify (object, prop);
g_free (prop);
break;
@@ -181,10 +181,10 @@ bse_constant_set_property (GObject *object,
{
self->constants[n] = BSE_VALUE_FROM_FREQ (bse_note_to_freq (bse_item_current_musical_tuning
(BSE_ITEM (self)), note));
bse_constant_update_modules (self, NULL);
- prop = g_strdup_printf ("value_%u", n + 1);
+ prop = g_strdup_format ("value_%u", n + 1);
g_object_notify (object, prop);
g_free (prop);
- prop = g_strdup_printf ("frequency_%u", n + 1);
+ prop = g_strdup_format ("frequency_%u", n + 1);
g_object_notify (object, prop);
g_free (prop);
}
diff --git a/bse/bsecontextmerger.cc b/bse/bsecontextmerger.cc
index 837e00a..0969f21 100644
--- a/bse/bsecontextmerger.cc
+++ b/bse/bsecontextmerger.cc
@@ -60,12 +60,12 @@ bse_context_merger_class_init (BseContextMergerClass *klass)
{
char *ident;
- ident = g_strdup_printf ("input-%u", i + 1);
+ ident = g_strdup_format ("input-%u", i + 1);
channel_id = bse_source_class_add_jchannel (source_class, ident, NULL, NULL);
g_assert (channel_id == i);
g_free (ident);
- ident = g_strdup_printf ("output-%u", i + 1);
+ ident = g_strdup_format ("output-%u", i + 1);
channel_id = bse_source_class_add_ochannel (source_class, ident, NULL, NULL);
g_assert (channel_id == i);
g_free (ident);
diff --git a/bse/bsedevice.cc b/bse/bsedevice.cc
index fa90d61..5098962 100644
--- a/bse/bsedevice.cc
+++ b/bse/bsedevice.cc
@@ -19,7 +19,7 @@ bse_device_list (BseDevice *self)
if (BSE_DEVICE_GET_CLASS (self)->list_devices)
ring = BSE_DEVICE_GET_CLASS (self)->list_devices (self);
if (!ring)
- ring = sfi_ring_append (ring, bse_device_error_new (self, g_strdup_printf ("Driver not implemented")));
+ ring = sfi_ring_append (ring, bse_device_error_new (self, g_strdup_format ("Driver not implemented")));
return ring;
}
diff --git a/bse/bseengine.cc b/bse/bseengine.cc
index e59e4e7..1cf33b7 100644
--- a/bse/bseengine.cc
+++ b/bse/bseengine.cc
@@ -1184,7 +1184,7 @@ slave (gpointer data)
while (run)
{
BseTrans *trans = bse_trans_open ();
- gchar *str = g_strdup_printf ("SLAVE(%p): idle", g_thread_self ());
+ gchar *str = g_strdup_format ("SLAVE(%p): idle", g_thread_self ());
bse_trans_add (trans, bse_job_debug (str));
g_free (str);
bse_trans_add (trans, bse_job_debug ("string2"));
diff --git a/bse/bseglue.cc b/bse/bseglue.cc
index d640f5b..568699a 100644
--- a/bse/bseglue.cc
+++ b/bse/bseglue.cc
@@ -551,7 +551,7 @@ bglue_list_method_names (SfiGlueContext *context,
if (!g_type_is_a (type, BSE_TYPE_ITEM))
return NULL;
- prefix = g_strdup_printf ("%s+", g_type_name (type));
+ prefix = g_strdup_format ("%s+", g_type_name (type));
l = strlen (prefix);
cseq = bse_categories_match_typed ("/Methods/" "*", BSE_TYPE_PROCEDURE);
diff --git a/bse/bseinstrumentinput.cc b/bse/bseinstrumentinput.cc
index 7cd37c9..5b85440 100644
--- a/bse/bseinstrumentinput.cc
+++ b/bse/bseinstrumentinput.cc
@@ -107,7 +107,7 @@ bse_instrument_input_class_init (BseInstrumentInputClass *klass)
/* override parent properties with NOP properties */
for (i = 0; i < BSE_SUB_IPORT_N_PORTS; i++)
{
- char *string = g_strdup_printf ("in_port_%u", i + 1);
+ char *string = g_strdup_format ("in_port_%u", i + 1);
bse_object_class_add_param (object_class, NULL, PROP_IPORT_NAME + i * 2,
sfi_pspec_string (string, NULL, NULL, NULL,
/* override parent property: 0 */ "r"));
diff --git a/bse/bseinstrumentoutput.cc b/bse/bseinstrumentoutput.cc
index b9eef47..b941bf8 100644
--- a/bse/bseinstrumentoutput.cc
+++ b/bse/bseinstrumentoutput.cc
@@ -107,7 +107,7 @@ bse_instrument_output_class_init (BseInstrumentOutputClass *klass)
/* override parent properties with NOP properties */
for (i = 0; i < BSE_SUB_OPORT_N_PORTS; i++)
{
- char *string = g_strdup_printf ("out_port_%u", i + 1);
+ char *string = g_strdup_format ("out_port_%u", i + 1);
bse_object_class_add_param (object_class, NULL, PROP_OPORT_NAME + i * 2,
sfi_pspec_string (string, NULL, NULL, NULL,
/* override parent property: 0 */ "r"));
diff --git a/bse/bsejanitor.cc b/bse/bsejanitor.cc
index 8a41bf0..af58c69 100644
--- a/bse/bsejanitor.cc
+++ b/bse/bsejanitor.cc
@@ -517,18 +517,18 @@ janitor_idle_clean_jsource (void *data)
{
self->exit_code = 256; /* exit code used for signals */
if (port->exit_signal_sent && port->sigkill_sent)
- self->exit_reason = g_strdup_printf ("%s", _("killed by janitor"));
+ self->exit_reason = g_strdup_format ("%s", _("killed by janitor"));
else if (port->exit_signal_sent && port->sigterm_sent)
- self->exit_reason = g_strdup_printf ("%s", _("connection terminated"));
+ self->exit_reason = g_strdup_format ("%s", _("connection terminated"));
else if (port->exit_signal && port->dumped_core)
- self->exit_reason = g_strdup_printf (_("%s (core dumped)"), g_strsignal (port->exit_signal));
+ self->exit_reason = g_strdup_format (_("%s (core dumped)"), g_strsignal (port->exit_signal));
else if (port->exit_signal)
- self->exit_reason = g_strdup_printf ("%s", g_strsignal (port->exit_signal));
+ self->exit_reason = g_strdup_format ("%s", g_strsignal (port->exit_signal));
else
{
self->exit_code = port->exit_code;
if (port->exit_code || self->force_kill)
- self->exit_reason = g_strdup_printf ("Exit status (%d)", port->exit_code);
+ self->exit_reason = g_strdup_format ("Exit status (%d)", port->exit_code);
else
self->exit_reason = NULL; /* all OK */
}
@@ -545,7 +545,7 @@ janitor_idle_clean_jsource (void *data)
{
/* not a janitor for a remote process */
self->exit_code = -256;
- self->exit_reason = g_strdup_printf ("%s", "unknown intern termination");
+ self->exit_reason = g_strdup_format ("%s", "unknown intern termination");
}
sfi_com_port_unref (port);
self->port = NULL;
diff --git a/bse/bseladspa.cc b/bse/bseladspa.cc
index dc5309b..a2552df 100644
--- a/bse/bseladspa.cc
+++ b/bse/bseladspa.cc
@@ -300,13 +300,13 @@ bse_ladspa_info_add_port (BseLadspaInfo *bli,
port->input = is_input;
port->output = is_output;
if (port->audio_channel && port->input)
- port->ident = g_strdup_printf ("audio-in-%u", pcounter->audio_input++);
+ port->ident = g_strdup_format ("audio-in-%u", pcounter->audio_input++);
else if (port->audio_channel) /* port->output */
- port->ident = g_strdup_printf ("audio-out-%u", pcounter->audio_output++);
+ port->ident = g_strdup_format ("audio-out-%u", pcounter->audio_output++);
else if (port->input) /* !port->audio_channel */
- port->ident = g_strdup_printf ("icontrol-%u", pcounter->control_input++);
+ port->ident = g_strdup_format ("icontrol-%u", pcounter->control_input++);
else /* port->output && !port->audio_channel */
- port->ident = g_strdup_printf ("ocontrol-%u", pcounter->control_output++);
+ port->ident = g_strdup_format ("ocontrol-%u", pcounter->control_output++);
port->minimum = G_MINFLOAT;
port->default_value = 0;
port->maximum = G_MAXFLOAT;
@@ -420,7 +420,7 @@ bse_ladspa_info_port_2str (BseLadspaPort *port)
strcat (flags, "L");
if (port->concert_a)
strcat (flags, "A");
- return g_strdup_printf ("( %s, %f<=%f<=%f, %s )",
+ return g_strdup_format ("( %s, %f<=%f<=%f, %s )",
port->ident,
port->minimum, port->default_value, port->maximum,
flags);
@@ -450,7 +450,7 @@ bse_ladspa_info_assemble (const gchar *file_path,
goto bail_broken;
}
else
- bli->ident = g_strdup_printf ("%s#%s", file_path, cld->Label);
+ bli->ident = g_strdup_format ("%s#%s", file_path, cld->Label);
bli->name = cld->Name ? cld->Name : bli->ident;
if (!cld->Maker)
LDEBUG ("%s: plugin with 'Maker' field of NULL", bli->ident);
diff --git a/bse/bseloader-bsewave.cc b/bse/bseloader-bsewave.cc
index 80a6397..b83c42c 100644
--- a/bse/bseloader-bsewave.cc
+++ b/bse/bseloader-bsewave.cc
@@ -152,7 +152,7 @@ bsewave_load_file_info (void *data,
else
{
cwd = g_get_current_dir ();
- file_name = g_strdup_printf ("%s%c%s", cwd, G_DIR_SEPARATOR, _file_name);
+ file_name = g_strdup_format ("%s%c%s", cwd, G_DIR_SEPARATOR, _file_name);
}
fd = open (file_name, O_RDONLY);
@@ -716,7 +716,7 @@ bsewave_create_chunk_handle (void *data,
if (g_path_is_absolute ((char*) LOADER_FILE (chunk)))
string = g_strdup ((char*) LOADER_FILE (chunk));
else
- string = g_strdup_printf ("%s%c%s", fi->cwd, G_DIR_SEPARATOR, (char*) LOADER_FILE (chunk));
+ string = g_strdup_format ("%s%c%s", fi->cwd, G_DIR_SEPARATOR, (char*) LOADER_FILE (chunk));
/* try to load the chunk via registered loaders */
BseWaveFileInfo *cfi = bse_wave_file_info_load (string, error_p);
if (cfi)
@@ -749,7 +749,7 @@ bsewave_create_chunk_handle (void *data,
if (g_path_is_absolute ((char*) LOADER_FILE (chunk)))
string = g_strdup ((char*) LOADER_FILE (chunk));
else
- string = g_strdup_printf ("%s%c%s", fi->cwd, G_DIR_SEPARATOR, (char*) LOADER_FILE (chunk));
+ string = g_strdup_format ("%s%c%s", fi->cwd, G_DIR_SEPARATOR, (char*) LOADER_FILE (chunk));
/* try to load a raw sample */
dhandle = gsl_wave_handle_new (string, /* file name */
dsc->wdsc.n_channels,
diff --git a/bse/bseloader-guspatch.cc b/bse/bseloader-guspatch.cc
index 656a191..2d3108e 100644
--- a/bse/bseloader-guspatch.cc
+++ b/bse/bseloader-guspatch.cc
@@ -354,7 +354,7 @@ struct FileInfo
string
envelope_point_to_string (guint value)
{
- gchar *tmp_str = g_strdup_printf ("%u", value);
+ gchar *tmp_str = g_strdup_format ("%u", value);
string str = tmp_str;
g_free (tmp_str);
return str;
diff --git a/bse/bseloader-oggvorbis.cc b/bse/bseloader-oggvorbis.cc
index 0a49a94..464e8a5 100644
--- a/bse/bseloader-oggvorbis.cc
+++ b/bse/bseloader-oggvorbis.cc
@@ -58,7 +58,7 @@ oggv_load_file_info (void *data,
if (n < vc->comments)
fi->wfi.waves[i].name = g_strdup (vc->user_comments[n] + 6);
else
- fi->wfi.waves[i].name = g_strdup_printf ("Unnamed-%u", i);
+ fi->wfi.waves[i].name = g_strdup_format ("Unnamed-%u", i);
}
return &fi->wfi;
diff --git a/bse/bsemididevice-null.cc b/bse/bsemididevice-null.cc
index bbe739e..cebd5d1 100644
--- a/bse/bsemididevice-null.cc
+++ b/bse/bsemididevice-null.cc
@@ -19,7 +19,7 @@ static SfiRing*
bse_midi_device_null_list_devices (BseDevice *device)
{
SfiRing *ring = NULL;
- ring = sfi_ring_append (ring, bse_device_entry_new (device, g_strdup_printf ("default"), NULL));
+ ring = sfi_ring_append (ring, bse_device_entry_new (device, g_strdup_format ("default"), NULL));
return ring;
}
diff --git a/bse/bsemididevice-oss.cc b/bse/bsemididevice-oss.cc
index 6247166..c026a75 100644
--- a/bse/bsemididevice-oss.cc
+++ b/bse/bsemididevice-oss.cc
@@ -80,25 +80,25 @@ bse_midi_device_oss_list_devices (BseDevice *device)
if (check_device_usage (dname, "crw") == BSE_ERROR_NONE)
ring = sfi_ring_append (ring,
bse_device_entry_new (device,
- g_strdup_printf ("%s,rw", dname),
- g_strdup_printf ("%s (read-write)", dname)));
+ g_strdup_format ("%s,rw", dname),
+ g_strdup_format ("%s (read-write)", dname)));
else if (check_device_usage (dname, "cr") == BSE_ERROR_NONE)
ring = sfi_ring_append (ring,
bse_device_entry_new (device,
- g_strdup_printf ("%s,ro", dname),
- g_strdup_printf ("%s (read only)", dname)));
+ g_strdup_format ("%s,ro", dname),
+ g_strdup_format ("%s (read only)", dname)));
else if (check_device_usage (dname, "cw") == BSE_ERROR_NONE)
ring = sfi_ring_append (ring,
bse_device_entry_new (device,
- g_strdup_printf ("%s,wo", dname),
- g_strdup_printf ("%s (write only)", dname)));
+ g_strdup_format ("%s,wo", dname),
+ g_strdup_format ("%s (write only)", dname)));
}
g_free (last);
last = dname;
}
g_free (last);
if (!ring)
- ring = sfi_ring_append (ring, bse_device_error_new (device, g_strdup_printf ("No devices found")));
+ ring = sfi_ring_append (ring, bse_device_error_new (device, g_strdup_format ("No devices found")));
return ring;
}
diff --git a/bse/bseobject.cc b/bse/bseobject.cc
index 13a2402..274fbe1 100644
--- a/bse/bseobject.cc
+++ b/bse/bseobject.cc
@@ -85,7 +85,7 @@ bse_object_strdup_debug_handle (gpointer object)
if (!g_type_is_a (instance->g_class->g_type, G_TYPE_OBJECT))
return g_strdup ("<Non-GObject>");
/* we may not access GObject.data (includes BSE_OBJECT_UNAME()) */
- return g_strdup_printf ("%s(%p)\"", G_OBJECT_TYPE_NAME (instance), object);
+ return g_strdup_format ("%s(%p)\"", G_OBJECT_TYPE_NAME (instance), object);
}
const gchar*
@@ -104,7 +104,7 @@ bse_object_debug_name (gpointer object)
if (!debug_name)
{
const gchar *uname = BSE_OBJECT_UNAME (instance);
- debug_name = g_strdup_printf ("\"%s::%s\"", G_OBJECT_TYPE_NAME (instance), uname ? uname : "");
+ debug_name = g_strdup_format ("\"%s::%s\"", G_OBJECT_TYPE_NAME (instance), uname ? uname : "");
g_object_set_data_full (G_OBJECT (instance), "bse-debug-name", debug_name, g_free);
}
return debug_name;
diff --git a/bse/bseparasite.cc b/bse/bseparasite.cc
index 43a613d..620ae56 100644
--- a/bse/bseparasite.cc
+++ b/bse/bseparasite.cc
@@ -401,7 +401,7 @@ bse_item_create_parasite_name (BseItem *item,
{
Node key = { 0, };
guint counter = 1;
- gchar *path = g_strdup_printf ("%sAuto-%02x", path_prefix, counter++);
+ gchar *path = g_strdup_format ("%sAuto-%02x", path_prefix, counter++);
/* ensure parasite intiialization */
if (!item->parasite)
parasite_init (item);
@@ -410,7 +410,7 @@ bse_item_create_parasite_name (BseItem *item,
while (g_bsearch_array_lookup (item->parasite->nodes, &bconfig_nodes, &key))
{
g_free (path);
- path = g_strdup_printf ("%sAuto-%02x", path_prefix, counter++);
+ path = g_strdup_format ("%sAuto-%02x", path_prefix, counter++);
key.path = path;
}
key.path = g_intern_string (path);
diff --git a/bse/bsepcmdevice-null.cc b/bse/bsepcmdevice-null.cc
index c7da40e..3364326 100644
--- a/bse/bsepcmdevice-null.cc
+++ b/bse/bsepcmdevice-null.cc
@@ -32,7 +32,7 @@ static SfiRing*
bse_pcm_device_null_list_devices (BseDevice *device)
{
SfiRing *ring = NULL;
- ring = sfi_ring_append (ring, bse_device_entry_new (device, g_strdup_printf ("default"), NULL));
+ ring = sfi_ring_append (ring, bse_device_entry_new (device, g_strdup_format ("default"), NULL));
return ring;
}
diff --git a/bse/bsepcmdevice-oss.cc b/bse/bsepcmdevice-oss.cc
index 976e1ac..154e0d6 100644
--- a/bse/bsepcmdevice-oss.cc
+++ b/bse/bsepcmdevice-oss.cc
@@ -110,20 +110,20 @@ bse_pcm_device_oss_list_devices (BseDevice *device)
if (check_device_usage (dname, "crw") == BSE_ERROR_NONE)
ring = sfi_ring_append (ring,
bse_device_entry_new (device,
- g_strdup_printf ("%s,rw", dname),
- g_strdup_printf ("%s (read-write)", dname)));
+ g_strdup_format ("%s,rw", dname),
+ g_strdup_format ("%s (read-write)", dname)));
else if (check_device_usage (dname, "cw") == BSE_ERROR_NONE)
ring = sfi_ring_append (ring,
bse_device_entry_new (device,
- g_strdup_printf ("%s,wo", dname),
- g_strdup_printf ("%s (write only)", dname)));
+ g_strdup_format ("%s,wo", dname),
+ g_strdup_format ("%s (write only)", dname)));
}
g_free (last);
last = dname;
}
g_free (last);
if (!ring)
- ring = sfi_ring_append (ring, bse_device_error_new (device, g_strdup_printf ("No devices found")));
+ ring = sfi_ring_append (ring, bse_device_error_new (device, g_strdup_format ("No devices found")));
return ring;
}
diff --git a/bse/bseprocidl.cc b/bse/bseprocidl.cc
index cb10541..b8511f9 100644
--- a/bse/bseprocidl.cc
+++ b/bse/bseprocidl.cc
@@ -174,7 +174,7 @@ std::string symbolForInt (int i)
if (i == SFI_MAXINT) return "SFI_MAXINT";
if (i == SFI_MININT) return "SFI_MININT";
- char *x = g_strdup_printf ("%d", i);
+ char *x = g_strdup_format ("%d", i);
std::string result = x;
g_free(x);
return result;
diff --git a/bse/bseproject.cc b/bse/bseproject.cc
index e94fa52..e278a35 100644
--- a/bse/bseproject.cc
+++ b/bse/bseproject.cc
@@ -527,7 +527,7 @@ bse_project_store_bse (BseProject *self,
slist = g_slist_concat (compute_missing_supers (self, storage), slist);
}
- string = g_strdup_printf ("; BseProject\n\n"); /* %010o mflags */
+ string = g_strdup_format ("; BseProject\n\n"); /* %010o mflags */
do
l = write (fd, string, strlen (string));
while (l < 0 && errno == EINTR);
@@ -600,7 +600,7 @@ bse_project_upath_resolver (gpointer func_data,
if (g_type_is_a (required_type, BSE_TYPE_ITEM))
item = bse_container_resolve_upath (BSE_CONTAINER (self), upath);
else if (error_p)
- *error_p = g_strdup_printf ("unable to resolve object of type `%s' from upath: %s", g_type_name
(required_type), upath);
+ *error_p = g_strdup_format ("unable to resolve object of type `%s' from upath: %s", g_type_name
(required_type), upath);
return (BseObject*) item;
}
diff --git a/bse/bsescripthelper.cc b/bse/bsescripthelper.cc
index 664073a..04be62c 100644
--- a/bse/bsescripthelper.cc
+++ b/bse/bsescripthelper.cc
@@ -138,12 +138,12 @@ bse_script_procedure_exec (BseProcedureClass *proc,
gchar *shellpath;
guint i;
- params = sfi_ring_append (params, g_strdup_printf ("--bse-eval"));
- params = sfi_ring_append (params, g_strdup_printf ("(load \"%s\")"
+ params = sfi_ring_append (params, g_strdup_format ("--bse-eval"));
+ params = sfi_ring_append (params, g_strdup_format ("(load \"%s\")"
"(apply %s (bse-script-fetch-args))",
sdata->script_file,
sdata->name));
- shellpath = g_strdup_printf ("%s/%s-%s", bse_main_args->path_binaries, "bsescm", BIN_VERSION);
+ shellpath = g_strdup_format ("%s/%s-%s", bse_main_args->path_binaries, "bsescm", BIN_VERSION);
error = bse_server_run_remote (server, shellpath,
params, sdata->script_file, BSE_PROCEDURE_NAME (proc), &janitor);
g_free (shellpath);
@@ -254,8 +254,8 @@ bse_script_file_register (const gchar *file_name,
params = sfi_ring_append (params, g_strdup ("--bse-enable-register"));
params = sfi_ring_append (params, g_strdup ("--bse-eval"));
- params = sfi_ring_append (params, g_strdup_printf ("(load \"%s\")", file_name));
- char *shellpath = g_strdup_printf ("%s/%s-%s", bse_main_args->path_binaries, "bsescm", BIN_VERSION);
+ params = sfi_ring_append (params, g_strdup_format ("(load \"%s\")", file_name));
+ char *shellpath = g_strdup_format ("%s/%s-%s", bse_main_args->path_binaries, "bsescm", BIN_VERSION);
*janitor_p = NULL;
error = bse_server_run_remote (server, shellpath,
params, file_name, proc_name, janitor_p);
@@ -304,7 +304,7 @@ bse_script_param_spec (gchar *pspec_desc,
cname = make_sname (pstring);
const gchar *nick = _(pstring);
*free1 = cname;
- gchar *blurb = g_strdup_printf ("Parameter \"%s\" to function <%s> in script \"%s\"",
+ gchar *blurb = g_strdup_format ("Parameter \"%s\" to function <%s> in script \"%s\"",
cname, func_name, script_name);
*free2 = blurb;
if (strcmp (pspec_desc, "BseParamString") == 0) /* "BseParamString:Text:Default" */
diff --git a/bse/bseserver.cc b/bse/bseserver.cc
index 1a38413..cee5ebc 100644
--- a/bse/bseserver.cc
+++ b/bse/bseserver.cc
@@ -809,7 +809,7 @@ bse_server_run_remote (BseServer *server,
char *freeme = NULL;
if (!reason)
{
- gchar *ident = g_strdup_printf ("%s::%s", script_name, proc_name);
+ gchar *ident = g_strdup_format ("%s::%s", script_name, proc_name);
SfiComPort *port = sfi_com_port_from_child (ident,
command_output,
command_input,
diff --git a/bse/bseserver.proc b/bse/bseserver.proc
index 99ebf20..6e67a63 100644
--- a/bse/bseserver.proc
+++ b/bse/bseserver.proc
@@ -47,7 +47,7 @@ BODY (BseProcedureClass *proc,
while (bse_server_find_project (server, uname))
{
g_free (uname);
- uname = g_strdup_printf ("%s-%u", name, num++);
+ uname = g_strdup_format ("%s-%u", name, num++);
}
/* create project */
diff --git a/bse/bsesnet.cc b/bse/bsesnet.cc
index d29b172..f866ff4 100644
--- a/bse/bsesnet.cc
+++ b/bse/bsesnet.cc
@@ -307,7 +307,7 @@ bse_snet_iport_name_register (BseSNet *snet,
while (slist)
{
g_free (name);
- name = g_strdup_printf ("%s-%u", tmpl_name, i++);
+ name = g_strdup_format ("%s-%u", tmpl_name, i++);
slist = snet_find_port_name (snet, name, TRUE);
}
if (!name)
@@ -365,7 +365,7 @@ bse_snet_oport_name_register (BseSNet *snet,
while (slist)
{
g_free (name);
- name = g_strdup_printf ("%s-%u", tmpl_name, i++);
+ name = g_strdup_format ("%s-%u", tmpl_name, i++);
slist = snet_find_port_name (snet, name, FALSE);
}
if (!name)
diff --git a/bse/bsestorage.cc b/bse/bsestorage.cc
index 2f88b8d..d016688 100644
--- a/bse/bsestorage.cc
+++ b/bse/bsestorage.cc
@@ -413,7 +413,7 @@ bse_storage_finish_parsing (BseStorage *self)
if (ilink->error)
{
- gchar *error = g_strdup_printf ("unable to resolve link path for item `%s': %s",
+ gchar *error = g_strdup_format ("unable to resolve link path for item `%s': %s",
BSE_OBJECT_UNAME (ilink->from_item),
ilink->error);
ilink->restore_link (ilink->data, self, ilink->from_item, NULL, error);
@@ -443,7 +443,7 @@ bse_storage_finish_parsing (BseStorage *self)
parent = parent->parent;
}
if (!parent)
- error = g_strdup_printf ("failed to find ancestor of item `%s' (branch depth: -%u, "
+ error = g_strdup_format ("failed to find ancestor of item `%s' (branch depth: -%u, "
"number of parents: %u) while resolving link path \"%s\"",
BSE_OBJECT_UNAME (ilink->from_item),
ilink->pbackup,
@@ -453,7 +453,7 @@ bse_storage_finish_parsing (BseStorage *self)
{
child = storage_path_table_resolve_upath (self, BSE_CONTAINER (parent), ilink->upath);
if (!child)
- error = g_strdup_printf ("failed to find object for item `%s' while resolving link path
\"%s\" from ancestor `%s'",
+ error = g_strdup_format ("failed to find object for item `%s' while resolving link path
\"%s\" from ancestor `%s'",
BSE_OBJECT_UNAME (ilink->from_item),
ilink->upath, BSE_OBJECT_UNAME (parent));
}
@@ -1576,6 +1576,7 @@ bse_storage_parse_data_handle_rest (BseStorage *self,
g_return_val_if_fail (data_handle_p != NULL, G_TOKEN_ERROR);
return parse_data_handle_trampoline (self, TRUE, data_handle_p, n_channels_p, mix_freq_p, osc_freq_p);
}
+
BseErrorType
bse_storage_flush_fd (BseStorage *self,
gint fd)
diff --git a/bse/bsesubiport.cc b/bse/bsesubiport.cc
index b7a561d..953276d 100644
--- a/bse/bsesubiport.cc
+++ b/bse/bsesubiport.cc
@@ -33,7 +33,7 @@ bse_sub_iport_init (BseSubIPort *self)
guint i;
self->input_ports = g_new (gchar*, BSE_SOURCE_N_OCHANNELS (self));
for (i = 0; i < BSE_SOURCE_N_OCHANNELS (self); i++)
- self->input_ports[i] = g_strdup_printf ("synth_in_%u", i + 1);
+ self->input_ports[i] = g_strdup_format ("synth_in_%u", i + 1);
}
static void
@@ -140,7 +140,7 @@ bse_sub_iport_set_parent (BseItem *item,
{
g_free (self->input_ports[i]);
self->input_ports[i] = g_strdup (name);
- gchar *string = g_strdup_printf ("in_port_%u", i + 1);
+ gchar *string = g_strdup_format ("in_port_%u", i + 1);
g_object_notify (G_OBJECT (item), string);
g_free (string);
}
@@ -275,16 +275,16 @@ bse_sub_iport_class_init (BseSubIPortClass *klass)
{
gchar *ident, *label, *value;
- ident = g_strdup_printf ("output-%u", i + 1);
- label = g_strdup_printf (_("Virtual input %u"), i + 1);
+ ident = g_strdup_format ("output-%u", i + 1);
+ label = g_strdup_format (_("Virtual input %u"), i + 1);
channel_id = bse_source_class_add_ochannel (source_class, ident, label, NULL);
g_assert (channel_id == i);
g_free (ident);
g_free (label);
- ident = g_strdup_printf ("in_port_%u", i + 1);
- label = g_strdup_printf (_("Input Port %u"), i + 1);
- value = g_strdup_printf ("synth_in_%u", i + 1);
+ ident = g_strdup_format ("in_port_%u", i + 1);
+ label = g_strdup_format (_("Input Port %u"), i + 1);
+ value = g_strdup_format ("synth_in_%u", i + 1);
bse_object_class_add_param (object_class, _("Assignments"), PROP_IPORT_NAME + i * 2,
sfi_pspec_string (ident, label,
_("The port name is a unique name to establish
input<->output "
diff --git a/bse/bsesuboport.cc b/bse/bsesuboport.cc
index 2a64af1..6c2133e 100644
--- a/bse/bsesuboport.cc
+++ b/bse/bsesuboport.cc
@@ -33,7 +33,7 @@ bse_sub_oport_init (BseSubOPort *self)
guint i;
self->output_ports = g_new (gchar*, BSE_SOURCE_N_ICHANNELS (self));
for (i = 0; i < BSE_SOURCE_N_ICHANNELS (self); i++)
- self->output_ports[i] = g_strdup_printf ("synth_out_%u", i + 1);
+ self->output_ports[i] = g_strdup_format ("synth_out_%u", i + 1);
}
static void
@@ -142,7 +142,7 @@ bse_sub_oport_set_parent (BseItem *item,
g_free (self->output_ports[i]);
self->output_ports[i] = g_strdup (name);
- string = g_strdup_printf ("out_port_%u", i + 1);
+ string = g_strdup_format ("out_port_%u", i + 1);
g_object_notify (G_OBJECT (item), string);
g_free (string);
}
@@ -276,16 +276,16 @@ bse_sub_oport_class_init (BseSubOPortClass *klass)
{
gchar *ident, *label, *value;
- ident = g_strdup_printf ("input-%u", i + 1);
- label = g_strdup_printf (_("Virtual output %u"), i + 1);
+ ident = g_strdup_format ("input-%u", i + 1);
+ label = g_strdup_format (_("Virtual output %u"), i + 1);
channel_id = bse_source_class_add_ichannel (source_class, ident, label, NULL);
g_assert (channel_id == i);
g_free (ident);
g_free (label);
- ident = g_strdup_printf ("out_port_%u", i + 1);
- label = g_strdup_printf (_("Output Port %u"), i + 1);
- value = g_strdup_printf ("synth_out_%u", i + 1);
+ ident = g_strdup_format ("out_port_%u", i + 1);
+ label = g_strdup_format (_("Output Port %u"), i + 1);
+ value = g_strdup_format ("synth_out_%u", i + 1);
bse_object_class_add_param (object_class, _("Assignments"), PROP_OPORT_NAME + i * 2,
sfi_pspec_string (ident, label,
_("The port name is a unique name to establish
input<->output "
diff --git a/bse/bsesubsynth.cc b/bse/bsesubsynth.cc
index e55456f..08fc385 100644
--- a/bse/bsesubsynth.cc
+++ b/bse/bsesubsynth.cc
@@ -91,11 +91,11 @@ bse_sub_synth_init (BseSubSynth *self)
self->input_ports = g_new (gchar*, BSE_SOURCE_N_ICHANNELS (self));
for (i = 0; i < BSE_SOURCE_N_ICHANNELS (self); i++)
- self->input_ports[i] = g_strdup_printf ("synth_in_%u", i + 1);
+ self->input_ports[i] = g_strdup_format ("synth_in_%u", i + 1);
self->output_ports = g_new (gchar*, BSE_SOURCE_N_OCHANNELS (self));
for (i = 0; i < BSE_SOURCE_N_OCHANNELS (self); i++)
- self->output_ports[i] = g_strdup_printf ("synth_out_%u", i + 1);
+ self->output_ports[i] = g_strdup_format ("synth_out_%u", i + 1);
}
static void
@@ -175,7 +175,7 @@ dup_name_unique (BseSubSynth *self,
while (find_name (self, name, is_input))
{
g_free (name);
- name = g_strdup_printf ("%s-%u", name, i++);
+ name = g_strdup_format ("%s-%u", name, i++);
}
return name;
}
@@ -273,13 +273,13 @@ bse_sub_synth_get_property (GObject *object,
if (n < BSE_SOURCE_N_ICHANNELS (self))
g_value_set_string (value, self->input_ports[n]);
else
- g_value_take_string (value, g_strdup_printf ("synth_in_%u", n + 1)); /* return default */
+ g_value_take_string (value, g_strdup_format ("synth_in_%u", n + 1)); /* return default */
break;
case PARAM_OPORT_NAME:
if (n < BSE_SOURCE_N_OCHANNELS (self))
g_value_set_string (value, self->output_ports[n]);
else
- g_value_take_string (value, g_strdup_printf ("synth_out_%u", n + 1)); /* return default */
+ g_value_take_string (value, g_strdup_format ("synth_out_%u", n + 1)); /* return default */
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (self, param_id, pspec);
@@ -501,9 +501,9 @@ bse_sub_synth_class_init (BseSubSynthClass *klass)
{
gchar *ident, *label, *value;
- ident = g_strdup_printf ("in_port_%u", i + 1);
- label = g_strdup_printf (_("Input Port %u"), i + 1);
- value = g_strdup_printf ("synth_in_%u", i + 1);
+ ident = g_strdup_format ("in_port_%u", i + 1);
+ label = g_strdup_format (_("Input Port %u"), i + 1);
+ value = g_strdup_format ("synth_in_%u", i + 1);
bse_object_class_add_param (object_class, _("Input Assignments"), PARAM_IPORT_NAME + i * 2,
sfi_pspec_string (ident, label, _("Output port name to interface from"),
value, SFI_PARAM_STANDARD ":skip-default"));
@@ -511,9 +511,9 @@ bse_sub_synth_class_init (BseSubSynthClass *klass)
g_free (label);
g_free (value);
- ident = g_strdup_printf ("out_port_%u", i + 1);
- label = g_strdup_printf (_("Output Port %u"), i + 1);
- value = g_strdup_printf ("synth_out_%u", i + 1);
+ ident = g_strdup_format ("out_port_%u", i + 1);
+ label = g_strdup_format (_("Output Port %u"), i + 1);
+ value = g_strdup_format ("synth_out_%u", i + 1);
bse_object_class_add_param (object_class, _("Output Assignments"), PARAM_OPORT_NAME + i * 2,
sfi_pspec_string (ident, label, _("Input port name to interface to"),
value, SFI_PARAM_STANDARD ":skip-default"));
@@ -521,15 +521,15 @@ bse_sub_synth_class_init (BseSubSynthClass *klass)
g_free (label);
g_free (value);
- ident = g_strdup_printf ("input-%u", i + 1);
- label = g_strdup_printf (_("Virtual input %u"), i + 1);
+ ident = g_strdup_format ("input-%u", i + 1);
+ label = g_strdup_format (_("Virtual input %u"), i + 1);
channel_id = bse_source_class_add_ichannel (source_class, ident, label, NULL);
g_assert (channel_id == i);
g_free (ident);
g_free (label);
- ident = g_strdup_printf ("output-%u", i + 1);
- label = g_strdup_printf (_("Virtual output %u"), i + 1);
+ ident = g_strdup_format ("output-%u", i + 1);
+ label = g_strdup_format (_("Virtual output %u"), i + 1);
channel_id = bse_source_class_add_ochannel (source_class, ident, label, NULL);
g_assert (channel_id == i);
g_free (ident);
diff --git a/bse/bsetype.cc b/bse/bsetype.cc
index eafc807..7c6f349 100644
--- a/bse/bsetype.cc
+++ b/bse/bsetype.cc
@@ -225,7 +225,7 @@ bse_boxed_lcopy_value (const GValue *value,
{
gpointer *boxed_p = (void**) collect_values[0].v_pointer;
if (!boxed_p)
- return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
+ return g_strdup_format ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
if (!value->data[0].v_pointer)
*boxed_p = NULL;
else if (collect_flags & G_VALUE_NOCOPY_CONTENTS)
diff --git a/bse/bseutils.cc b/bse/bseutils.cc
index 1bd3d19..0da7ff7 100644
--- a/bse/bseutils.cc
+++ b/bse/bseutils.cc
@@ -191,7 +191,7 @@ bse_debug_dump_floats (guint debug_stream,
debug_stream %= MAX_DEBUG_STREAMS;
if (debug_fds[debug_stream] < 0)
{
- gchar *file = g_strdup_printf ("/tmp/beast-debug-dump%u.%u", debug_stream, getpid());
+ gchar *file = g_strdup_format ("/tmp/beast-debug-dump%u.%u", debug_stream, getpid());
debug_fds[debug_stream] = open (file, O_WRONLY | O_CREAT | O_TRUNC, 0666);
g_free (file);
if (debug_fds[debug_stream] >= 0)
diff --git a/bse/gslcommon.cc b/bse/gslcommon.cc
index cab6e7e..a44f2c3 100644
--- a/bse/gslcommon.cc
+++ b/bse/gslcommon.cc
@@ -380,7 +380,7 @@ gsl_progress_printerr (gpointer message,
gchar *ppos = strchr (format, '1');
guint l, prec = pstate->precision;
ppos[0] = '0' + CLAMP (prec, 0, 9);
- str = g_strdup_printf (format,
+ str = g_strdup_format (format,
message ? (gchar*) message : "",
message ? ": " : "",
pval,
diff --git a/bse/gsldatahandle.cc b/bse/gsldatahandle.cc
index b8c9dba..e0d24d6 100644
--- a/bse/gsldatahandle.cc
+++ b/bse/gsldatahandle.cc
@@ -1263,7 +1263,7 @@ gsl_data_handle_new_looped (GslDataHandle *src_handle,
success = gsl_data_handle_common_init (&lhandle->dhandle, NULL);
if (success)
{
- lhandle->dhandle.name = g_strdup_printf ("%s// #loop(0x%llx:0x%llx) /", src_handle->name, loop_first,
loop_last);
+ lhandle->dhandle.name = g_strdup_format ("%s// #loop(0x%llx:0x%llx) /", src_handle->name, loop_first,
loop_last);
lhandle->dhandle.vtable = &loop_handle_vtable;
lhandle->src_handle = gsl_data_handle_ref (src_handle);
lhandle->requested_first = loop_first;
@@ -1375,7 +1375,7 @@ gsl_data_handle_new_dcached (GslDataCache *dcache)
success = gsl_data_handle_common_init (&dhandle->dhandle, NULL);
if (success)
{
- dhandle->dhandle.name = g_strdup_printf ("%s// #dcache /", dcache->dhandle->name);
+ dhandle->dhandle.name = g_strdup_format ("%s// #dcache /", dcache->dhandle->name);
dhandle->dhandle.vtable = &dcache_handle_vtable;
dhandle->dcache = gsl_data_cache_ref (dcache);
dhandle->node_size = GSL_DATA_CACHE_NODE_SIZE (dcache) + dcache->padding;
diff --git a/bse/tests/loophandle.cc b/bse/tests/loophandle.cc
index 02cea03..7295560 100644
--- a/bse/tests/loophandle.cc
+++ b/bse/tests/loophandle.cc
@@ -119,7 +119,7 @@ gsl_data_handle_new_looped_reference (GslDataHandle *src_handle,
success = gsl_data_handle_common_init (&lhandle->dhandle, NULL);
if (success)
{
- lhandle->dhandle.name = g_strdup_printf ("%s// #loop(0x%llx:0x%llx) /", src_handle->name, loop_first,
loop_last);
+ lhandle->dhandle.name = g_strdup_format ("%s// #loop(0x%llx:0x%llx) /", src_handle->name, loop_first,
loop_last);
lhandle->dhandle.vtable = &loop_handle_reference_vtable;
lhandle->src_handle = gsl_data_handle_ref (src_handle);
lhandle->requested_first = loop_first;
diff --git a/bse/tests/resamplehandle.cc b/bse/tests/resamplehandle.cc
index e4c26e9..4635e63 100644
--- a/bse/tests/resamplehandle.cc
+++ b/bse/tests/resamplehandle.cc
@@ -43,8 +43,8 @@ check (const char *up_down,
int precision_bits,
double max_db)
{
- char *samplestr = g_strdup_printf ("ResampleHandle-%s%02d%s", up_down, bits, channels);
- char *streamstr = g_strdup_printf ("CPU Resampling %s%02d%s", up_down, bits, channels);
+ char *samplestr = g_strdup_format ("ResampleHandle-%s%02d%s", up_down, bits, channels);
+ char *streamstr = g_strdup_format ("CPU Resampling %s%02d%s", up_down, bits, channels);
TSTART ("%s (%s)", samplestr, cpu_type);
TASSERT (input.size() % n_channels == 0);
diff --git a/drivers/bse-portaudio/bsepcmdevice-portaudio.cc b/drivers/bse-portaudio/bsepcmdevice-portaudio.cc
index 5091d53..e80cf5c 100644
--- a/drivers/bse-portaudio/bsepcmdevice-portaudio.cc
+++ b/drivers/bse-portaudio/bsepcmdevice-portaudio.cc
@@ -98,7 +98,7 @@ port_audio_host_api_name (PaHostApiIndex host_api_index)
default: ;
}
- char *api_str = g_strdup_printf ("pa%02d", host_api_info->type);
+ char *api_str = g_strdup_format ("pa%02d", host_api_info->type);
string name = api_str;
g_free (api_str);
return name;
@@ -124,7 +124,7 @@ port_audio_devices()
const PaDeviceInfo *device_info = Pa_GetDeviceInfo (device_index);
if (device_info->hostApi == host_api_index)
{
- char *device_args = g_strdup_printf ("%s:%d", host_api_name.c_str(), host_api_device_index++);
+ char *device_args = g_strdup_format ("%s:%d", host_api_name.c_str(), host_api_device_index++);
devices[device_index] = device_args;
g_free (device_args);
}
@@ -150,12 +150,12 @@ bse_pcm_device_port_audio_list_devices (BseDevice *device)
BseDeviceEntry *entry = bse_device_group_entry_new (device, device_args,
g_strdup (host_api_info->name),
- g_strdup_printf ("%-10s%s%s", device_args,
device_info->name,
+ g_strdup_format ("%-10s%s%s", device_args,
device_info->name,
device_index ==
default_device_index ? " (default)": ""));
ring = sfi_ring_append (ring, entry);
}
if (!ring)
- ring = sfi_ring_append (ring, bse_device_error_new (device, g_strdup_printf ("No devices found")));
+ ring = sfi_ring_append (ring, bse_device_error_new (device, g_strdup_format ("No devices found")));
return ring;
}
diff --git a/drivers/bsemididevice-alsa.cc b/drivers/bsemididevice-alsa.cc
index 2331f73..00de175 100644
--- a/drivers/bsemididevice-alsa.cc
+++ b/drivers/bsemididevice-alsa.cc
@@ -69,7 +69,7 @@ list_midi_devices (BseDevice *device, SfiRing *ring, const char *device_group)
{
std::string blurb = substitute_string ("\n", " ", desc);
BseDeviceEntry *entry = bse_device_group_entry_new (device, g_strdup (name), g_strdup
(device_group),
- g_strdup_printf ("%s - %s", name,
blurb.c_str()));
+ g_strdup_format ("%s - %s", name,
blurb.c_str()));
ring = sfi_ring_append (ring, entry);
}
if (name) free (name);
@@ -111,7 +111,7 @@ bse_midi_device_alsa_list_devices (BseDevice *device)
continue;
}
- gchar *device_group = g_strdup_printf ("%s - %s", snd_ctl_card_info_get_id (cinfo),
snd_ctl_card_info_get_longname (cinfo));
+ gchar *device_group = g_strdup_format ("%s - %s", snd_ctl_card_info_get_id (cinfo),
snd_ctl_card_info_get_longname (cinfo));
int pindex = -1;
snd_ctl_rawmidi_next_device (chandle, &pindex);
@@ -133,19 +133,19 @@ bse_midi_device_alsa_list_devices (BseDevice *device)
guint avail_output_subdevices = writable ? snd_rawmidi_info_get_subdevices_avail (winfo) : 0;
gchar *wdevs = NULL, *rdevs = NULL;
if (total_input_subdevices && total_input_subdevices != avail_input_subdevices)
- rdevs = g_strdup_printf ("%u*input (%u busy)", total_input_subdevices, total_input_subdevices -
avail_input_subdevices);
+ rdevs = g_strdup_format ("%u*input (%u busy)", total_input_subdevices, total_input_subdevices -
avail_input_subdevices);
else if (total_input_subdevices)
- rdevs = g_strdup_printf ("%u*input", total_input_subdevices);
+ rdevs = g_strdup_format ("%u*input", total_input_subdevices);
if (total_output_subdevices && total_output_subdevices != avail_output_subdevices)
- wdevs = g_strdup_printf ("%u*output (%u busy)", total_output_subdevices, total_output_subdevices
- avail_output_subdevices);
+ wdevs = g_strdup_format ("%u*output (%u busy)", total_output_subdevices, total_output_subdevices
- avail_output_subdevices);
else if (total_output_subdevices)
- wdevs = g_strdup_printf ("%u*output", total_output_subdevices);
+ wdevs = g_strdup_format ("%u*output", total_output_subdevices);
const gchar *joiner = wdevs && rdevs ? " + " : "";
BseDeviceEntry *entry;
entry = bse_device_group_entry_new (device,
- g_strdup_printf ("hw:%u,%u", cindex, pindex),
+ g_strdup_format ("hw:%u,%u", cindex, pindex),
g_strdup (device_group),
- g_strdup_printf ("hw:%u,%u (subdevices: %s%s%s)",
+ g_strdup_format ("hw:%u,%u (subdevices: %s%s%s)",
cindex, pindex,
rdevs ? rdevs : "",
joiner,
@@ -162,7 +162,7 @@ bse_midi_device_alsa_list_devices (BseDevice *device)
break;
}
if (!ring)
- ring = sfi_ring_append (ring, bse_device_error_new (device, g_strdup_printf ("No devices found")));
+ ring = sfi_ring_append (ring, bse_device_error_new (device, g_strdup_format ("No devices found")));
return ring;
}
diff --git a/drivers/bsepcmdevice-alsa.cc b/drivers/bsepcmdevice-alsa.cc
index ecba2c5..1114721 100644
--- a/drivers/bsepcmdevice-alsa.cc
+++ b/drivers/bsepcmdevice-alsa.cc
@@ -94,7 +94,7 @@ list_pcm_devices (BseDevice *device, SfiRing *ring, const char *device_group)
{
std::string blurb = substitute_string ("\n", " ", desc);
BseDeviceEntry *entry = bse_device_group_entry_new (device, g_strdup (name), g_strdup
(device_group),
- g_strdup_printf ("%s - %s", name,
blurb.c_str()));
+ g_strdup_format ("%s - %s", name,
blurb.c_str()));
ring = sfi_ring_append (ring, entry);
}
if (name) free (name);
@@ -135,7 +135,7 @@ bse_pcm_device_alsa_list_devices (BseDevice *device)
continue;
}
- gchar *device_group = g_strdup_printf ("%s - %s", snd_ctl_card_info_get_id (cinfo),
snd_ctl_card_info_get_longname (cinfo));
+ gchar *device_group = g_strdup_format ("%s - %s", snd_ctl_card_info_get_id (cinfo),
snd_ctl_card_info_get_longname (cinfo));
int pindex = -1;
snd_ctl_pcm_next_device (chandle, &pindex);
@@ -157,19 +157,19 @@ bse_pcm_device_alsa_list_devices (BseDevice *device)
guint avail_capture_subdevices = readable ? snd_pcm_info_get_subdevices_avail (rinfo) : 0;
gchar *pdevs = NULL, *rdevs = NULL;
if (total_playback_subdevices && total_playback_subdevices != avail_playback_subdevices)
- pdevs = g_strdup_printf ("%u*playback (%u busy)", total_playback_subdevices,
total_playback_subdevices - avail_playback_subdevices);
+ pdevs = g_strdup_format ("%u*playback (%u busy)", total_playback_subdevices,
total_playback_subdevices - avail_playback_subdevices);
else if (total_playback_subdevices)
- pdevs = g_strdup_printf ("%u*playback", total_playback_subdevices);
+ pdevs = g_strdup_format ("%u*playback", total_playback_subdevices);
if (total_capture_subdevices && total_capture_subdevices != avail_capture_subdevices)
- rdevs = g_strdup_printf ("%u*capture (%u busy)", total_capture_subdevices,
total_capture_subdevices - avail_capture_subdevices);
+ rdevs = g_strdup_format ("%u*capture (%u busy)", total_capture_subdevices,
total_capture_subdevices - avail_capture_subdevices);
else if (total_capture_subdevices)
- rdevs = g_strdup_printf ("%u*capture", total_capture_subdevices);
+ rdevs = g_strdup_format ("%u*capture", total_capture_subdevices);
const gchar *joiner = pdevs && rdevs ? " + " : "";
BseDeviceEntry *entry;
entry = bse_device_group_entry_new (device,
- g_strdup_printf ("hw:%u,%u", cindex, pindex),
+ g_strdup_format ("hw:%u,%u", cindex, pindex),
g_strdup (device_group),
- g_strdup_printf ("hw:%u,%u - subdevices: %s%s%s",
+ g_strdup_format ("hw:%u,%u - subdevices: %s%s%s",
cindex, pindex,
pdevs ? pdevs : "",
joiner,
@@ -186,7 +186,7 @@ bse_pcm_device_alsa_list_devices (BseDevice *device)
break;
}
if (!ring)
- ring = sfi_ring_append (ring, bse_device_error_new (device, g_strdup_printf ("No devices found")));
+ ring = sfi_ring_append (ring, bse_device_error_new (device, g_strdup_format ("No devices found")));
return ring;
}
diff --git a/plugins/bsemixer.cc b/plugins/bsemixer.cc
index 3229377..371e43a 100644
--- a/plugins/bsemixer.cc
+++ b/plugins/bsemixer.cc
@@ -94,9 +94,9 @@ bse_mixer_class_init (BseMixerClass *klass)
{
gchar *group, *ident, *label, *blurb;
- group = g_strdup_printf (_("Channel%u"), i);
- ident = g_strdup_printf ("volume_f%u", i);
- label = g_strdup_printf (_("Channel%u [float]"), i);
+ group = g_strdup_format (_("Channel%u"), i);
+ ident = g_strdup_format ("volume_f%u", i);
+ label = g_strdup_format (_("Channel%u [float]"), i);
bse_object_class_add_param (object_class, group,
PROP_NTH_VOLUME_f + (i - 1) * 3,
sfi_pspec_real (ident, label, NULL,
@@ -105,8 +105,8 @@ bse_mixer_class_init (BseMixerClass *klass)
SFI_PARAM_STORAGE));
g_free (ident);
g_free (label);
- ident = g_strdup_printf ("volume_dB%u", i);
- label = g_strdup_printf (_("Channel%u [dB]"), i);
+ ident = g_strdup_format ("volume_dB%u", i);
+ label = g_strdup_format (_("Channel%u [dB]"), i);
bse_object_class_add_param (object_class, group,
PROP_NTH_VOLUME_dB + (i - 1) * 3,
sfi_pspec_real (ident, label, NULL,
@@ -116,8 +116,8 @@ bse_mixer_class_init (BseMixerClass *klass)
SFI_PARAM_GUI ":dial"));
g_free (ident);
g_free (label);
- ident = g_strdup_printf ("volume_perc%u", i);
- label = g_strdup_printf (_("Channel%u [%%]"), i);
+ ident = g_strdup_format ("volume_perc%u", i);
+ label = g_strdup_format (_("Channel%u [%%]"), i);
bse_object_class_add_param (object_class, group,
PROP_NTH_VOLUME_PERC + (i - 1) * 3,
sfi_pspec_int (ident, label, NULL,
@@ -127,9 +127,9 @@ bse_mixer_class_init (BseMixerClass *klass)
g_free (group);
g_free (ident);
g_free (label);
- ident = g_strdup_printf ("audio-in%u", i);
- label = g_strdup_printf (_("Audio In%u"), i);
- blurb = g_strdup_printf (_("Input Channel %u"), i);
+ ident = g_strdup_format ("audio-in%u", i);
+ label = g_strdup_format (_("Audio In%u"), i);
+ blurb = g_strdup_format (_("Input Channel %u"), i);
ichannel = bse_source_class_add_ichannel (source_class, ident, label, blurb);
g_assert (ichannel == i - 1);
g_free (blurb);
@@ -186,30 +186,30 @@ bse_mixer_set_property (GObject *object,
case PROP_NTH_VOLUME_f - PROP_NTH_VOLUME_f:
self->volume_factors[n] = sfi_value_get_real (value);
bse_mixer_update_modules (self, NULL);
- prop = g_strdup_printf ("volume_dB%u", n + 1);
+ prop = g_strdup_format ("volume_dB%u", n + 1);
g_object_notify ((GObject*) object, prop);
g_free (prop);
- prop = g_strdup_printf ("volume_perc%u", n + 1);
+ prop = g_strdup_format ("volume_perc%u", n + 1);
g_object_notify ((GObject*) object, prop);
g_free (prop);
break;
case PROP_NTH_VOLUME_dB - PROP_NTH_VOLUME_f:
self->volume_factors[n] = bse_db_to_factor (sfi_value_get_real (value));
bse_mixer_update_modules (self, NULL);
- prop = g_strdup_printf ("volume_f%u", n + 1);
+ prop = g_strdup_format ("volume_f%u", n + 1);
g_object_notify ((GObject*) object, prop);
g_free (prop);
- prop = g_strdup_printf ("volume_perc%u", n + 1);
+ prop = g_strdup_format ("volume_perc%u", n + 1);
g_object_notify ((GObject*) object, prop);
g_free (prop);
break;
case PROP_NTH_VOLUME_PERC - PROP_NTH_VOLUME_f:
self->volume_factors[n] = sfi_value_get_int (value) / 100.0;
bse_mixer_update_modules (self, NULL);
- prop = g_strdup_printf ("volume_f%u", n + 1);
+ prop = g_strdup_format ("volume_f%u", n + 1);
g_object_notify ((GObject*) object, prop);
g_free (prop);
- prop = g_strdup_printf ("volume_dB%u", n + 1);
+ prop = g_strdup_format ("volume_dB%u", n + 1);
g_object_notify ((GObject*) object, prop);
g_free (prop);
break;
diff --git a/plugins/bsesimpleadsr.cc b/plugins/bsesimpleadsr.cc
index 0ed9bad..3dccbc1 100644
--- a/plugins/bsesimpleadsr.cc
+++ b/plugins/bsesimpleadsr.cc
@@ -81,7 +81,7 @@ bse_simple_adsr_class_init (BseSimpleADSRClass *klass)
sfi_pspec_real ("release_time", "Release Time [%]", NULL,
40.0, 0.0, 100.0, 1.0,
SFI_PARAM_STANDARD ":f:dial"));
- desc = g_strdup_printf ("Time ranges in seconds: %.1f %.1f %.1f",
+ desc = g_strdup_format ("Time ranges in seconds: %.1f %.1f %.1f",
BSE_TIME_RANGE_SHORT_ms / 1000.0,
BSE_TIME_RANGE_MEDIUM_ms / 1000.0,
BSE_TIME_RANGE_LONG_ms / 1000.0);
diff --git a/sfi/glib-extra.hh b/sfi/glib-extra.hh
index 6ffa99f..c80ef09 100644
--- a/sfi/glib-extra.hh
+++ b/sfi/glib-extra.hh
@@ -2,8 +2,9 @@
#ifndef __SFI_GLIB_EXTRA_H__
#define __SFI_GLIB_EXTRA_H__
-#include <glib.h>
-#include <glib-object.h>
+#include <glib.h>
+#include <glib-object.h>
+#include <rapicorn-core.hh> // for Rapicorn::string_format
G_BEGIN_DECLS
@@ -57,6 +58,7 @@ void g_object_disconnect_any (gpointer object,
// == printf variants ==
#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())
+#define g_strdup_format(...) g_strdup (Rapicorn::string_format (__VA_ARGS__).c_str())
/* --- string functions --- */
const gchar* g_printf_find_localised_directive (const gchar *format);
diff --git a/sfi/sficomport.cc b/sfi/sficomport.cc
index 4e78f77..a6064dd 100644
--- a/sfi/sficomport.cc
+++ b/sfi/sficomport.cc
@@ -62,7 +62,7 @@ sfi_com_port_from_child (const gchar *ident,
port = g_new0 (SfiComPort, 1);
port->ref_count = 1;
if (remote_pid > 1)
- port->ident = g_strdup_printf ("%s[%u]", ident, remote_pid);
+ port->ident = g_strdup_format ("%s[%u]", ident, remote_pid);
else
port->ident = g_strdup (ident);
port->pfd[0].fd = nonblock_fd (remote_input);
diff --git a/sfi/sficomwire.cc b/sfi/sficomwire.cc
index ecfa250..5e359d3 100644
--- a/sfi/sficomwire.cc
+++ b/sfi/sficomwire.cc
@@ -50,7 +50,7 @@ sfi_com_wire_from_child (const gchar *ident,
wire = g_new0 (SfiComWire, 1);
if (remote_pid > 1)
- wire->ident = g_strdup_printf ("%s[%u]", ident, remote_pid);
+ wire->ident = g_strdup_format ("%s[%u]", ident, remote_pid);
else
wire->ident = g_strdup (ident);
wire->remote_input = remote_input;
@@ -957,16 +957,16 @@ sfi_com_spawn_async (const gchar *executable,
close (command_output_pipe[0]);
close (command_output_pipe[1]);
}
- return g_strdup_printf ("failed to create communication channels: %s", g_strerror (e));
+ return g_strdup_format ("failed to create communication channels: %s", g_strerror (e));
}
- cargs = sfi_ring_prepend (cargs, g_strdup_printf ("%u", command_output_pipe[1]));
- cargs = sfi_ring_prepend (cargs, g_strdup_printf ("%u", command_input_pipe[0]));
+ cargs = sfi_ring_prepend (cargs, g_strdup_format ("%u", command_output_pipe[1]));
+ cargs = sfi_ring_prepend (cargs, g_strdup_format ("%u", command_input_pipe[0]));
if (command_fd_option[0])
cargs = sfi_ring_prepend (cargs, g_strdup (command_fd_option));
setup_data.keepexec1 = command_output_pipe[1];
setup_data.keepexec2 = command_input_pipe[0];
}
- cargs = sfi_ring_prepend (cargs, g_strdup_printf (/*"SFI-Spawn:%s"*/"%s", executable));
+ cargs = sfi_ring_prepend (cargs, g_strdup_format (/*"SFI-Spawn:%s"*/"%s", executable));
cargs = sfi_ring_prepend (cargs, g_strdup (executable));
l = sfi_ring_length (cargs) + sfi_ring_length (args);
diff --git a/sfi/sfidl-parser.hh b/sfi/sfidl-parser.hh
index c8c1446..c75666d 100644
--- a/sfi/sfidl-parser.hh
+++ b/sfi/sfidl-parser.hh
@@ -63,7 +63,7 @@ struct LineInfo {
String location() const
{
String result;
- char *x = g_strdup_printf ("%s:%d", (filename == "-") ? "stdin" : filename.c_str(), line);
+ char *x = g_strdup_format ("%s:%d", (filename == "-") ? "stdin" : filename.c_str(), line);
result = x;
g_free (x);
return result;
diff --git a/sfi/sfiglue.cc b/sfi/sfiglue.cc
index b24326c..17f0265 100644
--- a/sfi/sfiglue.cc
+++ b/sfi/sfiglue.cc
@@ -306,7 +306,7 @@ sfi_glue_call_valist (const gchar *proc_name,
gchar *error = NULL;
GType collect_type = sfi_category_type (SfiSCategory (arg_type));
if (!collect_type)
- error = g_strdup_printf ("%s: invalid category_type (%u)", G_STRLOC, arg_type);
+ error = g_strdup_format ("%s: invalid category_type (%u)", G_STRLOC, arg_type);
else
{
GValue *value = sfi_seq_append_empty (seq, collect_type);
diff --git a/sfi/sfiglueproxy.cc b/sfi/sfiglueproxy.cc
index 6614874..cd6b7b0 100644
--- a/sfi/sfiglueproxy.cc
+++ b/sfi/sfiglueproxy.cc
@@ -865,7 +865,7 @@ sfi_glue_proxy_set (SfiProxy proxy,
g_value_unset (&value);
}
else
- error = g_strdup_printf ("unknown property \"%s\"", prop);
+ error = g_strdup_format ("unknown property \"%s\"", prop);
if (error)
{
sfi_diag ("%s: %s", G_STRLOC, error);
@@ -898,7 +898,7 @@ sfi_glue_proxy_get (SfiProxy proxy,
G_VALUE_LCOPY (value, var_args, G_VALUE_NOCOPY_CONTENTS, &error);
}
else
- error = g_strdup_printf ("unknown property \"%s\"", prop);
+ error = g_strdup_format ("unknown property \"%s\"", prop);
if (error)
{
sfi_diag ("%s: %s", G_STRLOC, error);
diff --git a/sfi/sfinote.cc b/sfi/sfinote.cc
index 35d1247..988a579 100644
--- a/sfi/sfinote.cc
+++ b/sfi/sfinote.cc
@@ -120,7 +120,7 @@ sfi_note_from_string_err (const gchar *note_string,
g_free (freeme);
if (!fits && error_p)
- *error_p = g_strdup_printf ("invalid note specification: %s", note_string);
+ *error_p = g_strdup_format ("invalid note specification: %s", note_string);
return note;
}
@@ -134,7 +134,7 @@ sfi_note_to_string (SfiInt note)
sfi_note_examine (note, &o, &ht, NULL, NULL);
if (o)
- return g_strdup_printf ("%s%+d", sfi_note_name_table[ht], o);
+ return g_strdup_format ("%s%+d", sfi_note_name_table[ht], o);
else
return g_strdup (sfi_note_name_table[ht]);
}
diff --git a/sfi/sfitime.cc b/sfi/sfitime.cc
index ce88032..49f4d27 100644
--- a/sfi/sfitime.cc
+++ b/sfi/sfitime.cc
@@ -134,7 +134,7 @@ sfi_time_to_string (SfiTime ustime)
bt = *gmtime (&t); /* FIXME: not thread safe */
- return g_strdup_printf ("%04d-%02d-%02d %02d:%02d:%02d",
+ return g_strdup_format ("%04d-%02d-%02d %02d:%02d:%02d",
bt.tm_year + 1900,
bt.tm_mon + 1,
bt.tm_mday,
@@ -178,17 +178,17 @@ sfi_time_to_nice_string (SfiTime ustime,
const bool wdate = strchr (elements, 'd') || strchr (elements, 'm') || strchr (elements, 'y');
if (wdate && !wtime)
- return g_strdup_printf ("%04d-%02d-%02d",
+ return g_strdup_format ("%04d-%02d-%02d",
bt.tm_year + 1900,
bt.tm_mon + 1,
bt.tm_mday);
if (!wdate && wtime)
- return g_strdup_printf ("%02d:%02d:%02d",
+ return g_strdup_format ("%02d:%02d:%02d",
bt.tm_hour,
bt.tm_min,
bt.tm_sec);
else
- return g_strdup_printf ("%02d:%02d:%02d %04d-%02d-%02d",
+ return g_strdup_format ("%02d:%02d:%02d %04d-%02d-%02d",
bt.tm_hour,
bt.tm_min,
bt.tm_sec,
@@ -557,32 +557,32 @@ sfi_time_from_string_err (const gchar *time_string,
warnings = sfi_ring_append (warnings, g_strdup ("junk characters at end of date"));
if (year[i] < 1990)
{
- warnings = sfi_ring_append (warnings, g_strdup_printf ("%s out of bounds", "year"));
+ warnings = sfi_ring_append (warnings, g_strdup_format ("%s out of bounds", "year"));
year[i] = 1990;
}
if (month[i] < 1 || month[i] > 12)
{
- warnings = sfi_ring_append (warnings, g_strdup_printf ("%s out of bounds", "month"));
+ warnings = sfi_ring_append (warnings, g_strdup_format ("%s out of bounds", "month"));
month[i] = CLAMP (month[i], 1, 12);
}
if (day[i] < 1 || day[i] > 31)
{
- warnings = sfi_ring_append (warnings, g_strdup_printf ("%s out of bounds", "day"));
+ warnings = sfi_ring_append (warnings, g_strdup_format ("%s out of bounds", "day"));
month[i] = CLAMP (day[i], 1, 31);
}
if (hour[i] < 0 || hour[i] > 23)
{
- warnings = sfi_ring_append (warnings, g_strdup_printf ("%s out of bounds", "hour"));
+ warnings = sfi_ring_append (warnings, g_strdup_format ("%s out of bounds", "hour"));
hour[i] = CLAMP (hour[i], 0, 23);
}
if (minute[i] < 0 || minute[i] > 59)
{
- warnings = sfi_ring_append (warnings, g_strdup_printf ("%s out of bounds", "minute"));
+ warnings = sfi_ring_append (warnings, g_strdup_format ("%s out of bounds", "minute"));
minute[i] = CLAMP (minute[i], 0, 59);
}
if (second[i] < 0 || second[i] > 61)
{
- warnings = sfi_ring_append (warnings, g_strdup_printf ("%s out of bounds", "second"));
+ warnings = sfi_ring_append (warnings, g_strdup_format ("%s out of bounds", "second"));
second[i] = CLAMP (second[i], 0, 61);
}
@@ -623,7 +623,7 @@ sfi_time_from_string_err (const gchar *time_string,
if (ustime < SFI_MIN_TIME) /* limit ustime to 1.1.1990 */
{
- warnings = sfi_ring_append (warnings, g_strdup_printf ("invalid date specification (%lld < %lld,
gmt-diff=%lld)",
+ warnings = sfi_ring_append (warnings, g_strdup_format ("invalid date specification (%lld < %lld,
gmt-diff=%lld)",
ustime, SFI_MIN_TIME, gmt_diff));
ustime = SFI_MIN_TIME;
}
diff --git a/sfi/tests/misctests.cc b/sfi/tests/misctests.cc
index fc84d46..1b6c5bc 100644
--- a/sfi/tests/misctests.cc
+++ b/sfi/tests/misctests.cc
@@ -197,7 +197,7 @@ serial_pspec_check (GParamSpec *pspec,
{
g_print ("{while parsing pspec \"%s\":\n\t%s\n", pspec->name, s1->str);
g_scanner_unexp_token (scanner, token, NULL, NULL, NULL,
- g_strdup_printf ("failed to serialize pspec \"%s\"", pspec->name), TRUE);
+ g_strdup_format ("failed to serialize pspec \"%s\"", pspec->name), TRUE);
}
TASSERT (token == G_TOKEN_NONE);
sfi_value_store_typed (&rvalue, s2);
@@ -248,7 +248,7 @@ serialize_cmp (GValue *value,
{
g_print ("{while parsing \"%s\":\n\t%s\n", pspec->name, gstring->str);
g_scanner_unexp_token (scanner, token, NULL, NULL, NULL,
- g_strdup_printf ("failed to serialize \"%s\"", pspec->name), TRUE);
+ g_strdup_format ("failed to serialize \"%s\"", pspec->name), TRUE);
}
TASSERT (token == G_TOKEN_NONE);
cmp = g_param_values_cmp (pspec, value, &rvalue);
diff --git a/shell/bsescminterp.cc b/shell/bsescminterp.cc
index 2ea7dc4..3ec5180 100644
--- a/shell/bsescminterp.cc
+++ b/shell/bsescminterp.cc
@@ -1108,14 +1108,14 @@ register_types (const gchar **types)
if (strncmp (sname, "bse-", 4) == 0)
{
- s = g_strdup_printf ("(define (bse-is-%s proxy) (bse-item-check-is-a proxy \"%s\"))",
+ s = g_strdup_format ("(define (bse-is-%s proxy) (bse-item-check-is-a proxy \"%s\"))",
sname + 4, *types);
gh_eval_str (s);
g_free (s);
}
for (i = 0; names[i]; i++)
{
- gchar *s = g_strdup_printf ("(define %s-%s (lambda list (bse-glue-call \"%s+%s\" list)))",
+ gchar *s = g_strdup_format ("(define %s-%s (lambda list (bse-glue-call \"%s+%s\" list)))",
sname, names[i], *types, names[i]);
gh_eval_str (s);
g_free (s);
@@ -1166,7 +1166,7 @@ bse_scm_interp_init (void)
for (i = 0; procs[i]; i++)
if (strncmp (procs[i], "bse-", 4) == 0)
{
- gchar *s = g_strdup_printf ("(define bse-%s (lambda list (bse-glue-call \"%s\" list)))", procs[i] +
4, procs[i]);
+ gchar *s = g_strdup_format ("(define bse-%s (lambda list (bse-glue-call \"%s\" list)))", procs[i] +
4, procs[i]);
gh_eval_str (s);
g_free (s);
}
diff --git a/tools/bsewavetool.cc b/tools/bsewavetool.cc
index 706ca29..4eca60c 100644
--- a/tools/bsewavetool.cc
+++ b/tools/bsewavetool.cc
@@ -775,7 +775,7 @@ public:
bse_error_blurb (error));
exit (1);
}
- gchar *temp_file = g_strdup_printf ("%s/bsewavetool-pid%u-oggchunk%04X.tmp%06xyXXXXXX",
g_get_tmp_dir(), getpid(), 0x1000 + nth, rand() & 0xfffffd);
+ gchar *temp_file = g_strdup_format ("%s/bsewavetool-pid%u-oggchunk%04X.tmp%06xyXXXXXX",
g_get_tmp_dir(), getpid(), 0x1000 + nth, rand() & 0xfffffd);
gint tmpfd = mkstemp (temp_file);
if (tmpfd < 0)
{
@@ -2419,7 +2419,7 @@ public:
{
if (chunk_set[i])
{
- char *x = g_strdup_printf ("%4.2f ", chunk_data.freqs[i]);
+ char *x = g_strdup_format ("%4.2f ", chunk_data.freqs[i]);
result += x;
g_free (x);
}
@@ -2888,18 +2888,18 @@ public:
cent = bse_note_fine_tune_from_note_freq (BSE_MUSICAL_TUNING_12_TET, note,
gsl_data_handle_osc_freq (dhandle));
}
- name_addon = g_strdup_printf ("%d", note);
+ name_addon = g_strdup_format ("%d", note);
substitute (filename, 'N', name_addon);
g_free (name_addon);
- name_addon = g_strdup_printf ("%.2f", gsl_data_handle_osc_freq (dhandle));
+ name_addon = g_strdup_format ("%.2f", gsl_data_handle_osc_freq (dhandle));
substitute (filename, 'F', name_addon);
g_free (name_addon);
if (cent >= 0)
- name_addon = g_strdup_printf ("u%03d", cent); /* up */
+ name_addon = g_strdup_format ("u%03d", cent); /* up */
else
- name_addon = g_strdup_printf ("d%03d", cent); /* down */
+ name_addon = g_strdup_format ("d%03d", cent); /* down */
substitute (filename, 'C', name_addon);
g_free (name_addon);
diff --git a/tools/bwtwave.cc b/tools/bwtwave.cc
index c3b80be..e51ebe3 100644
--- a/tools/bwtwave.cc
+++ b/tools/bwtwave.cc
@@ -244,7 +244,7 @@ Wave::store (const string file_name)
do
{
g_free (temp_file);
- temp_file = g_strdup_printf ("%s.tmp%06xyXXXXXX", file_name.c_str(), rand() & 0xfffffd);
+ temp_file = g_strdup_format ("%s.tmp%06xyXXXXXX", file_name.c_str(), rand() & 0xfffffd);
mktemp (temp_file); /* this is save, due to use of: O_CREAT | O_EXCL */
fd = open (temp_file, O_WRONLY | O_CREAT | O_EXCL, 0666);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]