Invert the sense and the name of HT_CACHE_HASH_VALUES

This is meant to make it easier to merge ht-internal.h back upstream
into Tor.
This commit is contained in:
Nick Mathewson 2012-02-13 17:59:14 -05:00
parent 6c81be746c
commit 46e5bb7bdc
3 changed files with 5 additions and 3 deletions

View File

@ -112,6 +112,7 @@ struct eventop {
/* #define HT_CACHE_HASH_VALS */ /* #define HT_CACHE_HASH_VALS */
#ifdef EVMAP_USE_HT #ifdef EVMAP_USE_HT
#define HT_NO_CACHE_HASH_VALUES
#include "ht-internal.h" #include "ht-internal.h"
struct event_map_entry; struct event_map_entry;
HT_HEAD(event_io_map, event_map_entry); HT_HEAD(event_io_map, event_map_entry);

View File

@ -68,6 +68,7 @@
#include "evmap-internal.h" #include "evmap-internal.h"
#include "iocp-internal.h" #include "iocp-internal.h"
#include "changelist-internal.h" #include "changelist-internal.h"
#define HT_NO_CACHE_HASH_VALUES
#include "ht-internal.h" #include "ht-internal.h"
#include "util-internal.h" #include "util-internal.h"

View File

@ -25,16 +25,16 @@
#define HT_INITIALIZER() \ #define HT_INITIALIZER() \
{ NULL, 0, 0, 0, -1 } { NULL, 0, 0, 0, -1 }
#ifdef HT_CACHE_HASH_VALUES #ifdef HT_NO_CACHE_HASH_VALUES
#define HT_ENTRY(type) \ #define HT_ENTRY(type) \
struct { \ struct { \
struct type *hte_next; \ struct type *hte_next; \
unsigned hte_hash; \
} }
#else #else
#define HT_ENTRY(type) \ #define HT_ENTRY(type) \
struct { \ struct { \
struct type *hte_next; \ struct type *hte_next; \
unsigned hte_hash; \
} }
#endif #endif
@ -97,7 +97,7 @@ ht_string_hash(const char *s)
return h; return h;
} }
#ifdef HT_CACHE_HASH_VALUES #ifndef HT_NO_CACHE_HASH_VALUES
#define _HT_SET_HASH(elm, field, hashfn) \ #define _HT_SET_HASH(elm, field, hashfn) \
do { (elm)->field.hte_hash = hashfn(elm); } while (0) do { (elm)->field.hte_hash = hashfn(elm); } while (0)
#define _HT_SET_HASHVAL(elm, field, val) \ #define _HT_SET_HASHVAL(elm, field, val) \