From: Mike Brady Date: Wed, 7 Mar 2018 19:22:18 +0000 (+0000) Subject: Remove some more causes of warnings. X-Git-Tag: 3.2d29~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8518af7e08dd8de8ae450c9f428579a5ada48ae;p=thirdparty%2Fshairport-sync.git Remove some more causes of warnings. --- diff --git a/audio_ao.c b/audio_ao.c index 78fbea3f..f6779e7c 100644 --- a/audio_ao.c +++ b/audio_ao.c @@ -41,9 +41,9 @@ static void help(void) { } static int init(int argc, char **argv) { - const char *str; - int value; - double dvalue; + // const char *str; + // int value; + // double dvalue; ao_initialize(); int driver = ao_default_driver_id(); ao_option *ao_opts = NULL; diff --git a/audio_soundio.c b/audio_soundio.c index 6960fa35..03ec5e6e 100644 --- a/audio_soundio.c +++ b/audio_soundio.c @@ -20,7 +20,7 @@ static int min_int(int a, int b) { return (a < b) ? a : b; } static void write_callback(struct SoundIoOutStream *outstream, int frame_count_min, int frame_count_max) { struct SoundIoChannelArea *areas; - int frame_count; + // int frame_count; int err; char *read_ptr = soundio_ring_buffer_read_ptr(ring_buffer); @@ -168,7 +168,7 @@ static void start(int sample_rate, int sample_format) { } static void play(short buf[], int samples) { - int err; + // int err; int free_bytes = soundio_ring_buffer_free_count(ring_buffer); int written_bytes = 0; int write_bytes = 0; diff --git a/metadata_hub.c b/metadata_hub.c index 80e6170b..1918b970 100644 --- a/metadata_hub.c +++ b/metadata_hub.c @@ -151,14 +151,14 @@ char *metadata_write_image_file(const char *buf, int len) { #ifdef HAVE_LIBMBEDTLS mbedtls_md5_context tctx; mbedtls_md5_starts(&tctx); - mbedtls_md5_update(&tctx, buf, len); + mbedtls_md5_update(&tctx, (const unsigned char *)buf, len); mbedtls_md5_finish(&tctx, img_md5); #endif #ifdef HAVE_LIBPOLARSSL md5_context tctx; md5_starts(&tctx); - md5_update(&tctx, buf, len); + md5_update(&tctx, (const unsigned char *)buf, len); md5_finish(&tctx, img_md5); #endif diff --git a/tinysvcmdns.c b/tinysvcmdns.c index 90f9c826..5d2f4d81 100644 --- a/tinysvcmdns.c +++ b/tinysvcmdns.c @@ -1600,7 +1600,7 @@ struct mdns_service *mdnsd_register_svc(struct mdnsd *svr, const char *instance_ const char *txt[]) { struct rr_entry *txt_e = NULL, *srv_e = NULL, *ptr_e = NULL, *bptr_e = NULL; uint8_t *target; - uint8_t *inst_nlabel, *type_nlabel, *nlabel; + uint8_t *inst_nlabel, *type_nlabel, *nlabel = NULL; struct mdns_service *service = malloc(sizeof(struct mdns_service)); if (service) memset(service, 0, sizeof(struct mdns_service)); @@ -1655,7 +1655,8 @@ struct mdns_service *mdnsd_register_svc(struct mdnsd *svr, const char *instance_ pthread_mutex_unlock(&svr->data_lock); // don't free type_nlabel - it's with the PTR record - free(nlabel); + if (nlabel) + free(nlabel); free(inst_nlabel); // notify server