]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Remove some more causes of warnings.
authorMike Brady <mikebrady@eircom.net>
Wed, 7 Mar 2018 19:22:18 +0000 (19:22 +0000)
committerMike Brady <mikebrady@eircom.net>
Wed, 7 Mar 2018 19:22:18 +0000 (19:22 +0000)
audio_ao.c
audio_soundio.c
metadata_hub.c
tinysvcmdns.c

index 78fbea3f1ffd923954f9223565ae9e78895c3d2a..f6779e7c78bd2cfcf5c6260a3226724ea7e054da 100644 (file)
@@ -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;
index 6960fa3545da9a9d3d0185ad2447e895d13d29c2..03ec5e6e5a3279bacfd69b8a792e27bfa33f6946 100644 (file)
@@ -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;
index 80e6170bd0bbf30a87549937acebd8f8d1972286..1918b9708dab83c06433d00f82c15c9af4cc8af4 100644 (file)
@@ -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
 
index 90f9c82630a2048c2bf79b030a166b45f2b7791c..5d2f4d81035f8ef833369463a308fbddf50f86f3 100644 (file)
@@ -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