wok-next view jack2/stuff/patches/gcc6.patch @ rev 19867

Up mplayer-cli (1.3.0)
author Xander Ziiryanoff <psychomaniak@xakep.ru>
date Wed Sep 27 16:49:12 2017 +0200 (2017-09-27)
parents
children
line source
1 From ff1ed2c4524095055140370c1008a2d9cccc5645 Mon Sep 17 00:00:00 2001
2 From: Adrian Knoth <adi@drcomp.erfurt.thur.de>
3 Date: Sat, 11 Jun 2016 05:35:07 +0200
4 Subject: [PATCH] Fix initialization in test/iodelay.cpp
6 jack_latency_range_t is
8 struct _jack_latency_range {
9 jack_nframes_t min;
10 jack_nframes_t max;
11 };
13 and jack_nframes_t is
15 typedef uint32_t jack_nframes_t;
17 so it's unsigned. Initialising it with -1 is invalid (at least in C++14). We cannot use {0, 0}, because latency_cb has
19 jack_latency_range_t range;
20 range.min = range.max = 0;
21 if ((range.min != capture_latency.min) || (range.max !=
22 capture_latency.max)) {
23 capture_latency = range;
24 }
26 so we must not have {0, 0}, otherwise the condition would never be true.
28 Using UINT32_MAX should be equivalent to the previous -1.
29 ---
30 tests/iodelay.cpp | 7 ++++---
31 1 file changed, 4 insertions(+), 3 deletions(-)
33 diff --git a/tests/iodelay.cpp b/tests/iodelay.cpp
34 index e1ba63f..1ef470f 100644
35 --- a/tests/iodelay.cpp
36 +++ b/tests/iodelay.cpp
37 @@ -20,6 +20,7 @@
39 #include <stdlib.h>
40 #include <stdio.h>
41 +#include <stdint.h>
42 #include <math.h>
43 #include <unistd.h>
44 #include <jack/jack.h>
45 @@ -167,8 +168,8 @@ static jack_client_t *jack_handle;
46 static jack_port_t *jack_capt;
47 static jack_port_t *jack_play;
49 -jack_latency_range_t capture_latency = {-1, -1};
50 -jack_latency_range_t playback_latency = {-1, -1};
51 +jack_latency_range_t capture_latency = {UINT32_MAX, UINT32_MAX};
52 +jack_latency_range_t playback_latency = {UINT32_MAX, UINT32_MAX};
54 void
55 latency_cb (jack_latency_callback_mode_t mode, void *arg)
56 @@ -266,4 +267,4 @@ int main (int ac, char *av [])
57 return 0;
58 }
60 -// --------------------------------------------------------------------------------
61 \ No newline at end of file
62 +// --------------------------------------------------------------------------------