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)
client_t *client = auth_user->client;
auth_result ret = AUTH_RELEASED;
(void)auth;
if (client->auth->release_client)
ret = client->auth->release_client(auth_user);
......
......@@ -22,11 +22,13 @@
static auth_result anonymous_auth(auth_client *auth_user)
{
(void)auth_user;
return AUTH_OK;
}
int auth_get_anonymous_auth(auth_t *authenticator, config_options_t *options)
{
(void)options;
authenticator->authenticate_client = anonymous_auth;
authenticator->immediate = 1;
return 0;
......
......@@ -89,6 +89,8 @@ static int compare_users(void *arg, void *a, void *b)
htpasswd_user *user1 = (htpasswd_user *)a;
htpasswd_user *user2 = (htpasswd_user *)b;
(void)arg;
return strcmp (user1->name, user2->name);
}
......
......@@ -24,6 +24,7 @@ static int my_getpass(void *client, char *prompt, char *buffer, int buflen) {
#endif
static size_t handle_returned (void *ptr, size_t size, size_t nmemb, void *stream) {
(void)ptr, (void)stream;
return size * nmemb;
}
......
......@@ -152,6 +152,8 @@ static inline void _try_registrations(event_registration_t *er, event_t *event)
static void *event_run_thread (void *arg) {
int running = 0;
(void)arg;
do {
event_t *event;
size_t i;
......
......@@ -27,6 +27,7 @@ typedef struct event_url {
} event_url_t;
static size_t handle_returned (void *ptr, size_t size, size_t nmemb, void *stream) {
(void)ptr, (void)stream;
return size * nmemb;
}
......
......@@ -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)
{
unsigned remaining;
size_t remaining;
char *ptr;
int bytes;
int bitrate_filtered = 0;
......@@ -303,11 +303,11 @@ static int format_prepare_headers (source_t *source, client_t *client)
client->respcode = 200;
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.");
client->respcode = 500;
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);
if (new_ptr) {
ICECAST_LOG_DEBUG("Client buffer reallocation succeeded.");
......
......@@ -275,6 +275,8 @@ static void *fserv_thread_function(void *arg)
fserve_t *fclient, **trail;
size_t bytes;
(void)arg;
while (1)
{
if (wait_for_fds() < 0)
......@@ -716,6 +718,7 @@ static int _delete_mapping(void *mapping) {
static int _compare_mappings(void *arg, void *a, void *b)
{
(void)arg;
return strcmp(
((mime_type *)a)->ext,
((mime_type *)b)->ext);
......
......@@ -43,6 +43,7 @@ static int __func_free(void *x) {
}
static int __func_compare (void *arg, void *a, void *b) {
(void)arg;
return strcmp(b, a);
}
......
......@@ -724,6 +724,8 @@ static void *_slave_thread(void *arg)
ice_config_t *config;
unsigned int interval = 0;
(void)arg;
thread_mutex_lock(&_slave_mutex);
update_settings = 0;
update_all_mounts = 0;
......
......@@ -191,6 +191,8 @@ int source_compare_sources(void *arg, void *a, void *b)
source_t *srca = (source_t *)a;
source_t *srcb = (source_t *)b;
(void)arg;
return strcmp(srca->mount, srcb->mount);
}
......@@ -934,6 +936,8 @@ static int _compare_clients(void *compare_arg, void *a, void *b)
client_t *clienta = (client_t *) a;
client_t *clientb = (client_t *) b;
(void)compare_arg;
connection_t *cona = clienta->con;
connection_t *conb = clientb->con;
......
......@@ -671,6 +671,8 @@ static void *_stats_thread(void *arg)
stats_event_t *copy;
event_listener_t *listener;
(void)arg;
stats_event_time (NULL, "server_start");
stats_event_time_iso8601 (NULL, "server_start_iso8601");
......@@ -995,6 +997,8 @@ void *stats_connection(void *arg)
void stats_callback (client_t *client, void *notused)
{
(void)notused;
if (client->con->error)
{
client_destroy (client);
......@@ -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 *nodeb = (stats_node_t *)b;
(void)arg;
return strcmp(nodea->name, nodeb->name);
}
......@@ -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 *nodeb = (stats_source_t *)b;
(void)arg;
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