From 059b7e4f3034c68cf2967a54e6320019c91e7fca Mon Sep 17 00:00:00 2001 From: Chad Sellers Date: Mon, 6 Nov 2006 12:38:17 -0500 Subject: [PATCH] --- yaml --- r: 41367 b: refs/heads/master c: bb242497474da317a7169cc939c741ccf2e79e8c h: refs/heads/master i: 41365: e2fb6acc45863bc0c83634e79ea6dd8989c46f15 41363: 7adc1f9f1f3835e02bdcca3f49584c765884628b 41359: a0e8c27d07d868562747e3efaebd6bcb999ac49c v: v3 --- [refs] | 2 +- trunk/security/selinux/ss/hashtab.c | 6 +++--- trunk/security/selinux/ss/hashtab.h | 10 +++++----- trunk/security/selinux/ss/symtab.c | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index 0bf8c322a003..4e0622b24509 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5c45899879e8caadb78f04c9c639f4c2025b9f00 +refs/heads/master: bb242497474da317a7169cc939c741ccf2e79e8c diff --git a/trunk/security/selinux/ss/hashtab.c b/trunk/security/selinux/ss/hashtab.c index 24e5ec957630..77b530c3bbce 100644 --- a/trunk/security/selinux/ss/hashtab.c +++ b/trunk/security/selinux/ss/hashtab.c @@ -8,8 +8,8 @@ #include #include "hashtab.h" -struct hashtab *hashtab_create(u32 (*hash_value)(struct hashtab *h, void *key), - int (*keycmp)(struct hashtab *h, void *key1, void *key2), +struct hashtab *hashtab_create(u32 (*hash_value)(struct hashtab *h, const void *key), + int (*keycmp)(struct hashtab *h, const void *key1, const void *key2), u32 size) { struct hashtab *p; @@ -71,7 +71,7 @@ int hashtab_insert(struct hashtab *h, void *key, void *datum) return 0; } -void *hashtab_search(struct hashtab *h, void *key) +void *hashtab_search(struct hashtab *h, const void *key) { u32 hvalue; struct hashtab_node *cur; diff --git a/trunk/security/selinux/ss/hashtab.h b/trunk/security/selinux/ss/hashtab.h index 4cc85816a718..7e2ff3e3c6d2 100644 --- a/trunk/security/selinux/ss/hashtab.h +++ b/trunk/security/selinux/ss/hashtab.h @@ -22,9 +22,9 @@ struct hashtab { struct hashtab_node **htable; /* hash table */ u32 size; /* number of slots in hash table */ u32 nel; /* number of elements in hash table */ - u32 (*hash_value)(struct hashtab *h, void *key); + u32 (*hash_value)(struct hashtab *h, const void *key); /* hash function */ - int (*keycmp)(struct hashtab *h, void *key1, void *key2); + int (*keycmp)(struct hashtab *h, const void *key1, const void *key2); /* key comparison function */ }; @@ -39,8 +39,8 @@ struct hashtab_info { * Returns NULL if insufficent space is available or * the new hash table otherwise. */ -struct hashtab *hashtab_create(u32 (*hash_value)(struct hashtab *h, void *key), - int (*keycmp)(struct hashtab *h, void *key1, void *key2), +struct hashtab *hashtab_create(u32 (*hash_value)(struct hashtab *h, const void *key), + int (*keycmp)(struct hashtab *h, const void *key1, const void *key2), u32 size); /* @@ -59,7 +59,7 @@ int hashtab_insert(struct hashtab *h, void *k, void *d); * Returns NULL if no entry has the specified key or * the datum of the entry otherwise. */ -void *hashtab_search(struct hashtab *h, void *k); +void *hashtab_search(struct hashtab *h, const void *k); /* * Destroys the specified hash table. diff --git a/trunk/security/selinux/ss/symtab.c b/trunk/security/selinux/ss/symtab.c index 24a10d36d3b6..837658a98a54 100644 --- a/trunk/security/selinux/ss/symtab.c +++ b/trunk/security/selinux/ss/symtab.c @@ -9,9 +9,9 @@ #include #include "symtab.h" -static unsigned int symhash(struct hashtab *h, void *key) +static unsigned int symhash(struct hashtab *h, const void *key) { - char *p, *keyp; + const char *p, *keyp; unsigned int size; unsigned int val; @@ -23,9 +23,9 @@ static unsigned int symhash(struct hashtab *h, void *key) return val & (h->size - 1); } -static int symcmp(struct hashtab *h, void *key1, void *key2) +static int symcmp(struct hashtab *h, const void *key1, const void *key2) { - char *keyp1, *keyp2; + const char *keyp1, *keyp2; keyp1 = key1; keyp2 = key2;