wok-next diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/jack2/stuff/patches/gcc6.patch	Wed Sep 27 16:49:12 2017 +0200
     1.3 @@ -0,0 +1,62 @@
     1.4 +From ff1ed2c4524095055140370c1008a2d9cccc5645 Mon Sep 17 00:00:00 2001
     1.5 +From: Adrian Knoth <adi@drcomp.erfurt.thur.de>
     1.6 +Date: Sat, 11 Jun 2016 05:35:07 +0200
     1.7 +Subject: [PATCH] Fix initialization in test/iodelay.cpp
     1.8 +
     1.9 +jack_latency_range_t is
    1.10 +
    1.11 +struct _jack_latency_range {
    1.12 +    jack_nframes_t min;
    1.13 +    jack_nframes_t max;
    1.14 +};
    1.15 +
    1.16 +and jack_nframes_t is
    1.17 +
    1.18 +typedef uint32_t        jack_nframes_t;
    1.19 +
    1.20 +so it's unsigned. Initialising it with -1 is invalid (at least in C++14). We cannot use {0, 0}, because latency_cb has
    1.21 +
    1.22 +   jack_latency_range_t range;
    1.23 +   range.min = range.max = 0;
    1.24 +   if ((range.min != capture_latency.min) || (range.max !=
    1.25 +       capture_latency.max)) {
    1.26 +       capture_latency = range;
    1.27 +   }
    1.28 +
    1.29 +so we must not have {0, 0}, otherwise the condition would never be true.
    1.30 +
    1.31 +Using UINT32_MAX should be equivalent to the previous -1.
    1.32 +---
    1.33 + tests/iodelay.cpp | 7 ++++---
    1.34 + 1 file changed, 4 insertions(+), 3 deletions(-)
    1.35 +
    1.36 +diff --git a/tests/iodelay.cpp b/tests/iodelay.cpp
    1.37 +index e1ba63f..1ef470f 100644
    1.38 +--- a/tests/iodelay.cpp
    1.39 ++++ b/tests/iodelay.cpp
    1.40 +@@ -20,6 +20,7 @@
    1.41 + 
    1.42 + #include <stdlib.h>
    1.43 + #include <stdio.h>
    1.44 ++#include <stdint.h>
    1.45 + #include <math.h>
    1.46 + #include <unistd.h>
    1.47 + #include <jack/jack.h>
    1.48 +@@ -167,8 +168,8 @@ static jack_client_t  *jack_handle;
    1.49 + static jack_port_t    *jack_capt;
    1.50 + static jack_port_t    *jack_play;
    1.51 + 
    1.52 +-jack_latency_range_t   capture_latency = {-1, -1};
    1.53 +-jack_latency_range_t   playback_latency = {-1, -1};
    1.54 ++jack_latency_range_t   capture_latency = {UINT32_MAX, UINT32_MAX};
    1.55 ++jack_latency_range_t   playback_latency = {UINT32_MAX, UINT32_MAX};
    1.56 + 
    1.57 + void
    1.58 + latency_cb (jack_latency_callback_mode_t mode, void *arg)
    1.59 +@@ -266,4 +267,4 @@ int main (int ac, char *av [])
    1.60 +     return 0;
    1.61 + }
    1.62 + 
    1.63 +-// --------------------------------------------------------------------------------
    1.64 +\ No newline at end of file
    1.65 ++// --------------------------------------------------------------------------------