Skip to content

Commit

Permalink
Remove some more causes of warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebrady committed Mar 7, 2018
1 parent c36a782 commit f8518af
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions audio_ao.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions audio_soundio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions metadata_hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions tinysvcmdns.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f8518af

Please sign in to comment.