From patchwork Wed Feb 5 08:12:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Forney X-Patchwork-Id: 193687 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E365BC35249 for ; Wed, 5 Feb 2020 08:13:40 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 709372085B for ; Wed, 5 Feb 2020 08:13:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="S9PydFS7"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=mforney-org.20150623.gappssmtp.com header.i=@mforney-org.20150623.gappssmtp.com header.b="Swv1Cx5b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 709372085B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mforney.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BC4BF1614; Wed, 5 Feb 2020 09:12:48 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BC4BF1614 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1580890418; bh=OHbjJEB0639+qAcJFne2U5HiG1A7AIoEFuImcMDR0Xs=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=S9PydFS7SDuH/421xipdUq/U1wPhyfAPvPwsU1rqvXpfanhpoSO83fwEU+sKGKObz edDBFb2gXqNsxvtcuPW6filsecgOm6CSV1H/ocv8yN8DYMjBvvtzjdf+0idthtvH/D 8IlvRGblYCxe8CfxI1DmIZQXXcIIlYv9DYSJx41k= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 13F81F8014C; Wed, 5 Feb 2020 09:12:48 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5AF5BF80150; Wed, 5 Feb 2020 09:12:46 +0100 (CET) Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7D1BDF800AB for ; Wed, 5 Feb 2020 09:12:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7D1BDF800AB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=mforney-org.20150623.gappssmtp.com header.i=@mforney-org.20150623.gappssmtp.com header.b="Swv1Cx5b" Received: by mail-pg1-x543.google.com with SMTP id z124so561229pgb.13 for ; Wed, 05 Feb 2020 00:12:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mforney-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=wR2IPbO5mn8ThLdUubtaVrM/Xmy7qMj0RvMIXoMH0kw=; b=Swv1Cx5brvmzu0z3odivs56aY7unkJVz2YE6uJ9hgH4dID72O1x4lOjtat4GMpdon6 upPXyvmaIPFfTHM5yyWP1CCx4L4DdS6jMZAFDXxrdpYCvm93sQxe+YmfiRUl4EQ9Ilb4 KjGbHivczU7PVC1IzTLkX3TqIg/P+a1TLOiRURiL00KecXd3dssqAb9SL1CmTKj5f8Qw 9riy4I1Tww+QZav7KskIJuNj+C7qgMHjLSjdg6/e0iuzAC1xNGWXm5QT8le5cpQcn4NF xxmwa+g2OYQu5uWr5stbQ/7EGqBSc+QRl9ByvxAE/FAnDR1Fm1GagZrgPVD+AII5+VXE b6Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=wR2IPbO5mn8ThLdUubtaVrM/Xmy7qMj0RvMIXoMH0kw=; b=eFI6GVsB4kkG26a2CBiDNn2Le6gDwq18ZRNJad6g/NiPEp88js4B3RsecqJoHYGLee RMaeNtobD/r16LmVER45fknRdN+M5IJnbH2cWb4+APcTzSaZD5+0uIdOn3D7uD7xwhWb EnVs62j++Efqlx7Fz8CKbtnC4Jp8XRBbaTdDiejUIS4F/Hh2tvTEvaJe4yhzdA9qH2Gn x+dYppSIOXPo0FffKPeDi08eMBfT9XjGEL47UF10Iwh5Ym3X8xU46gg7jRwy/clr1lkR 9Fr1/OuJ8powecDv2MYeHBxwvv60fSih5lQfU2omF6wIIu5vg9YO2IGq3GZRWbYB0RRY c7vg== X-Gm-Message-State: APjAAAXzFmk6jZKxBYK2XAcJTQwWmE3iHQwaj+dSafTtWHWK+yJCy5UF XqWIQ4iQCA6nnCCsvQC9eFspcOpLtcsQqQ== X-Google-Smtp-Source: APXvYqxlugVbN6o7Op2xB2tfS1CgYjL4yJedIHKMF1xwTQn/I6IRAULZyjMvjfeI9rR49nQrlQH10g== X-Received: by 2002:aa7:8181:: with SMTP id g1mr35805837pfi.215.1580890358672; Wed, 05 Feb 2020 00:12:38 -0800 (PST) Received: from localhost ([2601:647:5180:4570:16dd:a9ff:fee7:6b79]) by smtp.gmail.com with ESMTPSA id d2sm6296486pjv.18.2020.02.05.00.12.37 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Feb 2020 00:12:38 -0800 (PST) From: Michael Forney To: alsa-devel@alsa-project.org Date: Wed, 5 Feb 2020 00:12:18 -0800 Message-Id: <20200205081221.18665-1-mforney@mforney.org> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 Subject: [alsa-devel] [PATCH alsa-utils 1/4] Use __func__ instead of __FUNCTION__ X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" They are equivalent, but __func__ is in C99. __FUNCTION__ exists only for backwards compatibility with old gcc versions. Signed-off-by: Michael Forney --- alsactl/alsactl.h | 16 ++++++++-------- aplay/aplay.c | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/alsactl/alsactl.h b/alsactl/alsactl.h index 4f969ec..69b539c 100644 --- a/alsactl/alsactl.h +++ b/alsactl/alsactl.h @@ -13,15 +13,15 @@ void cerror_(const char *fcn, long line, int cond, const char *fmt, ...); void dbg_(const char *fcn, long line, const char *fmt, ...); #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) -#define info(...) do { info_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0) -#define error(...) do { error_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0) -#define cerror(cond, ...) do { cerror_(__FUNCTION__, __LINE__, (cond) != 0, __VA_ARGS__); } while (0) -#define dbg(...) do { dbg_(__FUNCTION__, __LINE__, __VA_ARGS__); } while (0) +#define info(...) do { info_(__func__, __LINE__, __VA_ARGS__); } while (0) +#define error(...) do { error_(__func__, __LINE__, __VA_ARGS__); } while (0) +#define cerror(cond, ...) do { cerror_(__func__, __LINE__, (cond) != 0, __VA_ARGS__); } while (0) +#define dbg(...) do { dbg_(__func__, __LINE__, __VA_ARGS__); } while (0) #else -#define info(args...) do { info_(__FUNCTION__, __LINE__, ##args); } while (0) -#define error(args...) do { error_(__FUNCTION__, __LINE__, ##args); } while (0) -#define cerror(cond, ...) do { error_(__FUNCTION__, __LINE__, (cond) != 0, ##args); } while (0) -#define dbg(args...) do { dbg_(__FUNCTION__, __LINE__, ##args); } while (0) +#define info(args...) do { info_(__func__, __LINE__, ##args); } while (0) +#define error(args...) do { error_(__func__, __LINE__, ##args); } while (0) +#define cerror(cond, ...) do { error_(__func__, __LINE__, (cond) != 0, ##args); } while (0) +#define dbg(args...) do { dbg_(__func__, __LINE__, ##args); } while (0) #endif int init(const char *file, const char *cardname); diff --git a/aplay/aplay.c b/aplay/aplay.c index 1a887e4..908093c 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -186,13 +186,13 @@ static const struct fmt_capture { #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) #define error(...) do {\ - fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \ + fprintf(stderr, "%s: %s:%d: ", command, __func__, __LINE__); \ fprintf(stderr, __VA_ARGS__); \ putc('\n', stderr); \ } while (0) #else #define error(args...) do {\ - fprintf(stderr, "%s: %s:%d: ", command, __FUNCTION__, __LINE__); \ + fprintf(stderr, "%s: %s:%d: ", command, __func__, __LINE__); \ fprintf(stderr, ##args); \ putc('\n', stderr); \ } while (0) From patchwork Wed Feb 5 08:12:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Forney X-Patchwork-Id: 193686 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07AFFC35249 for ; Wed, 5 Feb 2020 08:15:22 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 842CF2085B for ; Wed, 5 Feb 2020 08:15:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="h0pspzWo"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=mforney-org.20150623.gappssmtp.com header.i=@mforney-org.20150623.gappssmtp.com header.b="fJxIqivg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 842CF2085B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mforney.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BEEE71612; Wed, 5 Feb 2020 09:14:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BEEE71612 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1580890519; bh=VBVl4XanJm7PtaEaIcanVf7HgYwXcz//WaFkMv/Z0Bc=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=h0pspzWousqYYj+AT9WS+LsxDUjBLcsi3otO4RJ7+GIs5FbkqxElZKBE+ybQC8JsJ 85TMS5gi64d4ZSShm3na0ECbuHfr59Vs7dV55RnbMfbNmN5JHeclbCg7kM497bo6wM lARgx/zjH14BpZS2bYROIXbDGtW5JZslH8bsPCQ0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 108C9F80276; Wed, 5 Feb 2020 09:12:51 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9BF01F800E2; Wed, 5 Feb 2020 09:12:48 +0100 (CET) Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8AA12F80142 for ; Wed, 5 Feb 2020 09:12:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8AA12F80142 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=mforney-org.20150623.gappssmtp.com header.i=@mforney-org.20150623.gappssmtp.com header.b="fJxIqivg" Received: by mail-pj1-x1042.google.com with SMTP id ep11so647715pjb.2 for ; Wed, 05 Feb 2020 00:12:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mforney-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=P8r21QMMGkJeSJhVb6hST1YZPwdoY3sIDKu+bNMCcJg=; b=fJxIqivgKiduf/CqgDhrRJoJnYt6nNLPiwVZn2m1krcv8vZcL1RfXaEpUZv9QI4Djo VZmSHRpEg5K32X41HvK5+M7FaLXJezSzEtfi1qYvT7mbWmA06N9YmfrlQKPVtIst7wYm z3qYODp3kHOEhB99XrHaIHIx2uzr2M0QNmRUG07U4/FfOzkedCu2IPC6xXir2GgC5cof x9aoXsjoEmoLwb/8HRQvLHnsr7cjiGmJevMGyhTByWz8QN5n/TiqWC1mKIW4C4svL8AG uJExS4tXGAfqfcmQTzzJcXjSYyHbzGZ3Ix8d1N0A8tc0tyPT57G/vc9dmNS04IU/Ch1P TzmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P8r21QMMGkJeSJhVb6hST1YZPwdoY3sIDKu+bNMCcJg=; b=gHd9ql1CkBHHJ+cvomDNUleiD59dKUr220sacs7yWouaoveFOrR+18at+8V250+qNU buLOT3WQIds4w5xa345zvkp7s/lcfqliMdzVFVUYToGHKsRST0GzV5/+vC+X6LZhncIF AFwf1mpOaNIPRkqNtX/FoCB5TgKW6Xij9vCcECxkVQ/tC8kQLvAU7HPfEtrNGXtnP/N/ Ql4ZJqMFWlqIS9ZIGNf9yM25OFXqqhIzhDJwnLdUY++SrCxMCKHd0IW7sAqH5VBZLnfS MZYm8mBZT2ekQ5USIliJ4gp/AxrgBZtYnQ8sbF4giTUZ5ihQFZlRdAjjdnw0sh6xQ7La qmuA== X-Gm-Message-State: APjAAAWtOSyJIJ/yyzCjijEubjsOa5mp674dvU3skiOz2WFGJz3szgAI g6SAtzLC11QUiwcuwnqLBGVb/nxKDpHenA== X-Google-Smtp-Source: APXvYqyo6PZjxQc7RKGvKwR1sZngDuo1cN4DRtivXtWuoN5GEmJzUQxtw08+yrrTmKGyS6IXxlAmcg== X-Received: by 2002:a17:90a:9f83:: with SMTP id o3mr4232602pjp.95.1580890361287; Wed, 05 Feb 2020 00:12:41 -0800 (PST) Received: from localhost ([2601:647:5180:4570:16dd:a9ff:fee7:6b79]) by smtp.gmail.com with ESMTPSA id p4sm14792502pgh.14.2020.02.05.00.12.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Feb 2020 00:12:40 -0800 (PST) From: Michael Forney To: alsa-devel@alsa-project.org Date: Wed, 5 Feb 2020 00:12:20 -0800 Message-Id: <20200205081221.18665-3-mforney@mforney.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200205081221.18665-1-mforney@mforney.org> References: <20200205081221.18665-1-mforney@mforney.org> MIME-Version: 1.0 Subject: [alsa-devel] [PATCH alsa-utils 3/4] Use %lli for long long in printf X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 --- 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 38e85c0..22e0269 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 928f7c5..4c19a58 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));