You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.5 KiB

  1. From 5119c21ae56f1c7fd0b10250d1beca9634bf74af Mon Sep 17 00:00:00 2001
  2. From: Mictronics <github@mictronics.de>
  3. Date: Sun, 14 Jun 2020 18:06:22 +0200
  4. Subject: [PATCH] Clean up linkage of struct Modes.
  5. ---
  6. readsb.c | 2 ++
  7. readsb.h | 6 ++++--
  8. viewadsb.c | 2 ++
  9. 3 files changed, 8 insertions(+), 2 deletions(-)
  10. diff --git a/readsb.c b/readsb.c
  11. index e784d891..d6dab324 100644
  12. --- a/readsb.c
  13. +++ b/readsb.c
  14. @@ -57,6 +57,8 @@
  15. #include <stdarg.h>
  16. +struct _Modes Modes;
  17. +
  18. //
  19. // ============================= Program options help ==========================
  20. //
  21. diff --git a/readsb.h b/readsb.h
  22. index 3a1b22d5..1b80c338 100644
  23. --- a/readsb.h
  24. +++ b/readsb.h
  25. @@ -312,7 +312,7 @@ struct mag_buf
  26. // Program global state
  27. -struct
  28. +struct _Modes
  29. { // Internal state
  30. pthread_cond_t data_cond; // Conditional variable associated
  31. pthread_t reader_thread;
  32. @@ -412,7 +412,9 @@ struct
  33. struct stats stats_15min;
  34. struct timespec reader_cpu_accumulator; // CPU time used by the reader thread, copied out and reset by the main thread under the mutex
  35. struct mag_buf mag_buffers[MODES_MAG_BUFFERS]; // Converted magnitude buffers from RTL or file input
  36. -} Modes;
  37. +};
  38. +
  39. +extern struct _Modes Modes;
  40. // The struct we use to store information about a decoded message.
  41. diff --git a/viewadsb.c b/viewadsb.c
  42. index ad7b1bd0..915305b6 100644
  43. --- a/viewadsb.c
  44. +++ b/viewadsb.c
  45. @@ -54,6 +54,8 @@
  46. #include "readsb.h"
  47. #include "help.h"
  48. +struct _Modes Modes;
  49. +
  50. #define _stringize(x) x
  51. #define verstring(x) _stringize(x)