]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/session2 nit: use `const char *` for names
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 26 Sep 2022 10:31:25 +0000 (12:31 +0200)
committerOto Šťáva <oto.stava@nic.cz>
Thu, 26 Jan 2023 11:56:08 +0000 (12:56 +0100)
That also matches the real type of those string literals.

daemon/session2.c
daemon/session2.h

index 8546fb962dc0e9b9c4874cff125bc1f4da12ccd0..7a5ce454dd7fb19abb2c5e3d3f553da1bb052d1d 100644 (file)
@@ -57,7 +57,7 @@ static enum protolayer_protocol protolayer_grp_doh[] = {
 };
 
 
-char *protolayer_protocol_names[PROTOLAYER_PROTOCOL_COUNT] = {
+const char *protolayer_protocol_names[PROTOLAYER_PROTOCOL_COUNT] = {
        [PROTOLAYER_NULL] = "(null)",
 #define XX(cid) [PROTOLAYER_##cid] = #cid,
        PROTOLAYER_PROTOCOL_MAP(XX)
@@ -79,7 +79,7 @@ static enum protolayer_protocol *protolayer_grps[PROTOLAYER_GRP_COUNT] = {
 };
 
 /** Human-readable names for protocol layer groups. */
-char *protolayer_grp_names[PROTOLAYER_GRP_COUNT] = {
+const char *protolayer_grp_names[PROTOLAYER_GRP_COUNT] = {
        [PROTOLAYER_GRP_NULL] = "(null)",
 #define XX(cid, vid, name, alpn) [PROTOLAYER_GRP_##cid] = name,
        PROTOLAYER_GRP_MAP(XX)
@@ -87,7 +87,7 @@ char *protolayer_grp_names[PROTOLAYER_GRP_COUNT] = {
 };
 
 /** Human-readable names for events. */
-char *protolayer_event_names[PROTOLAYER_EVENT_COUNT] = {
+const char *protolayer_event_names[PROTOLAYER_EVENT_COUNT] = {
        [PROTOLAYER_EVENT_NULL] = "(null)",
 #define XX(cid) [PROTOLAYER_EVENT_##cid] = #cid,
        PROTOLAYER_EVENT_MAP(XX)
@@ -95,7 +95,7 @@ char *protolayer_event_names[PROTOLAYER_EVENT_COUNT] = {
 };
 
 /** Human-readable names for payloads. */
-char *protolayer_payload_names[PROTOLAYER_PAYLOAD_COUNT] = {
+const char *protolayer_payload_names[PROTOLAYER_PAYLOAD_COUNT] = {
        [PROTOLAYER_PAYLOAD_NULL] = "(null)",
 #define XX(cid, name) [PROTOLAYER_PAYLOAD_##cid] = name,
        PROTOLAYER_PAYLOAD_MAP(XX)
index 7516ffe395faf760de258bcda861a4c471408146..c230d292975e432b5c65ed7d63404819c48e1099 100644 (file)
@@ -107,7 +107,7 @@ enum protolayer_protocol {
 
 /** Maps protocol layer type IDs to string names.
  * E.g. PROTOLAYER_HTTP has name 'HTTP'. */
-extern char *protolayer_protocol_names[];
+extern const char *protolayer_protocol_names[];
 
 /** Protocol layer groups. Each of these represents a sequence of layers in the
  * unwrap direction (wrap direction being the opposite). The sequence dictates
@@ -139,7 +139,7 @@ enum protolayer_grp {
 
 /** Maps protocol layer group IDs to human-readable descriptions.
  * E.g. PROTOLAYER_GRP_DOH has description 'DNS-over-HTTPS'. */
-extern char *protolayer_grp_names[];
+extern const char *protolayer_grp_names[];
 
 /** Flow control indicators for protocol layer `wrap` and `unwrap` callbacks.
  * Use via `protolayer_continue`, `protolayer_break`, and `protolayer_push`
@@ -218,7 +218,7 @@ enum protolayer_event_type {
        PROTOLAYER_EVENT_COUNT
 };
 
-extern char *protolayer_event_names[];
+extern const char *protolayer_event_names[];
 
 
 /** Payload types.
@@ -241,7 +241,7 @@ enum protolayer_payload_type {
        PROTOLAYER_PAYLOAD_COUNT
 };
 
-extern char *protolayer_payload_names[];
+extern const char *protolayer_payload_names[];
 
 /** Data processed by the sequence of layers. All pointed-to memory is always
  * owned by its creator. It is also the layer (group) implementor's