diff --git a/Makefile b/Makefile index 197c87a..afc5002 100644 --- a/Makefile +++ b/Makefile @@ -31,10 +31,15 @@ LIBS+=-lrt endif ifeq ($(UNAME), Darwin) # TODO: Putting GCC in C11 mode breaks things. -CFLAGS+=-std=c11 +CFLAGS+=-std=c11 -DMISSING_GETTIME -DMISSING_NANOSLEEP COMPAT+=compat/clock_gettime/clock_gettime.o compat/clock_nanosleep/clock_nanosleep.o endif +ifeq ($(UNAME), OpenBSD) +CFLAGS+= -DMISSING_NANOSLEEP +COMPAT+= compat/clock_nanosleep/clock_nanosleep.o +endif + all: dump1090 view1090 %.o: %.c *.h diff --git a/compat/clock_gettime/clock_gettime.h b/compat/clock_gettime/clock_gettime.h index 978f522..83fdac7 100644 --- a/compat/clock_gettime/clock_gettime.h +++ b/compat/clock_gettime/clock_gettime.h @@ -1,7 +1,11 @@ #ifndef CLOCK_GETTIME_H #define CLOCK_GETTIME_H -#include +#include // Apple-only, but this isn't inclued on other BSDs + +#ifdef _CLOCKID_T_DEFINED_ +#define CLOCKID_T +#endif #ifndef CLOCKID_T #define CLOCKID_T @@ -12,7 +16,7 @@ typedef enum CLOCK_PROCESS_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID } clockid_t; -#endif // CLOCKID_T +#endif // ifndef CLOCKID_T struct timespec; diff --git a/compat/clock_nanosleep/clock_nanosleep.c b/compat/clock_nanosleep/clock_nanosleep.c index 9cbd1e4..f6e3d84 100644 --- a/compat/clock_nanosleep/clock_nanosleep.c +++ b/compat/clock_nanosleep/clock_nanosleep.c @@ -19,10 +19,13 @@ * http://www.gnu.org/copyleft/gpl.html * ***********************************************************************/ -#include "clock_nanosleep.h" #include // for errno, EINVAL #include // for nanosleep, NULL + +#include "clock_nanosleep.h" +#ifdef MISSING_GETTIME #include "../clock_gettime/clock_gettime.h" // for clock_gettime +#endif int clock_nanosleep(clockid_t id, int flags, const struct timespec *ts, struct timespec *ots) { diff --git a/compat/clock_nanosleep/clock_nanosleep.h b/compat/clock_nanosleep/clock_nanosleep.h index 5f91915..9a8da5d 100644 --- a/compat/clock_nanosleep/clock_nanosleep.h +++ b/compat/clock_nanosleep/clock_nanosleep.h @@ -1,6 +1,10 @@ #ifndef CLOCK_NANOSLEEP_H #define CLOCK_NANOSLEEP_H +#ifdef _CLOCKID_T_DEFINED_ +#define CLOCKID_T +#endif + #ifndef CLOCKID_T #define CLOCKID_T typedef enum @@ -10,7 +14,8 @@ typedef enum CLOCK_PROCESS_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID } clockid_t; -#endif // CLOCKID_T +#endif // ifndef CLOCKID_T + #ifndef TIMER_ABSTIME #define TIMER_ABSTIME 1 diff --git a/compat/compat.h b/compat/compat.h index c8bb5fb..5905e10 100644 --- a/compat/compat.h +++ b/compat/compat.h @@ -7,11 +7,6 @@ #if defined(__APPLE__) -/* implementations of clock_gettime, clock_nanosleep */ - -#include "clock_gettime/clock_gettime.h" -#include "clock_nanosleep/clock_nanosleep.h" - /* * Mach endian conversion */ @@ -29,4 +24,12 @@ #endif +#ifdef MISSING_NANOSLEEP +#include "clock_nanosleep/clock_nanosleep.h" +#endif + +#ifdef MISSING_GETTIME +#include "clock_gettime/clock_gettime.h" +#endif + #endif //COMPAT_UTIL_H diff --git a/cprtests.c b/cprtests.c index 751ba80..abcdac8 100644 --- a/cprtests.c +++ b/cprtests.c @@ -163,7 +163,7 @@ static int testCPRGlobalAirborne() { || fabs(rlon - cprGlobalAirborneTests[i].even_rlon) > 1e-6) { ok = 0; fprintf(stderr, - "testCPRGlobalAirborne[%d,EVEN]: FAIL: decodeCPRairborne(%d,%d,%d,%d,EVEN) failed:\n" + "testCPRGlobalAirborne[%u,EVEN]: FAIL: decodeCPRairborne(%d,%d,%d,%d,EVEN) failed:\n" " result %d (expected %d)\n" " lat %.6f (expected %.6f)\n" " lon %.6f (expected %.6f)\n", @@ -174,7 +174,7 @@ static int testCPRGlobalAirborne() { rlat, cprGlobalAirborneTests[i].even_rlat, rlon, cprGlobalAirborneTests[i].even_rlon); } else { - fprintf(stderr, "testCPRGlobalAirborne[%d,EVEN]: PASS\n", i); + fprintf(stderr, "testCPRGlobalAirborne[%u,EVEN]: PASS\n", i); } res = decodeCPRairborne(cprGlobalAirborneTests[i].even_cprlat, cprGlobalAirborneTests[i].even_cprlon, @@ -186,7 +186,7 @@ static int testCPRGlobalAirborne() { || fabs(rlon - cprGlobalAirborneTests[i].odd_rlon) > 1e-6) { ok = 0; fprintf(stderr, - "testCPRGlobalAirborne[%d,ODD]: FAIL: decodeCPRairborne(%d,%d,%d,%d,ODD) failed:\n" + "testCPRGlobalAirborne[%u,ODD]: FAIL: decodeCPRairborne(%d,%d,%d,%d,ODD) failed:\n" " result %d (expected %d)\n" " lat %.6f (expected %.6f)\n" " lon %.6f (expected %.6f)\n", @@ -197,7 +197,7 @@ static int testCPRGlobalAirborne() { rlat, cprGlobalAirborneTests[i].odd_rlat, rlon, cprGlobalAirborneTests[i].odd_rlon); } else { - fprintf(stderr, "testCPRGlobalAirborne[%d,ODD]: PASS\n", i); + fprintf(stderr, "testCPRGlobalAirborne[%u,ODD]: PASS\n", i); } } @@ -221,7 +221,7 @@ static int testCPRGlobalSurface() { || fabs(rlon - cprGlobalSurfaceTests[i].even_rlon) > 1e-6) { ok = 0; fprintf(stderr, - "testCPRGlobalSurface[%d,EVEN]: FAIL: decodeCPRsurface(%.6f,%.6f,%d,%d,%d,%d,EVEN) failed:\n" + "testCPRGlobalSurface[%u,EVEN]: FAIL: decodeCPRsurface(%.6f,%.6f,%d,%d,%d,%d,EVEN) failed:\n" " result %d (expected %d)\n" " lat %.6f (expected %.6f)\n" " lon %.6f (expected %.6f)\n", @@ -233,7 +233,7 @@ static int testCPRGlobalSurface() { rlat, cprGlobalSurfaceTests[i].even_rlat, rlon, cprGlobalSurfaceTests[i].even_rlon); } else { - fprintf(stderr, "testCPRGlobalSurface[%d,EVEN]: PASS\n", i); + fprintf(stderr, "testCPRGlobalSurface[%u,EVEN]: PASS\n", i); } res = decodeCPRsurface(cprGlobalSurfaceTests[i].reflat, cprGlobalSurfaceTests[i].reflon, @@ -246,7 +246,7 @@ static int testCPRGlobalSurface() { || fabs(rlon - cprGlobalSurfaceTests[i].odd_rlon) > 1e-6) { ok = 0; fprintf(stderr, - "testCPRGlobalSurface[%d,ODD]: FAIL: decodeCPRsurface(%.6f,%.6f,%d,%d,%d,%d,ODD) failed:\n" + "testCPRGlobalSurface[%u,ODD]: FAIL: decodeCPRsurface(%.6f,%.6f,%d,%d,%d,%d,ODD) failed:\n" " result %d (expected %d)\n" " lat %.6f (expected %.6f)\n" " lon %.6f (expected %.6f)\n", @@ -258,7 +258,7 @@ static int testCPRGlobalSurface() { rlat, cprGlobalSurfaceTests[i].odd_rlat, rlon, cprGlobalSurfaceTests[i].odd_rlon); } else { - fprintf(stderr, "testCPRGlobalSurface[%d,ODD]: PASS\n", i); + fprintf(stderr, "testCPRGlobalSurface[%u,ODD]: PASS\n", i); } } @@ -281,7 +281,7 @@ static int testCPRRelative() { || fabs(rlon - cprRelativeTests[i].rlon) > 1e-6) { ok = 0; fprintf(stderr, - "testCPRRelative[%d]: FAIL: decodeCPRrelative(%.6f,%.6f,%d,%d,%d,%d) failed:\n" + "testCPRRelative[%u]: FAIL: decodeCPRrelative(%.6f,%.6f,%d,%d,%d,%d) failed:\n" " result %d (expected %d)\n" " lat %.6f (expected %.6f)\n" " lon %.6f (expected %.6f)\n", @@ -293,7 +293,7 @@ static int testCPRRelative() { rlat, cprRelativeTests[i].rlat, rlon, cprRelativeTests[i].rlon); } else { - fprintf(stderr, "testCPRRelative[%d]: PASS\n", i); + fprintf(stderr, "testCPRRelative[%u]: PASS\n", i); } } diff --git a/mode_s.c b/mode_s.c index d9e8545..7563a31 100644 --- a/mode_s.c +++ b/mode_s.c @@ -1141,7 +1141,7 @@ void displayModesMessage(struct modesMessage *mm) { if (mm->timestampMsg == MAGIC_MLAT_TIMESTAMP) printf("This is a synthetic MLAT message.\n"); else - printf("Time: %.2fus (phase: %d)\n", mm->timestampMsg / 12.0, (unsigned int) (360 * (mm->timestampMsg % 6) / 6)); + printf("Time: %.2fus (phase: %u)\n", mm->timestampMsg / 12.0, (unsigned int) (360 * (mm->timestampMsg % 6) / 6)); } if (mm->msgtype == 0) { // DF 0 diff --git a/net_io.c b/net_io.c index 9b3facc..70e9901 100644 --- a/net_io.c +++ b/net_io.c @@ -1316,7 +1316,7 @@ static int handleHTTPRequest(struct client *c, char *p) { const char *statusmsg = "Internal Server Error"; char *url, *content = NULL; char *ext; - char *content_type; + char *content_type = NULL; int i; if (Modes.debug & MODES_DEBUG_NET) diff --git a/public_html/index.html b/public_html/index.html index 78a03fb..07b225f 100644 --- a/public_html/index.html +++ b/public_html/index.html @@ -1,11 +1,12 @@ + - + - + @@ -13,178 +14,182 @@ - FlightAware - Piaware + FlightAware - PiAware - - - - - + + + + + +
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ICAOFlightSquawkAltitudeSpeedDistanceTrackMsgsAge
-
- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ICAOFlightSquawkAltitudeSpeedDistanceTrackMsgsAge
+ + + + + + Problem fetching data from dump1090.
+
+ The displayed map data will be out of date. +
diff --git a/public_html/script.js b/public_html/script.js index 115147c..ce32e19 100644 --- a/public_html/script.js +++ b/public_html/script.js @@ -469,7 +469,7 @@ function initialize_map() { // Add home marker if requested if (SitePosition) { var markerImage = new google.maps.MarkerImage( - 'http://maps.google.com/mapfiles/kml/pal4/icon57.png', + '//maps.google.com/mapfiles/kml/pal4/icon57.png', new google.maps.Size(32, 32), // Image size new google.maps.Point(0, 0), // Origin point of image new google.maps.Point(16, 16)); // Position where marker should point @@ -614,7 +614,7 @@ function refreshSelected() { $('#dump1090_infoblock').css('display','none'); $('#selected_infoblock').css('display','block'); - $('#selected_flightaware_link').attr('href','http://flightaware.com/live/modes/'+selected.icao+'/redirect'); + $('#selected_flightaware_link').attr('href','//flightaware.com/live/modes/'+selected.icao+'/redirect'); if (selected.flight !== null && selected.flight !== "") { $('#selected_callsign').text(selected.flight);