]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon nits: fix lint:tidy issues
authorOto Šťáva <oto.stava@nic.cz>
Tue, 27 Sep 2022 08:35:43 +0000 (10:35 +0200)
committerOto Šťáva <oto.stava@nic.cz>
Thu, 26 Jan 2023 11:56:08 +0000 (12:56 +0100)
daemon/engine.c
daemon/http.c
daemon/session2.c
daemon/session2.h
lib/resolve.c

index b0fcfe9cf9bf65297a2126b36002fe27718f3b3d..0be6f5132134250cc84832846deecce896ac84f4 100644 (file)
@@ -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;
 
 
index 2cf50d2e536dce3fceb88c96d52132bcee40c6ba..08e337e998b8d4c3bc2cf78ad841c91dceb457bf 100644 (file)
@@ -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;
                }
index d0cb937b499721f53f1f74705b18407070bffdc9..e584373f5920956ede66116015feb3fe32934486 100644 (file)
@@ -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;
                }
 
index afc6f5625f80892c835d04c422c9daa40adc793c..f9d9685e03e0d870c12a9c18c6bf36593d6f1b41 100644 (file)
@@ -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);
 
index 46df95ac7c883e95a7ee26a19c9b248c5f25afbf..bbda5e1f0b81f1b4860f261bb4655b72b6e4a132 100644 (file)
@@ -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)