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 134a91eaa518a4327a1fecbd14422ec3fa3a1308..4e8a421e629c0b793a8f98ffec1db1edff2f4f6d 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 dd590afb804fe83a529709b3a4cb40b9c7a17712..67a4bab29686e8d768328c0dccb700ed219461d2 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)