From patchwork Thu Jan 23 20:21:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thorsten Glaser X-Patchwork-Id: 11349223 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 94E4F924 for ; Thu, 23 Jan 2020 20:35: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 2BAF121835 for ; Thu, 23 Jan 2020 20:35: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="ql6IiHV9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2BAF121835 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=tarent.de 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 7311B169F; Thu, 23 Jan 2020 21:34:47 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7311B169F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1579811731; bh=WTdfiP7+9LyKrCnOQQ1640TKkcHAR1jE6UjXpU8BjsI=; h=In-Reply-To:References:To:From:Date:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ql6IiHV9U//G06gLK4ogKcH/cGNYn/F35UDN3m8M7pbI2mXa2PLSGI2b4oe37ftM1 H3iSl+vCWEUu387+ESg/CtmNZhwds8X/O2mmJAaZa8CXE5SEj9lPhiTs/I5VfXgaYz jZb9DLL5PzKlBEGmdI/KI+7kxJ1HT1wNucnZtgmg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D4FCCF80272; Thu, 23 Jan 2020 21:33:14 +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 6FF54F800BA; Thu, 23 Jan 2020 21:33:13 +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=1.0 required=5.0 tests=SPF_HELO_NONE,SPF_SOFTFAIL autolearn=disabled version=3.4.0 Received: from herc.mirbsd.org (herc.mirbsd.org [IPv6:2001:470:1f15:10c:202:b3ff:feb7:54e8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1C7ABF800BA for ; Thu, 23 Jan 2020 21:33:10 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1C7ABF800BA Received: from herc.mirbsd.org (tg@localhost [IPv6:::1]) by herc.mirbsd.org (8.14.9/8.14.5) with ESMTP id 00NKWWeX016306 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 23 Jan 2020 20:32:34 GMT Received: (from tg@localhost) by herc.mirbsd.org (8.14.9/8.14.5/Submit) id 00NKWWwd018015; Thu, 23 Jan 2020 20:32:32 GMT Message-Id: <202001232032.00NKWWwd018015@herc.mirbsd.org> X-Authentication-Warning: herc.mirbsd.org: tg set sender to t.glaser@tarent.de using -f In-Reply-To: References: <157133531799.6063.9249463816269134459.reportbug@tglase.lan.tarent.de> To: alsa-devel@alsa-project.org MIME-Version: 1.0 From: mirabilos Date: Thu, 23 Jan 2020 21:21:21 +0100 MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by herc.mirbsd.org id 00NKWWwd018015 Cc: 870396@bugs.debian.org Subject: [alsa-devel] [PATCH 3/3] test: explicitly cast time types to types printf can handle 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" Also (as requested by Takashi Iwai), convert timediff() to time_t, as it’s the proper return type. Signed-off-by: mirabilos --- test/latency.c | 10 +++++----- test/queue_timer.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/latency.c b/test/latency.c index 298bab8a..cf39d319 100644 --- a/test/latency.c +++ b/test/latency.c @@ -325,7 +325,7 @@ void setscheduler(void) printf("!!!Scheduler set to Round Robin with priority %i FAILED!!!\n", sched_param.sched_priority); } -long timediff(snd_timestamp_t t1, snd_timestamp_t t2) +time_t timediff(snd_timestamp_t t1, snd_timestamp_t t2) { signed long l; @@ -683,12 +683,12 @@ int main(int argc, char *argv[]) snd_pcm_nonblock(phandle, !block ? 1 : 0); if (ok) { #if 1 - printf("Playback time = %li.%i, Record time = %li.%i, diff = %li\n", - p_tstamp.tv_sec, + printf("Playback time = %lli.%i, Record time = %lli.%i, diff = %lli\n", + (long long)p_tstamp.tv_sec, (int)p_tstamp.tv_usec, - c_tstamp.tv_sec, + (long long)c_tstamp.tv_sec, (int)c_tstamp.tv_usec, - timediff(p_tstamp, c_tstamp)); + (long long)timediff(p_tstamp, c_tstamp)); #endif break; } diff --git a/test/queue_timer.c b/test/queue_timer.c index c4ffb192..c5ce5866 100644 --- a/test/queue_timer.c +++ b/test/queue_timer.c @@ -99,11 +99,11 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) normalize(&diffdiff); prevdiff = diff; - fprintf(stderr, " real time: %12ld sec %8ld usec\nqueue time: %12ld sec %8ld usec\n diff: %12ld sec %8ld usec\n diffdiff: %12ld sec %8ld usec\n", - tv.tv_sec, tv.tv_usec, - (long)rtime->tv_sec, (long)rtime->tv_nsec / 1000, - diff.tv_sec, diff.tv_usec, - (long)diffdiff.tv_sec, (long)diffdiff.tv_usec); + fprintf(stderr, " real time: %12lld sec %8ld usec\nqueue time: %12lld sec %8ld usec\n diff: %12lld sec %8ld usec\n diffdiff: %12lld sec %8ld usec\n", + (long long)tv.tv_sec, (long)tv.tv_usec, + (long long)rtime->tv_sec, (long)rtime->tv_nsec / 1000, + (long long)diff.tv_sec, (long)diff.tv_usec, + (long long)diffdiff.tv_sec, (long)diffdiff.tv_usec); if (diffdiff.tv_usec > 5000 || diffdiff.tv_usec < -5000) {