SHA256
1
0
forked from pool/alsa-utils
alsa-utils/0034-Use-lli-for-long-long-in-printf.patch
Takashi Iwai 3a62bf6334 Accepting request 774839 from home:tiwai:branches:multimedia:libs
- Backport upstream fixes:
  alsatplg fixes, misc cleanups:
  0027-alsatplg-rewrite-to-use-the-new-libatopology-functio.patch
  0028-alsatplg-add-V-version-option.patch
  0029-alsatplg-add-decode-command.patch
  0030-alsatplg-add-documentation-for-z-dapm-nosort-h.patch
  0031-configure-fix-new-libatopology-check.patch
  0032-Use-__func__-instead-of-__FUNCTION__.patch
  0033-Avoid-pointer-arithmetic-on-void.patch
  0034-Use-lli-for-long-long-in-printf.patch
  0035-Avoid-empty-initializer-list.patch
- Fix build on SLE12-* target

OBS-URL: https://build.opensuse.org/request/show/774839
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa-utils?expand=0&rev=167
2020-02-17 11:44:32 +00:00

60 lines
2.3 KiB
Diff

From 646b3b1c0badbfd1b2ea7b82eb59d43a460c531c Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Wed, 5 Feb 2020 00:12:20 -0800
Subject: [PATCH 34/35] Use %lli for long long in printf
The `L` length modifier only applies to floating-point conversion
specifiers, and `ll` is used for `long long` integers.
Although glibc accepts %Li, musl does not and returns EINVAL.
Signed-off-by: Michael Forney <mforney@mforney.org>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
alsactl/state.c | 4 ++--
amixer/amixer.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/alsactl/state.c b/alsactl/state.c
index 38e85c06c0b0..22e0269fd30a 100644
--- a/alsactl/state.c
+++ b/alsactl/state.c
@@ -336,9 +336,9 @@ static int get_control(snd_ctl_t *handle, snd_ctl_elem_id_t *id, snd_config_t *t
long long max = snd_ctl_elem_info_get_max64(info);
long long step = snd_ctl_elem_info_get_step64(info);
if (step)
- sprintf(buf, "%Li - %Li (step %Li)", min, max, step);
+ sprintf(buf, "%lli - %lli (step %lli)", min, max, step);
else
- sprintf(buf, "%Li - %Li", min, max);
+ sprintf(buf, "%lli - %lli", min, max);
err = snd_config_string_add(comment, "range", buf);
if (err < 0) {
error("snd_config_string_add: %s", snd_strerror(err));
diff --git a/amixer/amixer.c b/amixer/amixer.c
index 928f7c5d6482..4c19a583e5b1 100644
--- a/amixer/amixer.c
+++ b/amixer/amixer.c
@@ -620,7 +620,7 @@ static int show_control(const char *space, snd_hctl_elem_t *elem,
snd_ctl_elem_info_get_step(info));
break;
case SND_CTL_ELEM_TYPE_INTEGER64:
- printf(",min=%Li,max=%Li,step=%Li\n",
+ printf(",min=%lli,max=%lli,step=%lli\n",
snd_ctl_elem_info_get_min64(info),
snd_ctl_elem_info_get_max64(info),
snd_ctl_elem_info_get_step64(info));
@@ -662,7 +662,7 @@ static int show_control(const char *space, snd_hctl_elem_t *elem,
printf("%li", snd_ctl_elem_value_get_integer(control, idx));
break;
case SND_CTL_ELEM_TYPE_INTEGER64:
- printf("%Li", snd_ctl_elem_value_get_integer64(control, idx));
+ printf("%lli", snd_ctl_elem_value_get_integer64(control, idx));
break;
case SND_CTL_ELEM_TYPE_ENUMERATED:
printf("%u", snd_ctl_elem_value_get_enumerated(control, idx));
--
2.16.4