From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Mon, 8 Aug 2022 08:58:16 +0000 (+0100) Subject: Clean us a few compilation errors. X-Git-Tag: 4.1-rc1~24^2~42^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc7d122a9ed3a8e53d764d734753e0463192893d;p=thirdparty%2Fshairport-sync.git Clean us a few compilation errors. --- diff --git a/common.c b/common.c index f8b7ae1a..c4f9ac81 100644 --- a/common.c +++ b/common.c @@ -62,6 +62,9 @@ #endif #ifdef COMPILE_FOR_OSX +#include +#include +#include #include #include #include @@ -1220,7 +1223,6 @@ uint64_t get_monotonic_time_in_ns() { #ifdef COMPILE_FOR_OSX uint64_t time_now_mach; - uint64_t elapsedNano; static mach_timebase_info_data_t sTimebaseInfo = {0, 0}; // this actually give you a monotonic clock @@ -1238,7 +1240,7 @@ uint64_t get_monotonic_time_in_ns() { } if (sTimebaseInfo.denom == 0) - die("could not initialise Mac timebase info in get_monotonic_time_in_ns().") + die("could not initialise Mac timebase info in get_monotonic_time_in_ns()."); // Do the maths. We hope that the multiplication doesn't // overflow; the price you pay for working in fixed point. @@ -1283,7 +1285,6 @@ uint64_t get_absolute_time_in_ns() { #ifdef COMPILE_FOR_OSX uint64_t time_now_mach; - uint64_t elapsedNano; static mach_timebase_info_data_t sTimebaseInfo = {0, 0}; // this actually give you a monotonic clock @@ -1303,7 +1304,7 @@ uint64_t get_absolute_time_in_ns() { // overflow; the price you pay for working in fixed point. if (sTimebaseInfo.denom == 0) - die("could not initialise Mac timebase info in get_absolute_time_in_ns().") + die("could not initialise Mac timebase info in get_absolute_time_in_ns()."); // this gives us nanoseconds time_now_ns = time_now_mach * sTimebaseInfo.numer / sTimebaseInfo.denom; @@ -1953,7 +1954,6 @@ int get_device_id(uint8_t *id, int int_length) { response = -1; } else { t = id; - int found = 0; for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) { #ifdef AF_PACKET if ((ifa->ifa_addr) && (ifa->ifa_addr->sa_family == AF_PACKET)) { @@ -1962,7 +1962,6 @@ int get_device_id(uint8_t *id, int int_length) { for (i = 0; ((i < s->sll_halen) && (i < int_length)); i++) { *t++ = s->sll_addr[i]; } - found = 1; } } #else @@ -1975,7 +1974,6 @@ int get_device_id(uint8_t *id, int int_length) { debug(1, "char %d: \"%c\".", i, *s); *t++ = (uint8_t)*s++; } - found = 1; } } #endif