Skip to contentSkip to conversation

conf: Remove left justification for SND_CONFIG_TYPE_REAL

PATCH New Simon Christensson 1 participant 1 message Feb 16, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 conf: Remove left justification for SND_CONFIG_TYPE_REAL

In order to avoid extra padding replace data type "%-16g" (left justification) with default right justification "%16g" when printing snd_config type SND_CONFIG_TYPE_REAL.

Example for control "min_dB" available in softvol:

Before patch: "min_dB -50 "

After patch: "min_dB -50.0"

From d9f44bea28844d4aa273b6907da81d4167a35e52 Mon Sep 17 00:00:00 2001
From: Simon Christensson <[email protected]>
Date: Tue, 15 Feb 2022 10:40:38 +0100
Subject: [PATCH] conf: Remove left-justify for SND_CONFIG_TYPE_REAL

In order to avoid padding and to print at least on decimal for node type SND_CONFIG_TYPE_REAL use default right-justification.

Change-Id: I41400901ee9f0a43771afc5d42ee69eac980883c

---
 src/conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/conf.c +1 -1
index 70f0e773..fba2907a 100644
@@ -1633,7 +1633,7 @@ int _snd_config_save_node_value(snd_config_t *n, snd_output_t *out,
 		snd_output_printf(out, "%lld", n->u.integer64);
 		break;
 	case SND_CONFIG_TYPE_REAL:
-		snd_output_printf(out, "%-16g", n->u.real);
+		snd_output_printf(out, "%16g", n->u.real);
 		break;
 	case SND_CONFIG_TYPE_STRING:
 		string_print(n->u.string, 0, out);
Signature · 1 line
2.20.1