From: Nick Mathewson Date: Mon, 13 Feb 2012 22:59:14 +0000 (-0500) Subject: Invert the sense and the name of HT_CACHE_HASH_VALUES X-Git-Tag: release-2.1.1-alpha~97 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46e5bb7bdcda97b0f6730a6ad00eb8ebb90a5aab;p=libevent 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. --- diff --git a/event-internal.h b/event-internal.h index 1b6421db..1e7d1ce3 100644 --- a/event-internal.h +++ b/event-internal.h @@ -112,6 +112,7 @@ struct eventop { /* #define HT_CACHE_HASH_VALS */ #ifdef EVMAP_USE_HT +#define HT_NO_CACHE_HASH_VALUES #include "ht-internal.h" struct event_map_entry; HT_HEAD(event_io_map, event_map_entry); diff --git a/event.c b/event.c index 8b6a0da7..9f9b0915 100644 --- a/event.c +++ b/event.c @@ -68,6 +68,7 @@ #include "evmap-internal.h" #include "iocp-internal.h" #include "changelist-internal.h" +#define HT_NO_CACHE_HASH_VALUES #include "ht-internal.h" #include "util-internal.h" diff --git a/ht-internal.h b/ht-internal.h index 46738251..e9070f85 100644 --- a/ht-internal.h +++ b/ht-internal.h @@ -25,16 +25,16 @@ #define HT_INITIALIZER() \ { NULL, 0, 0, 0, -1 } -#ifdef HT_CACHE_HASH_VALUES +#ifdef HT_NO_CACHE_HASH_VALUES #define HT_ENTRY(type) \ struct { \ struct type *hte_next; \ - unsigned hte_hash; \ } #else #define HT_ENTRY(type) \ struct { \ struct type *hte_next; \ + unsigned hte_hash; \ } #endif @@ -97,7 +97,7 @@ ht_string_hash(const char *s) return h; } -#ifdef HT_CACHE_HASH_VALUES +#ifndef HT_NO_CACHE_HASH_VALUES #define _HT_SET_HASH(elm, field, hashfn) \ do { (elm)->field.hte_hash = hashfn(elm); } while (0) #define _HT_SET_HASHVAL(elm, field, val) \