From patchwork Wed Nov 20 04:28:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11253035 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F0AF14E5 for ; Wed, 20 Nov 2019 04:30:02 +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 954AE22460 for ; Wed, 20 Nov 2019 04:30:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Juq+f4Jc"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MDyJHePA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 954AE22460 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 565D21689; Wed, 20 Nov 2019 05:29:09 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 565D21689 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1574224199; bh=CwXHxfXsgKkGWLjKW+CVFSabYPUuFquiTZSOGPt+d08=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=Juq+f4JcCxk9rKSJNvn1+L6rh9ny/THhELXsC/Ak4lmNo3fyZiCWoukmViEA5BjIK El4d+h35dhgybvvyCzK4qDxJrx1uSacATXZmkPAbZ9kyO+2DfawTrwROLEtOHjrM9U CBADAK+QyyWN09vdlWSiNQyDOGj3LousBAs5bcXQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BBC9FF8013C; Wed, 20 Nov 2019 05:29:08 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3EC4EF800FF; Wed, 20 Nov 2019 05:29:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) (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 A21C0F800FF for ; Wed, 20 Nov 2019 05:29:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A21C0F800FF Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MDyJHePA" Received: by mail-pl1-x643.google.com with SMTP id e3so13194566plt.7 for ; Tue, 19 Nov 2019 20:29:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=s5lWFvUeOBcFk6YFHqGR6+n59NlM2aTMEft0kV+ckQU=; b=MDyJHePAtP7zG+7VKYQV3EH8VDJRBMIcrlFHt52XVfRefnqS9IpReno5s0ixOWWG0W laXxw4KIfztZPBiINUP7qBaMNJLKN2xCfMlYn61iiuy0zMqUiPviM4m7I8O0e62udOyo C/e5MlHNmYnBcFGyLaHpBr/KKhsDZlVx1HNLOZfEQVRbqpMNP1IwYB8v2u7gdotOimqZ SUI49XDUOKdx+dZLnfZiS7CpJDPx0huLLJOgCIp/w2iFpBYJIESxoRU7l5Bb0O85mG+Y Wcekns0USrYgJd+pXTwqoRiaRRJaBJo2iJUxrGVz+E0+sA5XdCyuZxK2qxrnFLuQdQBH TYeg== 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=s5lWFvUeOBcFk6YFHqGR6+n59NlM2aTMEft0kV+ckQU=; b=BrYwJ7Ujw8GnSP7Tc7DTOHFiiUGrh0LD3+XrIrMP/Qo0XYmrbRf7Q9GVmG/fjFZeu/ nd4gJI5Y3Dxk5LUh57KkZEM9tSzjkFzxqrG1JKxuiZvIv+U49Upru1wXq818L1gNYHyY mCfnN4+9Rq+SmhISyF3FOGPIcINfPrHY/Gr0EjLbX4LkesTMoQ2rkDLMMorAl78A0BHn RJKbxKg8tI6gsqgYejP4xFH9NhXj0IMRfrcXT/vHHjKxViqDjZ3p6nrNcVt7ab7iCi3a ARdjTmjZbzbOq6uHRm+HyZTSbtH2VrMQDT5iqKa/D25oY3Q9Fvs0L4A7++kW/f4HPFOz 1uog== X-Gm-Message-State: APjAAAWKcnhq+nS8eOOWaxFYTK/JELHyzRc6FxCg1Iv8E7OI0GBB1hSb HQiUzhaeB66L9Byj37mOYou57yvU4Fo= X-Google-Smtp-Source: APXvYqyclkxEyIhQUDsnqNycxjK4CWbks2J6pkl+A153vpyhdV6zblBwn2lvymEnyHeskWV7Uodfww== X-Received: by 2002:a17:902:8341:: with SMTP id z1mr887234pln.222.1574224138506; Tue, 19 Nov 2019 20:28:58 -0800 (PST) Received: from mangix-trapnet.lan ([69.42.0.214]) by smtp.gmail.com with ESMTPSA id a6sm5447285pja.30.2019.11.19.20.28.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2019 20:28:57 -0800 (PST) From: Rosen Penev To: alsa-devel@alsa-project.org Date: Tue, 19 Nov 2019 20:28:53 -0800 Message-Id: <20191120042856.415854-1-rosenp@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [alsa-devel] [PATCH 1/4] treewide: sys/poll to poll 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" Fixes warning on musl: warning redirecting incorrect #include to Signed-off-by: Rosen Penev --- amidi/amidi.c | 2 +- amixer/amixer.c | 2 +- aplay/aplay.c | 2 +- seq/aplaymidi/arecordmidi.c | 2 +- seq/aseqdump/aseqdump.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/amidi/amidi.c b/amidi/amidi.c index b6e05e1..c6268e4 100644 --- a/amidi/amidi.c +++ b/amidi/amidi.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/amixer/amixer.c b/amixer/amixer.c index ad9c482..f7f31f0 100644 --- a/amixer/amixer.c +++ b/amixer/amixer.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include "amixer.h" #include "../alsamixer/volume_mapping.h" diff --git a/aplay/aplay.c b/aplay/aplay.c index 274bbce..5241068 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/seq/aplaymidi/arecordmidi.c b/seq/aplaymidi/arecordmidi.c index f3db65e..604cd0d 100644 --- a/seq/aplaymidi/arecordmidi.c +++ b/seq/aplaymidi/arecordmidi.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include "aconfig.h" #include "version.h" diff --git a/seq/aseqdump/aseqdump.c b/seq/aseqdump/aseqdump.c index 7904540..578e06f 100644 --- a/seq/aseqdump/aseqdump.c +++ b/seq/aseqdump/aseqdump.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include "aconfig.h" #include "version.h" From patchwork Wed Nov 20 04:28:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11253037 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 327EE6C1 for ; Wed, 20 Nov 2019 04:30:58 +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 B990D22460 for ; Wed, 20 Nov 2019 04:30:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="cre70TGj"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LBjJhoQv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B990D22460 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 22E6D1696; Wed, 20 Nov 2019 05:30:04 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 22E6D1696 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1574224254; bh=T+aEcyVj9BjZcVxPlXw1L4XHVWUMtS2+tLFb0VoUphQ=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=cre70TGjGlTSFTZSJPmPeEii5Em0qo2yFlmU5hS7x5qOPALB3hqG79O6I5mktzGN5 g/VX9H42p1TU2Yd6xHkkstUhPMefSWef45LK6yPaxH9loaKTZ6/jBW4j6PADmJR0ph bIgGUi2fmCbSr8kwkP/62QuyQCan9fJbAky/TsmI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 87204F8014A; Wed, 20 Nov 2019 05:29:10 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2A457F8014A; Wed, 20 Nov 2019 05:29:06 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) (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 40014F800C1 for ; Wed, 20 Nov 2019 05:29:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 40014F800C1 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LBjJhoQv" Received: by mail-pj1-x1043.google.com with SMTP id f7so3592544pjw.5 for ; Tue, 19 Nov 2019 20:29:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=qtMzY8AGN3QG9aa6nEI7DA8/k3R+/MfhiSaP8tJFdSM=; b=LBjJhoQvqDe3OeE9Ca+ISlgmSstriSGyeywxEVSlUkvpRpJf5qcT8ebqtAUi6w5nnL TbEDFYL9ZVhSKRJszp1s6PwO4tKNIG8FvUEJ++hIrsPiNiZ6r3bOFX7M2JrbqdQMRMqL /tb3HAo75ISkHvCmF7UryBY1ozyRkHzDiOIBBwebxsLY6Qt3TXv/ltugObhCOdJir7Mi /ZIPaQxDyjLNGE3izpJ8ImalaHtPzXMqruEG9RpNjbg+vSyVT/UvSuAfoov32KnDwdft sF8SOu/sVqREXJGa7T5OqZc5o1zeNyjPMYtnOYjCZEg3J7/TcilPoMTi8nRsh+yqgFJr mW/g== 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=qtMzY8AGN3QG9aa6nEI7DA8/k3R+/MfhiSaP8tJFdSM=; b=FcwNgvoaZLBctvf8nrU6GHJKGbjr9UG4znPCYyWsA6R6pz/inYpOQVlXUr0t0g5GFQ pROkMaIJZYxfOw9YezxqhTRR/4FpGKN9XenGF7bKb/FUp+PG4YdYKm54YFGNFG7cYY20 Em4by0MfU2nXLPLoib3pwTLg4q04pCBF6wIX+qT4DTFgO8xQNDJAA6GWq6w+1UsjarL5 cwe5MKlX2tnV7SvCKIu05L2Q9BfEHaV3osbos/xgkE/8OpifpsJHmnKSSOaclZWlZioV im1bqm3n8x1+635WLqnDhx9MY+iXxyecDFefPYfDn35HDU+4emgZnW8YdZsz78LWo4Vy 1Hjw== X-Gm-Message-State: APjAAAURjVBrwvbEDbHJdnyYUv3Bjq/Y/UAeP9zvtG/qiv8bBDIjJJjH htVwacP/4ooZUtwJqm6H6szchtOUjKo= X-Google-Smtp-Source: APXvYqwHCJXwsaxqRuWx1YhLD39HujaWXpKicK0N3YusJLx6hVmdJxqP5UyIJHhZ2PrCvtpdyvLXXQ== X-Received: by 2002:a17:90a:bf16:: with SMTP id c22mr1396930pjs.83.1574224139301; Tue, 19 Nov 2019 20:28:59 -0800 (PST) Received: from mangix-trapnet.lan ([69.42.0.214]) by smtp.gmail.com with ESMTPSA id a6sm5447285pja.30.2019.11.19.20.28.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2019 20:28:58 -0800 (PST) From: Rosen Penev To: alsa-devel@alsa-project.org Date: Tue, 19 Nov 2019 20:28:54 -0800 Message-Id: <20191120042856.415854-2-rosenp@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191120042856.415854-1-rosenp@gmail.com> References: <20191120042856.415854-1-rosenp@gmail.com> MIME-Version: 1.0 Subject: [alsa-devel] [PATCH 2/4] treewide: Fix wrong formats on 32-bit 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" uint64_t evaluates to unsigned long long on 32-bit, not unsigned long. Use the proper formats. Signed-off-by: Rosen Penev --- axfer/container.c | 7 ++++--- axfer/subcmd-transfer.c | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/axfer/container.c b/axfer/container.c index 7da97c6..566acd0 100644 --- a/axfer/container.c +++ b/axfer/container.c @@ -13,6 +13,7 @@ #include #include #include +#include static const char *const cntr_type_labels[] = { [CONTAINER_TYPE_PARSER] = "parser", @@ -356,10 +357,10 @@ int container_context_pre_process(struct container_context *cntr, fprintf(stderr, " frames/second: %u\n", cntr->frames_per_second); if (cntr->type == CONTAINER_TYPE_PARSER) { - fprintf(stderr, " frames: %lu\n", + fprintf(stderr, " frames: %" PRIu64 "\n", *frame_count); } else { - fprintf(stderr, " max frames: %lu\n", + fprintf(stderr, " max frames: %" PRIu64 "\n", *frame_count); } } @@ -427,7 +428,7 @@ int container_context_post_process(struct container_context *cntr, assert(frame_count); if (cntr->verbose && cntr->handled_byte_count > 0) { - fprintf(stderr, " Handled bytes: %lu\n", + fprintf(stderr, " Handled bytes: %" PRIu64 "\n", cntr->handled_byte_count); } diff --git a/axfer/subcmd-transfer.c b/axfer/subcmd-transfer.c index 3ca745a..8746e6f 100644 --- a/axfer/subcmd-transfer.c +++ b/axfer/subcmd-transfer.c @@ -11,6 +11,7 @@ #include "misc.h" #include +#include struct context { struct xfer_context xfer; @@ -389,7 +390,8 @@ static int context_process_frames(struct context *ctx, if (!ctx->xfer.quiet) { fprintf(stderr, - "%s: Expected %lu frames, Actual %lu frames\n", + "%s: Expected %" PRIu64 "frames, " + "Actual %" PRIu64 "frames\n", snd_pcm_stream_name(direction), expected_frame_count, *actual_frame_count); if (ctx->interrupted) { From patchwork Wed Nov 20 04:28:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11253041 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A5B806C1 for ; Wed, 20 Nov 2019 04:32:33 +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 3951022460 for ; Wed, 20 Nov 2019 04:32:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Mubnl69D"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Qb+wAp4Q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3951022460 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 6176D1696; Wed, 20 Nov 2019 05:31:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6176D1696 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1574224351; bh=HICYH6aQrEfX4Wd/YG56HHUqbcuOFvytu8JSMaiHjP8=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Mubnl69DGrlZgVku3KhgBN1sDtPhahjdoZlOdjmAPpFyTl33W6WzQf5E4It7Jq/Cl r5+SPMHNw0kc+jHzGILoZHgbBHbnaKuWmyRqpY9/VaxeSxkcg0wrLnDMtgdk2tkQJ3 rs62F6Ecoqw8gA9blVCcH0h4gz5B4KyyQUl64cqQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 48868F800FF; Wed, 20 Nov 2019 05:29:13 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id E3E86F8013E; Wed, 20 Nov 2019 05:29:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) (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 9784FF8013D for ; Wed, 20 Nov 2019 05:29:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9784FF8013D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Qb+wAp4Q" Received: by mail-pl1-x641.google.com with SMTP id s10so13205875plp.2 for ; Tue, 19 Nov 2019 20:29:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=4nfCJ/UBWZ4SqL78Yq/S2dIZKyTU02zXWyjyp+B3PUk=; b=Qb+wAp4QKVANVbtFRXv+0uxVC5fPaF2azUy9PUcq9XCtLoCqXePV8FRyzWPWjrwgGa EakjLcQdb0h0dVyyEcrqe4OjnOi6/3lK12RGDiJL7/Uu9AI5lOEiPq8XX6jcnARt1RU5 WEGZvZv/lHelMz9GzuB9Dh7Y3IAAUTjS5n+WEITctx97rZ6uYMDyhtT0+ANqUeh72TbC 5h2FiQ9NrrKZV+npPJF02WXa+/b9RGI/JE/xgy2fJTZBv8Ea51mpA4+BS1LZgcgJMaN1 BDm9RBYVdSfBUWlR2zud/bdDGClK7TRakBq24EulkaYA/kZzF8uGEQqulDrlkgsSW9G5 fcKw== 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=4nfCJ/UBWZ4SqL78Yq/S2dIZKyTU02zXWyjyp+B3PUk=; b=oKXFErMy6vREhvBzBG3jhvScMYeC1nPcKDq9j7VLdZNv8sCITD3PmtcM8LxCtRdvFR Oj6Pz+OYiKOR/O4VBdZr7siaQZy0q1IhQ7fUL9FMfZ5ubY6LRcfQuwabOZGC5QH1WBg6 qczTNAE3tQ79KyPNuT4eSTw1BahWU/LZer1+J5EEet7YYklG4hvtjnDhVQ3R4ms4WkSW Rqcd+XzpD3vRbjsMRYlbbWC3FsajTc7kqt84C/KalrFHFfOPyuQT6++tlxzyFjQfBkmr U9OVL7gAy7+JBBoNyk8B7BarCN22UqjO9JUyhZ+5AJ+3vx3I/puqrUlkk2r+bp6az0e1 BHgQ== X-Gm-Message-State: APjAAAWDmT9dNmPe6tbsrStwLeL1bctVVfMx+xzS3PTqf2hqPq4NLstC 3tnhmAMlHLCrh1z2dm6P2PGzVsSrhOY= X-Google-Smtp-Source: APXvYqyIZ6C7rdbxwaVDvrEvi0HgH719IZ2udiGWBQ6U8oI3du4hbBYyrIU1L0fdUXk9HzpaPUYORA== X-Received: by 2002:a17:90a:db05:: with SMTP id g5mr1480436pjv.5.1574224140021; Tue, 19 Nov 2019 20:29:00 -0800 (PST) Received: from mangix-trapnet.lan ([69.42.0.214]) by smtp.gmail.com with ESMTPSA id a6sm5447285pja.30.2019.11.19.20.28.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2019 20:28:59 -0800 (PST) From: Rosen Penev To: alsa-devel@alsa-project.org Date: Tue, 19 Nov 2019 20:28:55 -0800 Message-Id: <20191120042856.415854-3-rosenp@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191120042856.415854-1-rosenp@gmail.com> References: <20191120042856.415854-1-rosenp@gmail.com> MIME-Version: 1.0 Subject: [alsa-devel] [PATCH 3/4] treewide: Fix printf formats 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" Found with cppcheck Signed-off-by: Rosen Penev --- alsactl/init_parse.c | 4 ++-- alsaloop/pcmjob.c | 10 +++++----- amixer/amixer.c | 6 +++--- aplay/aplay.c | 2 +- axfer/subcmd-list.c | 2 +- axfer/xfer-libffado.c | 2 +- axfer/xfer-options.c | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/alsactl/init_parse.c b/alsactl/init_parse.c index 562e674..c048fd3 100644 --- a/alsactl/init_parse.c +++ b/alsactl/init_parse.c @@ -187,7 +187,7 @@ static int init_space(struct space **space, int card) return -ENOMEM; res->ctl_id_changed = ~0; res->linenum = -1; - sprintf(device, "hw:%u", card); + sprintf(device, "hw:%d", card); err = snd_hctl_open(&res->ctl_handle, device, 0); if (err < 0) goto error; @@ -734,7 +734,7 @@ dbvalue: elem = snd_hctl_elem_next(elem); } snd_ctl_elem_id_free(id); - sprintf(res, "%u", index); + sprintf(res, "%d", index); dbg("do_ctl_count found %s controls", res); return res; } diff --git a/alsaloop/pcmjob.c b/alsaloop/pcmjob.c index 29d1aba..b252486 100644 --- a/alsaloop/pcmjob.c +++ b/alsaloop/pcmjob.c @@ -120,7 +120,7 @@ static int setparams_stream(struct loopback_handle *lhandle, } err = snd_pcm_hw_params_set_rate_resample(handle, params, lhandle->resample); if (err < 0) { - logit(LOG_CRIT, "Resample setup failed for %s (val %i): %s\n", lhandle->id, lhandle->resample, snd_strerror(err)); + logit(LOG_CRIT, "Resample setup failed for %s (val %u): %s\n", lhandle->id, lhandle->resample, snd_strerror(err)); return err; } err = snd_pcm_hw_params_set_access(handle, params, lhandle->access); @@ -135,13 +135,13 @@ static int setparams_stream(struct loopback_handle *lhandle, } err = snd_pcm_hw_params_set_channels(handle, params, lhandle->channels); if (err < 0) { - logit(LOG_CRIT, "Channels count (%i) not available for %s: %s\n", lhandle->channels, lhandle->id, snd_strerror(err)); + logit(LOG_CRIT, "Channels count (%u) not available for %s: %s\n", lhandle->channels, lhandle->id, snd_strerror(err)); return err; } rrate = lhandle->rate_req; err = snd_pcm_hw_params_set_rate_near(handle, params, &rrate, 0); if (err < 0) { - logit(LOG_CRIT, "Rate %iHz not available for %s: %s\n", lhandle->rate_req, lhandle->id, snd_strerror(err)); + logit(LOG_CRIT, "Rate %uHz not available for %s: %s\n", lhandle->rate_req, lhandle->id, snd_strerror(err)); return err; } rrate = 0; @@ -152,7 +152,7 @@ static int setparams_stream(struct loopback_handle *lhandle, !lhandle->loopback->src_enable && #endif (int)rrate != lhandle->rate) { - logit(LOG_CRIT, "Rate does not match (requested %iHz, got %iHz, resample %i)\n", lhandle->rate, rrate, lhandle->resample); + logit(LOG_CRIT, "Rate does not match (requested %uHz, got %uHz, resample %u)\n", lhandle->rate, rrate, lhandle->resample); return -EINVAL; } lhandle->pitch = (double)lhandle->rate_req / (double)lhandle->rate; @@ -1613,7 +1613,7 @@ __again: if (count > loop->play->buffer_size) count = loop->play->buffer_size; if (err != count) { - logit(LOG_CRIT, "%s: initial playback fill error (%i/%i/%i)\n", loop->id, err, (int)count, loop->play->buffer_size); + logit(LOG_CRIT, "%s: initial playback fill error (%i/%i/%u)\n", loop->id, err, (int)count, loop->play->buffer_size); err = -EIO; goto __error; } diff --git a/amixer/amixer.c b/amixer/amixer.c index f7f31f0..928f7c5 100644 --- a/amixer/amixer.c +++ b/amixer/amixer.c @@ -465,7 +465,7 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_ size = tlv[idx++]; tlv_size -= 2 * sizeof(unsigned int); if (size > tlv_size) { - printf("TLV size error (%i, %i, %i)!\n", type, size, tlv_size); + printf("TLV size error (%u, %u, %u)!\n", type, size, tlv_size); return; } switch (type) { @@ -576,7 +576,7 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_ break; #endif default: - printf("unk-%i-", type); + printf("unk-%u-", type); while (size > 0) { printf("0x%08x,", tlv[idx++]); size -= sizeof(unsigned int); @@ -611,7 +611,7 @@ static int show_control(const char *space, snd_hctl_elem_t *elem, } count = snd_ctl_elem_info_get_count(info); type = snd_ctl_elem_info_get_type(info); - printf("%s; type=%s,access=%s,values=%i", space, control_type(info), control_access(info), count); + printf("%s; type=%s,access=%s,values=%u", space, control_type(info), control_access(info), count); switch (type) { case SND_CTL_ELEM_TYPE_INTEGER: printf(",min=%li,max=%li,step=%li\n", diff --git a/aplay/aplay.c b/aplay/aplay.c index 5241068..72fa567 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -3346,7 +3346,7 @@ static void playbackv(char **names, unsigned int count) } alloced = 1; } else if (count != channels) { - error(_("You need to specify %d files"), channels); + error(_("You need to specify %u files"), channels); prg_exit(EXIT_FAILURE); } diff --git a/axfer/subcmd-list.c b/axfer/subcmd-list.c index e22628c..359f73f 100644 --- a/axfer/subcmd-list.c +++ b/axfer/subcmd-list.c @@ -31,7 +31,7 @@ static int dump_device(snd_ctl_t *handle, const char *id, const char *name, snd_pcm_info_get_name(info)); count = snd_pcm_info_get_subdevices_count(info); - printf(" Subdevices: %i/%i\n", + printf(" Subdevices: %i/%u\n", snd_pcm_info_get_subdevices_avail(info), count); for (i = 0; i < count; ++i) { diff --git a/axfer/xfer-libffado.c b/axfer/xfer-libffado.c index a37cce6..6db835d 100644 --- a/axfer/xfer-libffado.c +++ b/axfer/xfer-libffado.c @@ -440,7 +440,7 @@ static int xfer_libffado_pre_process(struct xfer_context *xfer, } if (*samples_per_frame != channels) { fprintf(stderr, - "The number of samples per frame should be %i.\n", + "The number of samples per frame should be %u.\n", channels); return -EINVAL; } diff --git a/axfer/xfer-options.c b/axfer/xfer-options.c index 352d126..3740b16 100644 --- a/axfer/xfer-options.c +++ b/axfer/xfer-options.c @@ -238,7 +238,7 @@ static int validate_options(struct xfer_context *xfer) xfer->frames_per_second *= 1000; if (xfer->frames_per_second < 2000 || xfer->frames_per_second > 192000) { - fprintf(stderr, "bad speed value '%i'\n", val); + fprintf(stderr, "bad speed value '%u'\n", val); return -EINVAL; } From patchwork Wed Nov 20 04:28:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rosen Penev X-Patchwork-Id: 11253039 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 124946C1 for ; Wed, 20 Nov 2019 04:31:44 +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 9B6182240D for ; Wed, 20 Nov 2019 04:31:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="W4BZWSAW"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TdDqEiPh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B6182240D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 4A49016A3; Wed, 20 Nov 2019 05:30:50 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4A49016A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1574224301; bh=cJTqw6aKkyDxCiM1cSIAtk+8XPBb0utW7ijNU0FEyrE=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=W4BZWSAWQdV7OaqP7mc0HMQZTYqq4GRwyIjIE0ZMOAx1eI2tCQzFKB3N7NNxrKpCO +EdLpEZW40GiO1FAPQ+bxBSSHypHJOi/JBHtk2lTfvAZIDOB8+/awPnihJOHfcWRq5 0O875WRjRe0iK6mjgVTJkvHp59//Os2KuhV94dtQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CAB0FF8014F; Wed, 20 Nov 2019 05:29:11 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id B4662F800FF; Wed, 20 Nov 2019 05:29:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (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 D2525F8013E for ; Wed, 20 Nov 2019 05:29:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D2525F8013E Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TdDqEiPh" Received: by mail-pf1-x444.google.com with SMTP id c13so13559489pfp.5 for ; Tue, 19 Nov 2019 20:29:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=6pJPh01pMemYS+jhC5QWYxBUq3Dcy/FkJCK6VSKpF+Q=; b=TdDqEiPh3g6ibfqBMC8y5O+MFum6u/hDqENjVSuSsMxu6Ugok0rAwR8KIZWqtvOmzJ Dx+ukx8JnUjwpOxgjRLNvoyAcLLSZGGvAkrOk2pU75Jiw2cRj44vXkeQ3hRKbjSTcSaY wtQWV9oMrb71uU6mnPtWY+tRJ19P+MPubfUHtjzegLQgi0/Wywqiaw3236bHKxsbwzyj hcEZv5pFIKjn9vXQGT/S8qa4vb7S4asxogNW5b0+99ALOX2ad9MdxHgM2rvD3SUfl78h U+4JPIp2jt5LyCiXMblVYbZHvJGte5ZN868lxLSqB0If2CEhe0IOS/8TRbFlKi9UFaED oaig== 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=6pJPh01pMemYS+jhC5QWYxBUq3Dcy/FkJCK6VSKpF+Q=; b=lb8lbpN1103WTPmk3Q620D9/rs2H/veZLvuHybeQllkUcHIED8Z5FEH/AplKviVIg5 2iITA7wyhl3JJxnSbTjR5XcWdC9CKJWFCNWHygfqwgj2l1hK7PHJBZlxpzHDPl/KJEgW iNggix7y74EhRn/4nh16NXjfy5HAjB6vMo3yHlsJvfs2Vq5DFHjJKwBxPEAU3Ipcx2y6 sXkO5N1A4jYLl26mu/LTvfqhKXR0fMQrUTzHzHtmItwHlEh/m+NlkbA78hG4hnZtnwYF wBN63uJIWQIyh3AnAPET7r3xmjwQQXZUsRX60SOhWetuzIYljoCiEFc+SIQHu3oB9+B7 glsQ== X-Gm-Message-State: APjAAAVjGIR3P8aV+EzIV0TQepnqGF5zbVLibfsHzgR0PIVHOVo1Goqf gvLKNT+XcLBOVDvdZJ3KOFvn0oTz6PQ= X-Google-Smtp-Source: APXvYqx4MyYmyNvGjAgOGFvbZL+H6kc32FBg65NcN+fgtYJ6nFJ429tTIUAbPbiLoYuvVJBpj7K62w== X-Received: by 2002:a63:5551:: with SMTP id f17mr822944pgm.287.1574224140694; Tue, 19 Nov 2019 20:29:00 -0800 (PST) Received: from mangix-trapnet.lan ([69.42.0.214]) by smtp.gmail.com with ESMTPSA id a6sm5447285pja.30.2019.11.19.20.29.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Nov 2019 20:29:00 -0800 (PST) From: Rosen Penev To: alsa-devel@alsa-project.org Date: Tue, 19 Nov 2019 20:28:56 -0800 Message-Id: <20191120042856.415854-4-rosenp@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191120042856.415854-1-rosenp@gmail.com> References: <20191120042856.415854-1-rosenp@gmail.com> MIME-Version: 1.0 Subject: [alsa-devel] [PATCH 4/4] aplay: Limit VUMeter progress bar to 100 for negative as well 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" If the progress bar somehow becomes negative, it ends up overwritting tmp. Fixes this GCC warning: aplay.c:1747:18: warning: '%02d' directive writing between 2 and 11 bytes into a region of size 4 [-Wformat-overflow=] 1747 | sprintf(tmp, "%02d%%", maxperc[c]); Signed-off-by: Rosen Penev --- aplay/aplay.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aplay/aplay.c b/aplay/aplay.c index 72fa567..9c5a11b 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -54,6 +54,8 @@ #include "formats.h" #include "version.h" +#define ABS(a) (a) < 0 ? -(a) : (a) + #ifdef SND_CHMAP_API_VERSION #define CONFIG_SUPPORT_CHMAP 1 #endif @@ -1741,7 +1743,7 @@ static void print_vu_meter_stereo(int *perc, int *maxperc) line[bar_length + 6 + 1 + p] = '+'; else line[bar_length - p - 1] = '+'; - if (maxperc[c] > 99) + if (ABS(maxperc[c]) > 99) sprintf(tmp, "MAX"); else sprintf(tmp, "%02d%%", maxperc[c]);