Skip to content

Commit

Permalink
Fix some other build warnings (output should be clean now).
Browse files Browse the repository at this point in the history
  • Loading branch information
atoppi committed Feb 18, 2022
1 parent 1ad0a34 commit e7fec82
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 26 deletions.
8 changes: 2 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,22 @@ CFLAGS="$CFLAGS \
-Wformat-security \
-Wformat=2 \
-Winit-self \
-Winline \
-Wlarger-than=65537 \
-Wmissing-declarations \
-Wmissing-format-attribute \
-Wmissing-include-dirs \
-Wmissing-noreturn \
-Wmissing-prototypes \
-Wnested-externs \
-Wno-aggregate-return \
-Wno-missing-field-initializers \
-Wno-redundant-decls \
-Wno-undef \
-Wno-unused-parameter \
-Wold-style-definition \
-Wpacked \
-Wpointer-arith \
-Wsign-compare \
-Wstrict-prototypes \
-Wswitch-default \
-Wunused \
-Wno-unused-parameter \
-Wno-unused-result \
-Wwrite-strings \
-Werror=implicit-function-declaration"

Expand Down
6 changes: 4 additions & 2 deletions src/events/janus_wsevh.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const char *janus_wsevh_get_package(void);
void janus_wsevh_incoming_event(json_t *event);
json_t *janus_wsevh_handle_request(json_t *request);

#define WS_LIST_TERM 0, NULL, 0

/* Event handler setup */
static janus_eventhandler janus_wsevh =
JANUS_EVENTHANDLER_INIT (
Expand Down Expand Up @@ -181,8 +183,8 @@ static janus_mutex writable_mutex;

static int janus_wsevh_callback(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len);
static struct lws_protocols protocols[] = {
{ "janus-event-handlers", janus_wsevh_callback, sizeof(janus_wsevh_client), 0 }, /* Subprotocol will be configurable */
{ NULL, NULL, 0, 0 }
{ "janus-event-handlers", janus_wsevh_callback, sizeof(janus_wsevh_client), 0, WS_LIST_TERM }, /* Subprotocol will be configurable */
{ NULL, NULL, 0, 0, WS_LIST_TERM }
};
static const struct lws_extension exts[] = {
#ifndef LWS_WITHOUT_EXTENSIONS
Expand Down
6 changes: 0 additions & 6 deletions src/plugins/janus_sip.c
Original file line number Diff line number Diff line change
Expand Up @@ -4253,19 +4253,13 @@ static void *janus_sip_handler(void *data) {
/* Craft the Replaces header field */
sip_replaces_t *r = nua_handle_make_replaces(replaced->stack->s_nh_i, session->stack->s_home, 0);
char *replaces = sip_headers_as_url_query(session->stack->s_home, SIPTAG_REPLACES(r), TAG_END());
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Winline"
refer_to = sip_refer_to_format(session->stack->s_home, "<%s?%s>", uri_text, replaces);
#pragma GCC diagnostic pop
JANUS_LOG(LOG_VERB, "Attended transfer: <%s?%s>\n", uri_text, replaces);
su_free(session->stack->s_home, r);
su_free(session->stack->s_home, replaces);
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Winline"
if(refer_to == NULL)
refer_to = sip_refer_to_format(session->stack->s_home, "<%s>", uri_text);
#pragma GCC diagnostic pop
/* Send the REFER */
nua_refer(session->stack->s_nh_i,
SIPTAG_REFER_TO(refer_to),
Expand Down
25 changes: 13 additions & 12 deletions src/transports/janus_websockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ void janus_websockets_session_over(janus_transport_session *transport, guint64 s
void janus_websockets_session_claimed(janus_transport_session *transport, guint64 session_id);
json_t *janus_websockets_query_transport(json_t *request);

#define WS_LIST_TERM 0, NULL, 0

/* Transport setup */
static janus_transport janus_websockets_transport =
Expand Down Expand Up @@ -221,24 +222,24 @@ static int janus_websockets_admin_callback_secure(
void *user, void *in, size_t len);
/* Protocol mappings */
static struct lws_protocols ws_protocols[] = {
{ "http-only", janus_websockets_callback_http, 0, 0 },
{ "janus-protocol", janus_websockets_callback, sizeof(janus_websockets_client), 0 },
{ NULL, NULL, 0 }
{ "http-only", janus_websockets_callback_http, 0, 0, WS_LIST_TERM },
{ "janus-protocol", janus_websockets_callback, sizeof(janus_websockets_client), 0, WS_LIST_TERM },
{ NULL, NULL, 0, 0, WS_LIST_TERM }
};
static struct lws_protocols sws_protocols[] = {
{ "http-only", janus_websockets_callback_https, 0, 0 },
{ "janus-protocol", janus_websockets_callback_secure, sizeof(janus_websockets_client), 0 },
{ NULL, NULL, 0 }
{ "http-only", janus_websockets_callback_https, 0, 0, WS_LIST_TERM },
{ "janus-protocol", janus_websockets_callback_secure, sizeof(janus_websockets_client), 0, WS_LIST_TERM },
{ NULL, NULL, 0, 0, WS_LIST_TERM }
};
static struct lws_protocols admin_ws_protocols[] = {
{ "http-only", janus_websockets_callback_http, 0, 0 },
{ "janus-admin-protocol", janus_websockets_admin_callback, sizeof(janus_websockets_client), 0 },
{ NULL, NULL, 0 }
{ "http-only", janus_websockets_callback_http, 0, 0, WS_LIST_TERM },
{ "janus-admin-protocol", janus_websockets_admin_callback, sizeof(janus_websockets_client), 0, WS_LIST_TERM },
{ NULL, NULL, 0, 0, WS_LIST_TERM }
};
static struct lws_protocols admin_sws_protocols[] = {
{ "http-only", janus_websockets_callback_https, 0, 0 },
{ "janus-admin-protocol", janus_websockets_admin_callback_secure, sizeof(janus_websockets_client), 0 },
{ NULL, NULL, 0 }
{ "http-only", janus_websockets_callback_https, 0, 0, WS_LIST_TERM },
{ "janus-admin-protocol", janus_websockets_admin_callback_secure, sizeof(janus_websockets_client), 0, WS_LIST_TERM },
{ NULL, NULL, 0, 0, WS_LIST_TERM }
};
/* Helper for debugging reasons */
#define CASE_STR(name) case name: return #name
Expand Down

0 comments on commit e7fec82

Please sign in to comment.