From: Mike Brady Date: Thu, 13 Feb 2020 17:57:30 +0000 (+0000) Subject: More fixes to allow gcc-10 to compile without error X-Git-Tag: 3.3.7d12~151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85ba78b61989670b00c9fb33501d606aa4e7a25f;p=thirdparty%2Fshairport-sync.git More fixes to allow gcc-10 to compile without error --- diff --git a/audio_sndio.c b/audio_sndio.c index 9fd497ac..ac5cfa38 100644 --- a/audio_sndio.c +++ b/audio_sndio.c @@ -65,7 +65,7 @@ struct sio_par par; struct sndio_formats { const char *name; - enum sps_format_t fmt; + sps_format_t fmt; unsigned int rate; unsigned int bits; unsigned int bps; diff --git a/common.h b/common.h index 35b21bd9..2c9c05bd 100644 --- a/common.h +++ b/common.h @@ -24,10 +24,10 @@ #endif #if defined(CONFIG_DBUS_INTERFACE) || defined(CONFIG_MPRIS_INTERFACE) -enum dbus_session_type { +typedef enum { DBT_system = 0, // use the session bus DBT_session, // use the system bus -} dbt_type; +} dbus_session_type; #endif #define sps_extra_code_output_stalled 32768 @@ -245,10 +245,10 @@ typedef struct { yna_type use_precision_timing; // defaults to no #if defined(CONFIG_DBUS_INTERFACE) - enum dbus_session_type dbus_service_bus_type; + dbus_session_type dbus_service_bus_type; #endif #if defined(CONFIG_MPRIS_INTERFACE) - enum dbus_session_type mpris_service_bus_type; + dbus_session_type mpris_service_bus_type; #endif #ifdef CONFIG_METADATA_HUB diff --git a/dbus-service.c b/dbus-service.c index 3efde8f1..1fe59c35 100644 --- a/dbus-service.c +++ b/dbus-service.c @@ -45,6 +45,8 @@ #include #endif +ShairportSync *shairportSyncSkeleton; + int service_is_running = 0; ShairportSyncDiagnostics *shairportSyncDiagnosticsSkeleton = NULL; diff --git a/dbus-service.h b/dbus-service.h index 5cfc02e2..1373e9cb 100644 --- a/dbus-service.h +++ b/dbus-service.h @@ -3,7 +3,7 @@ #define DBUS_SERVICE_H #include "dbus-interface.h" -ShairportSync *shairportSyncSkeleton; +extern ShairportSync *shairportSyncSkeleton; int start_dbus_service(); void stop_dbus_service(); diff --git a/metadata_hub.c b/metadata_hub.c index fb459b6b..c09759f2 100644 --- a/metadata_hub.c +++ b/metadata_hub.c @@ -58,6 +58,8 @@ #include #endif +struct metadata_bundle metadata_store; + int metadata_hub_initialised = 0; pthread_rwlock_t metadata_hub_re_lock = PTHREAD_RWLOCK_INITIALIZER; diff --git a/metadata_hub.h b/metadata_hub.h index ed7d947d..e7e6988a 100644 --- a/metadata_hub.h +++ b/metadata_hub.h @@ -5,25 +5,25 @@ #define number_of_watchers 2 -enum play_status_type { +typedef enum { PS_NOT_AVAILABLE = 0, PS_STOPPED, PS_PAUSED, PS_PLAYING, } play_status_type; -enum active_state_type { +typedef enum { AM_INACTIVE = 0, AM_ACTIVE, } active_state_type; -enum shuffle_status_type { +typedef enum { SS_NOT_AVAILABLE = 0, SS_OFF, SS_ON, } shuffle_status_type; -enum repeat_status_type { +typedef enum { RS_NOT_AVAILABLE = 0, RS_OFF, RS_ONE, @@ -59,9 +59,9 @@ typedef struct metadata_bundle { // used detect transitions between server activity being on or off // e.g. to reease metadata when a server goes inactive, but not if it's permanently // inactive. - enum play_status_type play_status; - enum shuffle_status_type shuffle_status; - enum repeat_status_type repeat_status; + play_status_type play_status; + shuffle_status_type shuffle_status; + repeat_status_type repeat_status; // the following pertain to the track playing @@ -123,9 +123,9 @@ typedef struct metadata_bundle { // end - enum play_status_type + play_status_type player_state; // this is the state of the actual player itself, which can be a bit noisy. - enum active_state_type active_state; + active_state_type active_state; int speaker_volume; // this is the actual speaker volume, allowing for the main volume and the // speaker volume control @@ -136,7 +136,7 @@ typedef struct metadata_bundle { } metadata_bundle; -struct metadata_bundle metadata_store; +extern struct metadata_bundle metadata_store; void add_metadata_watcher(metadata_watcher fn, void *userdata); diff --git a/mpris-service.c b/mpris-service.c index 168ce396..76a04c76 100644 --- a/mpris-service.c +++ b/mpris-service.c @@ -39,6 +39,9 @@ #include "metadata_hub.h" #include "mpris-service.h" +MediaPlayer2 *mprisPlayerSkeleton; +MediaPlayer2Player *mprisPlayerPlayerSkeleton; + double airplay_volume_to_mpris_volume(double sp) { if (sp < -30.0) sp = -30.0; diff --git a/mpris-service.h b/mpris-service.h index f290d79c..160e55d4 100644 --- a/mpris-service.h +++ b/mpris-service.h @@ -4,8 +4,8 @@ #include "mpris-interface.h" -MediaPlayer2 *mprisPlayerSkeleton; -MediaPlayer2Player *mprisPlayerPlayerSkeleton; +extern MediaPlayer2 *mprisPlayerSkeleton; +extern MediaPlayer2Player *mprisPlayerPlayerSkeleton; int start_mpris_service();