summaryrefslogtreecommitdiff
path: root/src/common/ht.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-05-18 21:19:14 +0000
committerNick Mathewson <nickm@torproject.org>2007-05-18 21:19:14 +0000
commita18770487227bce6e356f169aa86bdef70370c76 (patch)
tree2295aeb0a3ed5757e335ac632cab90563194bd02 /src/common/ht.h
parent43d64df4fc582c698b2e2ebdaff4891409d3b6be (diff)
downloadtor-a18770487227bce6e356f169aa86bdef70370c76.tar.gz
tor-a18770487227bce6e356f169aa86bdef70370c76.zip
r12980@Kushana: nickm | 2007-05-18 14:11:05 -0400
Add a "swap" function to smartlist, add a "shuffle" function for smartlist to crypto.c, and make appropriate hashtable functions be more const. svn:r10208
Diffstat (limited to 'src/common/ht.h')
-rw-r--r--src/common/ht.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/ht.h b/src/common/ht.h
index 11b61ed341..e6afdd88ff 100644
--- a/src/common/ht.h
+++ b/src/common/ht.h
@@ -91,7 +91,7 @@ ht_string_hash(const char *s)
#define HT_PROTOTYPE(name, type, field, hashfn, eqfn) \
int name##_HT_GROW(struct name *ht, unsigned min_capacity); \
void name##_HT_CLEAR(struct name *ht); \
- int _##name##_HT_REP_IS_BAD(struct name *ht); \
+ int _##name##_HT_REP_IS_BAD(const struct name *ht); \
static INLINE void \
name##_HT_INIT(struct name *head) { \
head->hth_table_length = 0; \
@@ -119,11 +119,11 @@ ht_string_hash(const char *s)
/* Return a pointer to the element in the table 'head' matching 'elm', \
* or NULL if no such element exists */ \
static INLINE struct type * \
- name##_HT_FIND(struct name *head, struct type *elm) \
+ name##_HT_FIND(const struct name *head, struct type *elm) \
{ \
struct type **p; \
_HT_SET_HASH(elm, field, hashfn); \
- p = _##name##_HT_FIND_P(head, elm); \
+ p = _##name##_HT_FIND_P((struct name *)head, elm); \
return p ? *p : NULL; \
} \
/* Insert the element 'elm' into the table 'head'. Do not call this \
@@ -349,7 +349,7 @@ ht_string_hash(const char *s)
/* Debugging helper: return false iff the representation of 'head' is \
* internally consistent. */ \
int \
- _##name##_HT_REP_IS_BAD(struct name *head) \
+ _##name##_HT_REP_IS_BAD(const struct name *head) \
{ \
unsigned n, i; \
struct type *elm; \