Skip to content

Commit

Permalink
Clean up linkage of struct Modes to actually make sense.
Browse files Browse the repository at this point in the history
(how did this work before? But it's been unchanged since at least
2013..)

Maybe fixes #65
  • Loading branch information
mutability committed Jun 6, 2020
1 parent 79c9877 commit 0793c64
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions dump1090.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@

#include <stdarg.h>

struct _Modes Modes;

//
// ============================= Utility functions ==========================
//
Expand Down
6 changes: 4 additions & 2 deletions dump1090.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ struct mag_buf {
};

// Program global state
struct { // Internal state
struct _Modes { // Internal state
pthread_t reader_thread;

pthread_mutex_t data_mutex; // Mutex to synchronize buffer access
Expand Down Expand Up @@ -397,7 +397,9 @@ struct { // Internal state
int stats_latest_1min;
struct stats stats_5min;
struct stats stats_15min;
} Modes;
};

extern struct _Modes Modes;

// The struct we use to store information about a decoded message.
struct modesMessage {
Expand Down
2 changes: 2 additions & 0 deletions faup1090.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@

#include "dump1090.h"

struct _Modes Modes;

#include <stdarg.h>

void receiverPositionChanged(float lat, float lon, float alt)
Expand Down
3 changes: 3 additions & 0 deletions view1090.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#include "dump1090.h"

struct _Modes Modes;

//
// ============================= Utility functions ==========================
//
Expand Down

0 comments on commit 0793c64

Please sign in to comment.