[PATCH] conf: Remove left justification for SND_CONFIG_TYPE_REAL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <simochr@xxxxxxxx>
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(-)

diff --git a/src/conf.c b/src/conf.c
index 70f0e773..fba2907a 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -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);
-- 
2.20.1


[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux