Merge pull request #11353 from kvuorine/fwknop-fixes
[feed/packages.git] / utils / dump1090 / patches / 010-gcc10.patch
1 From 0793c64ee8ebbcea86b7a9dc71c7e28ec08db618 Mon Sep 17 00:00:00 2001
2 From: Oliver Jowett <oliver.jowett@flightaware.com>
3 Date: Sat, 6 Jun 2020 21:52:04 +0800
4 Subject: [PATCH] Clean up linkage of struct Modes to actually make sense.
5
6 (how did this work before? But it's been unchanged since at least
7 2013..)
8
9 Maybe fixes #65
10 ---
11 dump1090.c | 2 ++
12 dump1090.h | 6 ++++--
13 faup1090.c | 2 ++
14 view1090.c | 3 +++
15 4 files changed, 11 insertions(+), 2 deletions(-)
16
17 diff --git a/dump1090.c b/dump1090.c
18 index 2b5c4dce..bc1a7bb9 100644
19 --- a/dump1090.c
20 +++ b/dump1090.c
21 @@ -51,6 +51,8 @@
22
23 #include <stdarg.h>
24
25 +struct _Modes Modes;
26 +
27 //
28 // ============================= Utility functions ==========================
29 //
30 diff --git a/dump1090.h b/dump1090.h
31 index 5c7cf73e..1afc3d35 100644
32 --- a/dump1090.h
33 +++ b/dump1090.h
34 @@ -295,7 +295,7 @@ struct mag_buf {
35 };
36
37 // Program global state
38 -struct { // Internal state
39 +struct _Modes { // Internal state
40 pthread_t reader_thread;
41
42 pthread_mutex_t data_mutex; // Mutex to synchronize buffer access
43 @@ -397,7 +397,9 @@ struct { // Internal state
44 int stats_latest_1min;
45 struct stats stats_5min;
46 struct stats stats_15min;
47 -} Modes;
48 +};
49 +
50 +extern struct _Modes Modes;
51
52 // The struct we use to store information about a decoded message.
53 struct modesMessage {
54 diff --git a/faup1090.c b/faup1090.c
55 index cd2be929..cf83db9d 100644
56 --- a/faup1090.c
57 +++ b/faup1090.c
58 @@ -49,6 +49,8 @@
59
60 #include "dump1090.h"
61
62 +struct _Modes Modes;
63 +
64 #include <stdarg.h>
65
66 void receiverPositionChanged(float lat, float lon, float alt)
67 diff --git a/view1090.c b/view1090.c
68 index ae925f5e..a8797bb8 100644
69 --- a/view1090.c
70 +++ b/view1090.c
71 @@ -28,6 +28,9 @@
72 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
73 //
74 #include "dump1090.h"
75 +
76 +struct _Modes Modes;
77 +
78 //
79 // ============================= Utility functions ==========================
80 //