From 7f5d22f616550498d367e5412a92dd8ffdf4555e Mon Sep 17 00:00:00 2001 From: "Reynaldo H. Verdejo Pinochet" Date: Wed, 1 Mar 2017 15:06:59 -0800 Subject: [PATCH] validate: report: avoid unnecessary calls to _append_printf Additionally: simplify %format magic used for padding --- validate/gst/validate/gst-validate-report.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/validate/gst/validate/gst-validate-report.c b/validate/gst/validate/gst-validate-report.c index 730c1e87a3..f62a8bb5f7 100644 --- a/validate/gst/validate/gst-validate-report.c +++ b/validate/gst/validate/gst-validate-report.c @@ -886,9 +886,9 @@ gst_validate_printf_valist (gpointer source, const gchar * format, va_list args) GstValidateActionType *type = GST_VALIDATE_ACTION_TYPE (source); g_string_assign (string, "\nAction type:"); - g_string_append_printf (string, "\n Name: %s", type->name); - g_string_append_printf (string, "\n Implementer namespace: %s", - type->implementer_namespace); + g_string_append_printf (string, + "\n Name: %s\n Implementer namespace: %s", + type->name, type->implementer_namespace); if (IS_CONFIG_ACTION_TYPE (type->flags)) g_string_append_printf (string, @@ -918,13 +918,12 @@ gst_validate_printf_valist (gpointer source, const gchar * format, va_list args) if ((type->flags & GST_VALIDATE_ACTION_TYPE_CAN_BE_OPTIONAL)) { has_parameters = TRUE; - g_string_append_printf (string, "\n %-26s : %s", "optional", - "Don't raise an error if this action hasn't been executed or failed"); - g_string_append_printf (string, "\n %-28s %s", "", - "Possible types:"); - g_string_append_printf (string, "\n %-31s %s", "", "boolean"); - g_string_append_printf (string, "\n %-28s %s", "", - "Default: false"); + g_string_append_printf (string, + "\n optional : " + "Don't raise an error if this action hasn't been executed of failed" + "\n%-32s Possible types:" + "\n%-32s boolean" + "\n%-32s Default: false","","",""); } if (!has_parameters)