cache: constify cache_record fields
authorFelix Fietkau <nbd@openwrt.org>
Tue, 3 Jun 2014 22:08:01 +0000 (00:08 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 3 Jun 2014 22:08:01 +0000 (00:08 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
cache.h
ubus.c

diff --git a/cache.h b/cache.h
index 134a91e..4e8a421 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -29,14 +29,14 @@ struct cache_entry {
 };
 
 struct cache_record {
-        struct avl_node avl;
+       struct avl_node avl;
 
-       char *record;
+       const char *record;
        uint16_t type;
        uint32_t ttl;
        int port;
-       char *txt;
-       uint8_t *rdata;
+       const char *txt;
+       const uint8_t *rdata;
        uint16_t rdlength;
        time_t time;
 };
diff --git a/ubus.c b/ubus.c
index dd590af..67a4bab 100644 (file)
--- a/ubus.c
+++ b/ubus.c
@@ -47,7 +47,7 @@ static void
 mdns_add_records(const char *name)
 {
        struct cache_record *r, *q = avl_find_element(&records, name, r, avl);
-       char *txt;
+       const char *txt;
        char buffer[MAX_NAME_LEN];
 
        if (!q)