From: Oto Šťáva Date: Tue, 27 Sep 2022 08:35:43 +0000 (+0200) Subject: daemon nits: fix lint:tidy issues X-Git-Tag: v6.0.2~42^2~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c3fd0508591618159df73e0a87bf239e7f9653e;p=thirdparty%2Fknot-resolver.git daemon nits: fix lint:tidy issues --- diff --git a/daemon/engine.c b/daemon/engine.c index b0fcfe9cf..0be6f5132 100644 --- a/daemon/engine.c +++ b/daemon/engine.c @@ -41,7 +41,7 @@ const size_t CLEANUP_TIMER = 5*60*1000; */ struct args *the_args; -static struct engine engine = {0}; +static struct engine engine = {{0}}; struct engine *the_engine = NULL; diff --git a/daemon/http.c b/daemon/http.c index 2cf50d2e5..08e337e99 100644 --- a/daemon/http.c +++ b/daemon/http.c @@ -615,7 +615,7 @@ static int header_callback(nghttp2_session *h2, const nghttp2_frame *frame, if (!strcasecmp("content-type", (const char *)name)) { /* TODO: add a per-group option for content-type if we need to * support protocols other than DNS here */ - if (strcasecmp("application/dns-message", (const char *)value)) { + if (strcasecmp("application/dns-message", (const char *)value) != 0) { set_status(ctx, HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE); return 0; } diff --git a/daemon/session2.c b/daemon/session2.c index d0cb937b4..e584373f5 100644 --- a/daemon/session2.c +++ b/daemon/session2.c @@ -26,7 +26,7 @@ static int session2_transport_event(struct session2 *s, enum protolayer_event_type event, void *baton); -struct protolayer_globals protolayer_globals[PROTOLAYER_PROTOCOL_COUNT] = {0}; +struct protolayer_globals protolayer_globals[PROTOLAYER_PROTOCOL_COUNT] = {{0}}; static enum protolayer_protocol protolayer_grp_doudp[] = { @@ -81,7 +81,7 @@ static enum protolayer_protocol *protolayer_grps[PROTOLAYER_GRP_COUNT] = { /** Human-readable names for protocol layer groups. */ const char *protolayer_grp_names[PROTOLAYER_GRP_COUNT] = { [PROTOLAYER_GRP_NULL] = "(null)", -#define XX(cid, vid, name) [PROTOLAYER_GRP_##cid] = name, +#define XX(cid, vid, name) [PROTOLAYER_GRP_##cid] = (name), PROTOLAYER_GRP_MAP(XX) #undef XX }; @@ -97,7 +97,7 @@ const char *protolayer_event_names[PROTOLAYER_EVENT_COUNT] = { /** Human-readable names for payloads. */ const char *protolayer_payload_names[PROTOLAYER_PAYLOAD_COUNT] = { [PROTOLAYER_PAYLOAD_NULL] = "(null)", -#define XX(cid, name) [PROTOLAYER_PAYLOAD_##cid] = name, +#define XX(cid, name) [PROTOLAYER_PAYLOAD_##cid] = (name), PROTOLAYER_PAYLOAD_MAP(XX) #undef XX }; @@ -458,7 +458,7 @@ static int protolayer_manager_submit( struct protolayer_globals *globals = &protolayer_globals[p]; struct protolayer_data *iter_data = protolayer_iter_data_get(ctx, i); if (iter_data) { - bzero(iter_data, globals->iter_size); + memset(iter_data, 0, globals->iter_size); iter_data->session = manager->session; } @@ -544,7 +544,7 @@ static struct protolayer_manager *protolayer_manager_new( struct protolayer_globals *globals = &protolayer_globals[protocols[i]]; struct protolayer_data *sess_data = protolayer_sess_data_get(m, i); if (sess_data) { - bzero(sess_data, globals->sess_size); + memset(sess_data, 0, globals->sess_size); sess_data->session = s; } diff --git a/daemon/session2.h b/daemon/session2.h index afc6f5625..f9d9685e0 100644 --- a/daemon/session2.h +++ b/daemon/session2.h @@ -916,7 +916,7 @@ int session2_wrap_after(struct session2 *s, enum protolayer_protocol protocol, /** Sends an event to be synchronously processed by the protocol layers of the * specified session. The layers are first iterated through in the `_UNWRAP` * direction, then bounced back in the `_WRAP` direction. */ -void session2_event(struct session2 *s, enum protolayer_event_type type, void *baton); +void session2_event(struct session2 *s, enum protolayer_event_type event, void *baton); /** Sends an event to be synchronously processed by the protocol layers of the * specified session, starting from the specified `protocol` in the `_UNWRAP` @@ -927,7 +927,7 @@ void session2_event(struct session2 *s, enum protolayer_event_type type, void *b * specified by `protocol` and those before it are only skipped in the * `_UNWRAP` direction! */ void session2_event_after(struct session2 *s, enum protolayer_protocol protocol, - enum protolayer_event_type type, void *baton); + enum protolayer_event_type event, void *baton); void session2_init_request(struct session2 *s, struct kr_request *req); diff --git a/lib/resolve.c b/lib/resolve.c index 46df95ac7..bbda5e1f0 100644 --- a/lib/resolve.c +++ b/lib/resolve.c @@ -42,7 +42,7 @@ #endif #endif -static struct kr_context the_resolver_value = {0}; +static struct kr_context the_resolver_value = {{0}}; struct kr_context *the_resolver = NULL; bool kr_rank_check(uint8_t rank)