From 352572f18e30295cab3d260efd5c5455026443fa Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 5 Apr 2011 03:33:38 +0200 Subject: [PATCH] constify arguments to parser function --- parse.c | 8 ++++---- uci.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/parse.c b/parse.c index d0684f9..3bea3e4 100644 --- a/parse.c +++ b/parse.c @@ -17,7 +17,7 @@ #include "uci.h" -void uci_parse_section(struct uci_section *s, struct uci_parse_option *opts, +void uci_parse_section(struct uci_section *s, const struct uci_parse_option *opts, int n_opts, struct uci_option **tb) { struct uci_element *e; @@ -90,9 +90,9 @@ static uint32_t hash_murmur2(uint32_t h, const void * key, int len) return h; } -static uint32_t uci_hash_list(uint32_t h, struct uci_list *list) +static uint32_t uci_hash_list(uint32_t h, const struct uci_list *list) { - struct uci_element *e; + const struct uci_element *e; uci_foreach_element(list, e) { h = hash_murmur2(h, e->name, strlen(e->name) + 1); @@ -106,7 +106,7 @@ uint32_t uci_hash_options(struct uci_option **tb, int n_opts) int i; for (i = 0; i < n_opts; i++) { - struct uci_option *o = tb[i]; + const struct uci_option *o = tb[i]; if (!tb[i]) continue; diff --git a/uci.h b/uci.h index 696f4f6..a5eb7f1 100644 --- a/uci.h +++ b/uci.h @@ -357,7 +357,7 @@ int uci_lookup_next(struct uci_context *ctx, struct uci_element **e, struct uci_ * @n_opts: number of options to look up * @tb: array of pointers to found options */ -void uci_parse_section(struct uci_section *s, struct uci_parse_option *opts, +void uci_parse_section(struct uci_section *s, const struct uci_parse_option *opts, int n_opts, struct uci_option **tb); /** -- 2.30.2