using (void) instead of UNUSED

This commit is contained in:
Maxim Devaev
2024-02-16 01:51:36 +02:00
parent 63d87f0526
commit 46e630d2f6
4 changed files with 30 additions and 11 deletions

View File

@@ -57,7 +57,6 @@
#define RN "\r\n"
#define INLINE inline __attribute__((always_inline))
#define UNUSED __attribute__((unused))
#define US_CALLOC(x_dest, x_nmemb) assert(((x_dest) = calloc((x_nmemb), sizeof(*(x_dest)))) != NULL)
#define US_REALLOC(x_dest, x_nmemb) assert(((x_dest) = realloc((x_dest), (x_nmemb) * sizeof(*(x_dest)))) != NULL)

View File

@@ -747,7 +747,10 @@ static void _http_callback_stream_write(struct bufferevent *buf_event, void *v_c
# undef BOUNDARY
}
static void _http_callback_stream_error(UNUSED struct bufferevent *buf_event, UNUSED short what, void *v_client) {
static void _http_callback_stream_error(struct bufferevent *buf_event, short what, void *v_client) {
(void)buf_event;
(void)what;
us_stream_client_s *const client = (us_stream_client_s *)v_client;
us_server_s *const server = client->server;
@@ -825,7 +828,10 @@ static void _http_queue_send_stream(us_server_s *server, bool stream_updated, bo
}
}
static void _http_request_watcher(UNUSED int fd, UNUSED short what, void *v_server) {
static void _http_request_watcher(int fd, short what, void *v_server) {
(void)fd;
(void)what;
us_server_s *server = (us_server_s *)v_server;
const long double now = us_get_now_monotonic();
@@ -839,7 +845,10 @@ static void _http_request_watcher(UNUSED int fd, UNUSED short what, void *v_serv
}
}
static void _http_refresher(UNUSED int fd, UNUSED short what, void *v_server) {
static void _http_refresher(int fd, short what, void *v_server) {
(void)fd;
(void)what;
us_server_s *server = (us_server_s *)v_server;
bool stream_updated = false;
bool frame_updated = false;

View File

@@ -52,14 +52,16 @@ static void _block_thread_signals(void) {
assert(!pthread_sigmask(SIG_BLOCK, &mask, NULL));
}
static void *_stream_loop_thread(UNUSED void *arg) {
static void *_stream_loop_thread(void *arg) {
(void)arg;
US_THREAD_RENAME("stream");
_block_thread_signals();
us_stream_loop(_g_stream);
return NULL;
}
static void *_server_loop_thread(UNUSED void *arg) {
static void *_server_loop_thread(void *arg) {
(void)arg;
US_THREAD_RENAME("http");
_block_thread_signals();
us_server_loop(_g_server);