X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=parse.c;h=63095b507d147f92e07523d6590e606c0304b9e3;hp=d0684f91ad727d33690e5b5e305712898ea00e41;hb=37930de695fbf183cd9eef8b33e428921efa7cc8;hpb=862b173154812f4efe5ad198604106826422b508 diff --git a/parse.c b/parse.c index d0684f9..63095b5 100644 --- a/parse.c +++ b/parse.c @@ -9,7 +9,7 @@ * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * GNU Lesser General Public License for more details. */ #include @@ -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; @@ -35,7 +35,7 @@ void uci_parse_section(struct uci_section *s, struct uci_parse_option *opts, if (strcmp(opts[i].name, o->e.name) != 0) continue; - if (opts[i].type >= 0 && opts[i].type != o->type) + if (opts[i].type != o->type) continue; /* match found */ @@ -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;