Skip to content

Commit

Permalink
using (void) instead of UNUSED
Browse files Browse the repository at this point in the history
  • Loading branch information
mdevaev committed Feb 15, 2024
1 parent 63d87f0 commit 46e630d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
19 changes: 14 additions & 5 deletions janus/src/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ static atomic_bool _g_key_required = false;
janus_plugin *create(void);


static void *_video_rtp_thread(UNUSED void *arg) {
static void *_video_rtp_thread(void *arg) {
(void)arg;

US_THREAD_RENAME("us_video_rtp");
atomic_store(&_g_video_rtp_tid_created, true);

Expand All @@ -116,7 +118,9 @@ static void *_video_rtp_thread(UNUSED void *arg) {
return NULL;
}

static void *_video_sink_thread(UNUSED void *arg) {
static void *_video_sink_thread(void *arg) {
(void)arg;

US_THREAD_RENAME("us_video_sink");
atomic_store(&_g_video_sink_tid_created, true);

Expand Down Expand Up @@ -178,7 +182,9 @@ static void *_video_sink_thread(UNUSED void *arg) {
return NULL;
}

static void *_audio_thread(UNUSED void *arg) {
static void *_audio_thread(void *arg) {
(void)arg;

US_THREAD_RENAME("us_audio");
atomic_store(&_g_audio_tid_created, true);
assert(_g_config->audio_dev_name != NULL);
Expand Down Expand Up @@ -344,7 +350,8 @@ static json_t *_plugin_query_session(janus_plugin_session *session) {
return info;
}

static void _set_transmit(janus_plugin_session *session, UNUSED const char *msg, bool transmit) {
static void _set_transmit(janus_plugin_session *session, const char *msg, bool transmit) {
(void)msg;
_IF_DISABLED({ return; });
_LOCK_ALL;
bool found = false;
Expand Down Expand Up @@ -503,7 +510,9 @@ static struct janus_plugin_result *_plugin_handle_message(
# undef FREE_MSG_JSEP
}

static void _plugin_incoming_rtcp(UNUSED janus_plugin_session *handle, UNUSED janus_plugin_rtcp *packet) {
static void _plugin_incoming_rtcp(janus_plugin_session *handle, janus_plugin_rtcp *packet) {
(void)handle;
(void)packet;
if (packet->video && janus_rtcp_has_pli(packet->buffer, packet->length)) {
// US_JLOG_INFO("main", "Got video PLI");
atomic_store(&_g_key_required, true);
Expand Down
1 change: 0 additions & 1 deletion src/libs/tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 12 additions & 3 deletions src/ustreamer/http/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();

Expand All @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions src/ustreamer/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 46e630d

Please sign in to comment.