Commit 24bc25ec authored by Philipp Schafft's avatar Philipp Schafft 🦁

Cleanup: fixed some compiler warnings

parent d51b9afc
...@@ -243,6 +243,8 @@ static auth_result auth_remove_client(auth_t *auth, auth_client *auth_user) ...@@ -243,6 +243,8 @@ static auth_result auth_remove_client(auth_t *auth, auth_client *auth_user)
client_t *client = auth_user->client; client_t *client = auth_user->client;
auth_result ret = AUTH_RELEASED; auth_result ret = AUTH_RELEASED;
(void)auth;
if (client->auth->release_client) if (client->auth->release_client)
ret = client->auth->release_client(auth_user); ret = client->auth->release_client(auth_user);
......
...@@ -22,11 +22,13 @@ ...@@ -22,11 +22,13 @@
static auth_result anonymous_auth(auth_client *auth_user) static auth_result anonymous_auth(auth_client *auth_user)
{ {
(void)auth_user;
return AUTH_OK; return AUTH_OK;
} }
int auth_get_anonymous_auth(auth_t *authenticator, config_options_t *options) int auth_get_anonymous_auth(auth_t *authenticator, config_options_t *options)
{ {
(void)options;
authenticator->authenticate_client = anonymous_auth; authenticator->authenticate_client = anonymous_auth;
authenticator->immediate = 1; authenticator->immediate = 1;
return 0; return 0;
......
...@@ -89,6 +89,8 @@ static int compare_users(void *arg, void *a, void *b) ...@@ -89,6 +89,8 @@ static int compare_users(void *arg, void *a, void *b)
htpasswd_user *user1 = (htpasswd_user *)a; htpasswd_user *user1 = (htpasswd_user *)a;
htpasswd_user *user2 = (htpasswd_user *)b; htpasswd_user *user2 = (htpasswd_user *)b;
(void)arg;
return strcmp (user1->name, user2->name); return strcmp (user1->name, user2->name);
} }
......
...@@ -24,6 +24,7 @@ static int my_getpass(void *client, char *prompt, char *buffer, int buflen) { ...@@ -24,6 +24,7 @@ static int my_getpass(void *client, char *prompt, char *buffer, int buflen) {
#endif #endif
static size_t handle_returned (void *ptr, size_t size, size_t nmemb, void *stream) { static size_t handle_returned (void *ptr, size_t size, size_t nmemb, void *stream) {
(void)ptr, (void)stream;
return size * nmemb; return size * nmemb;
} }
......
...@@ -152,6 +152,8 @@ static inline void _try_registrations(event_registration_t *er, event_t *event) ...@@ -152,6 +152,8 @@ static inline void _try_registrations(event_registration_t *er, event_t *event)
static void *event_run_thread (void *arg) { static void *event_run_thread (void *arg) {
int running = 0; int running = 0;
(void)arg;
do { do {
event_t *event; event_t *event;
size_t i; size_t i;
......
...@@ -27,6 +27,7 @@ typedef struct event_url { ...@@ -27,6 +27,7 @@ typedef struct event_url {
} event_url_t; } event_url_t;
static size_t handle_returned (void *ptr, size_t size, size_t nmemb, void *stream) { static size_t handle_returned (void *ptr, size_t size, size_t nmemb, void *stream) {
(void)ptr, (void)stream;
return size * nmemb; return size * nmemb;
} }
......
...@@ -292,7 +292,7 @@ int format_advance_queue(source_t *source, client_t *client) ...@@ -292,7 +292,7 @@ int format_advance_queue(source_t *source, client_t *client)
*/ */
static int format_prepare_headers (source_t *source, client_t *client) static int format_prepare_headers (source_t *source, client_t *client)
{ {
unsigned remaining; size_t remaining;
char *ptr; char *ptr;
int bytes; int bytes;
int bitrate_filtered = 0; int bitrate_filtered = 0;
...@@ -303,11 +303,11 @@ static int format_prepare_headers (source_t *source, client_t *client) ...@@ -303,11 +303,11 @@ static int format_prepare_headers (source_t *source, client_t *client)
client->respcode = 200; client->respcode = 200;
bytes = util_http_build_header(ptr, remaining, 0, 0, 200, NULL, source->format->contenttype, NULL, NULL, source, client); bytes = util_http_build_header(ptr, remaining, 0, 0, 200, NULL, source->format->contenttype, NULL, NULL, source, client);
if (bytes == -1) { if (bytes < 0) {
ICECAST_LOG_ERROR("Dropping client as we can not build response headers."); ICECAST_LOG_ERROR("Dropping client as we can not build response headers.");
client->respcode = 500; client->respcode = 500;
return -1; return -1;
} else if ((bytes + 1024) >= remaining) { /* we don't know yet how much to follow but want at least 1kB free space */ } else if (((size_t)bytes + (size_t)1024U) >= remaining) { /* we don't know yet how much to follow but want at least 1kB free space */
void *new_ptr = realloc(ptr, bytes + 1024); void *new_ptr = realloc(ptr, bytes + 1024);
if (new_ptr) { if (new_ptr) {
ICECAST_LOG_DEBUG("Client buffer reallocation succeeded."); ICECAST_LOG_DEBUG("Client buffer reallocation succeeded.");
......
...@@ -275,6 +275,8 @@ static void *fserv_thread_function(void *arg) ...@@ -275,6 +275,8 @@ static void *fserv_thread_function(void *arg)
fserve_t *fclient, **trail; fserve_t *fclient, **trail;
size_t bytes; size_t bytes;
(void)arg;
while (1) while (1)
{ {
if (wait_for_fds() < 0) if (wait_for_fds() < 0)
...@@ -716,6 +718,7 @@ static int _delete_mapping(void *mapping) { ...@@ -716,6 +718,7 @@ static int _delete_mapping(void *mapping) {
static int _compare_mappings(void *arg, void *a, void *b) static int _compare_mappings(void *arg, void *a, void *b)
{ {
(void)arg;
return strcmp( return strcmp(
((mime_type *)a)->ext, ((mime_type *)a)->ext,
((mime_type *)b)->ext); ((mime_type *)b)->ext);
......
...@@ -43,6 +43,7 @@ static int __func_free(void *x) { ...@@ -43,6 +43,7 @@ static int __func_free(void *x) {
} }
static int __func_compare (void *arg, void *a, void *b) { static int __func_compare (void *arg, void *a, void *b) {
(void)arg;
return strcmp(b, a); return strcmp(b, a);
} }
......
...@@ -724,6 +724,8 @@ static void *_slave_thread(void *arg) ...@@ -724,6 +724,8 @@ static void *_slave_thread(void *arg)
ice_config_t *config; ice_config_t *config;
unsigned int interval = 0; unsigned int interval = 0;
(void)arg;
thread_mutex_lock(&_slave_mutex); thread_mutex_lock(&_slave_mutex);
update_settings = 0; update_settings = 0;
update_all_mounts = 0; update_all_mounts = 0;
......
...@@ -191,6 +191,8 @@ int source_compare_sources(void *arg, void *a, void *b) ...@@ -191,6 +191,8 @@ int source_compare_sources(void *arg, void *a, void *b)
source_t *srca = (source_t *)a; source_t *srca = (source_t *)a;
source_t *srcb = (source_t *)b; source_t *srcb = (source_t *)b;
(void)arg;
return strcmp(srca->mount, srcb->mount); return strcmp(srca->mount, srcb->mount);
} }
...@@ -934,6 +936,8 @@ static int _compare_clients(void *compare_arg, void *a, void *b) ...@@ -934,6 +936,8 @@ static int _compare_clients(void *compare_arg, void *a, void *b)
client_t *clienta = (client_t *) a; client_t *clienta = (client_t *) a;
client_t *clientb = (client_t *) b; client_t *clientb = (client_t *) b;
(void)compare_arg;
connection_t *cona = clienta->con; connection_t *cona = clienta->con;
connection_t *conb = clientb->con; connection_t *conb = clientb->con;
......
...@@ -671,6 +671,8 @@ static void *_stats_thread(void *arg) ...@@ -671,6 +671,8 @@ static void *_stats_thread(void *arg)
stats_event_t *copy; stats_event_t *copy;
event_listener_t *listener; event_listener_t *listener;
(void)arg;
stats_event_time (NULL, "server_start"); stats_event_time (NULL, "server_start");
stats_event_time_iso8601 (NULL, "server_start_iso8601"); stats_event_time_iso8601 (NULL, "server_start_iso8601");
...@@ -995,6 +997,8 @@ void *stats_connection(void *arg) ...@@ -995,6 +997,8 @@ void *stats_connection(void *arg)
void stats_callback (client_t *client, void *notused) void stats_callback (client_t *client, void *notused)
{ {
(void)notused;
if (client->con->error) if (client->con->error)
{ {
client_destroy (client); client_destroy (client);
...@@ -1078,6 +1082,8 @@ static int _compare_stats(void *arg, void *a, void *b) ...@@ -1078,6 +1082,8 @@ static int _compare_stats(void *arg, void *a, void *b)
stats_node_t *nodea = (stats_node_t *)a; stats_node_t *nodea = (stats_node_t *)a;
stats_node_t *nodeb = (stats_node_t *)b; stats_node_t *nodeb = (stats_node_t *)b;
(void)arg;
return strcmp(nodea->name, nodeb->name); return strcmp(nodea->name, nodeb->name);
} }
...@@ -1086,6 +1092,8 @@ static int _compare_source_stats(void *arg, void *a, void *b) ...@@ -1086,6 +1092,8 @@ static int _compare_source_stats(void *arg, void *a, void *b)
stats_source_t *nodea = (stats_source_t *)a; stats_source_t *nodea = (stats_source_t *)a;
stats_source_t *nodeb = (stats_source_t *)b; stats_source_t *nodeb = (stats_source_t *)b;
(void)arg;
return strcmp(nodea->source, nodeb->source); return strcmp(nodea->source, nodeb->source);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment