[PATCH 3/3] test: explicitly cast time types to types printf can handle

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

 



Also (as requested by Takashi Iwai), convert timediff() to time_t,
as it’s the proper return type.

Signed-off-by: mirabilos <tg@xxxxxxxxxx>
---
 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) {
-- 
2.25.0

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel




[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