wok-next view jack2/stuff/patches/gcc6.patch @ rev 20068
Up libcanberra (gtk2 and gtk3 support), vala (0.36.4), dconf (0.26.0), gucharmap3 (10.0.0), pycairo (1.15.3), pygobject3 (3.26.0), libgtop. Add dconf-editor, gtksourceview3.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue Oct 24 17:49:57 2017 +0300 (2017-10-24) |
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 +// --------------------------------------------------------------------------------