fixed more warnings and Makefile issues. Should compile on mac now
Former-commit-id: cc10ac99b35ae34ba128642da32f0c9a223cfe31
This commit is contained in:
parent
83f2d6aa30
commit
eaf6bc70a8
|
@ -1,12 +1,7 @@
|
|||
#include "Aircraft.h"
|
||||
|
||||
static auto now() {
|
||||
return std::chrono::high_resolution_clock::now();
|
||||
}
|
||||
|
||||
Aircraft::Aircraft(uint32_t addr) {
|
||||
this->addr = addr;
|
||||
// created = now();
|
||||
prev_seen = 0;
|
||||
|
||||
x = 0;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "AircraftList.h"
|
||||
|
||||
static auto now() {
|
||||
static std::chrono::high_resolution_clock::time_point now() {
|
||||
return std::chrono::high_resolution_clock::now();
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
//carried over from view1090.c
|
||||
//
|
||||
|
||||
|
||||
int AppData::setupConnection(struct client *c) {
|
||||
int fd;
|
||||
|
||||
|
|
10
Makefile
10
Makefile
|
@ -3,17 +3,17 @@
|
|||
# sure that the variable PREFIX is defined, e.g. make PREFIX=/usr/local
|
||||
#
|
||||
|
||||
CFLAGS=-O2 -g -Wno-write-strings
|
||||
LIBS=-lm -lSDL2 -lSDL2_ttf -lSDL2_gfx
|
||||
CC=g++
|
||||
CXXFLAGS=-O2 -std=c++11
|
||||
LIBS= -lm -lSDL2 -lSDL2_ttf -lSDL2_gfx
|
||||
CXX=g++
|
||||
|
||||
all: viz1090
|
||||
|
||||
%.o: %.c %.cpp
|
||||
$(CC) $(CFLAGS) $(EXTRACFLAGS) -c $<
|
||||
$(CXX) $(CXXFLAGS) $(EXTRACFLAGS) -c $<
|
||||
|
||||
viz1090: viz1090.o AppData.o AircraftList.o Aircraft.o anet.o interactive.o mode_ac.o mode_s.o net_io.o Input.o View.o Map.o parula.o monokai.o
|
||||
$(CC) -g -o viz1090 viz1090.o AppData.o AircraftList.o Aircraft.o anet.o interactive.o mode_ac.o mode_s.o net_io.o Input.o View.o Map.o parula.o monokai.o $(LIBS) $(LDFLAGS)
|
||||
$(CXX) -o viz1090 viz1090.o AppData.o AircraftList.o Aircraft.o anet.o interactive.o mode_ac.o mode_s.o net_io.o Input.o View.o Map.o parula.o monokai.o $(LIBS) $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
rm -f *.o viz1090
|
||||
|
|
6
anet.c
6
anet.c
|
@ -122,7 +122,7 @@ int anetResolve(char *err, char *host, char *ipbuf)
|
|||
struct sockaddr_in sa;
|
||||
|
||||
sa.sin_family = AF_INET;
|
||||
if (inet_aton(host, (in_addr*)&sa.sin_addr) == 0) {
|
||||
if (inet_aton(host, &sa.sin_addr) == 0) {
|
||||
struct hostent *he;
|
||||
|
||||
he = gethostbyname(host);
|
||||
|
@ -168,7 +168,7 @@ static int anetTcpGenericConnect(char *err, char *addr, int port, int flags)
|
|||
memset(&sa,0,sizeof(sa));
|
||||
sa.sin_family = AF_INET;
|
||||
sa.sin_port = htons((uint16_t)port);
|
||||
if (inet_aton(addr, (in_addr*)&sa.sin_addr) == 0) {
|
||||
if (inet_aton(addr, &sa.sin_addr) == 0) {
|
||||
struct hostent *he;
|
||||
|
||||
he = gethostbyname(addr);
|
||||
|
@ -271,7 +271,7 @@ int anetTcpServer(char *err, int port, char *bindaddr)
|
|||
sa.sin_family = AF_INET;
|
||||
sa.sin_port = htons((uint16_t)port);
|
||||
sa.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
if (bindaddr && inet_aton(bindaddr, (in_addr*)&sa.sin_addr) == 0) {
|
||||
if (bindaddr && inet_aton(bindaddr, &sa.sin_addr) == 0) {
|
||||
anetSetError(err, "invalid bind address");
|
||||
close(s);
|
||||
return ANET_ERR;
|
||||
|
|
9
anet.h
9
anet.h
|
@ -39,6 +39,10 @@
|
|||
#define AF_LOCAL AF_UNIX
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int anetTcpConnect(char *err, char *addr, int port);
|
||||
int anetTcpNonBlockConnect(char *err, char *addr, int port);
|
||||
int anetUnixConnect(char *err, char *path);
|
||||
|
@ -56,4 +60,9 @@ int anetTcpKeepAlive(char *err, int fd);
|
|||
int anetPeerToString(int fd, char *ip, int *port);
|
||||
int anetSetSendBuffer(char *err, int fd, int buffsize);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -428,7 +428,7 @@ extern "C" {
|
|||
// Functions exported from mode_ac.c
|
||||
//
|
||||
int detectModeA (uint16_t *m, struct modesMessage *mm);
|
||||
void decodeModeAMessage(Modes *modes, struct modesMessage *mm, int ModeA);
|
||||
//void decodeModeAMessage(Modes *modes, struct modesMessage *mm, int ModeA);
|
||||
int ModeAToModeC (unsigned int ModeA);
|
||||
|
||||
//
|
||||
|
@ -449,7 +449,7 @@ struct aircraft* interactiveReceiveData(Modes *modes, struct modesMessage *mm);
|
|||
void interactiveShowData(void);
|
||||
void interactiveRemoveStaleAircrafts(Modes *modes);
|
||||
int decodeBinMessage (Modes *modes, struct client *c, char *p);
|
||||
struct aircraft *interactiveFindAircraft(uint32_t addr);
|
||||
// struct aircraft *interactiveFindAircraft(uint32_t addr);
|
||||
struct stDF *interactiveFindDF (uint32_t addr);
|
||||
|
||||
//
|
||||
|
|
2
mode_s.c
2
mode_s.c
|
@ -210,7 +210,7 @@ int fixBitErrors(unsigned char *msg, int bits, int maxfix, char *fixedbits) {
|
|||
int bitpos, offset, res, i;
|
||||
memset(&ei, 0, sizeof(struct errorinfo));
|
||||
ei.syndrome = modesChecksum(msg, bits);
|
||||
pei = (errorinfo*)bsearch(&ei, bitErrorTable, NERRORINFO,
|
||||
pei = bsearch(&ei, bitErrorTable, NERRORINFO,
|
||||
sizeof(struct errorinfo), cmpErrorInfo);
|
||||
if (pei == NULL) {
|
||||
return 0; // No syndrome found
|
||||
|
|
Loading…
Reference in a new issue