]> granicus.if.org Git - libevent/commitdiff
Invert the sense and the name of HT_CACHE_HASH_VALUES
authorNick Mathewson <nickm@torproject.org>
Mon, 13 Feb 2012 22:59:14 +0000 (17:59 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 13 Feb 2012 22:59:14 +0000 (17:59 -0500)
This is meant to make it easier to merge ht-internal.h back upstream
into Tor.

event-internal.h
event.c
ht-internal.h

index 1b6421db82c00fbcbc1ec503b1c5397044ff393d..1e7d1ce353910f793f304c1ac624a6bb7f175589 100644 (file)
@@ -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 8b6a0da71aeee60ba660d32a7124feb747606e40..9f9b0915b8dc627a10610e7f786e04fbe8fdf295 100644 (file)
--- 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"
 
index 46738251862eb04f64509232bd9f90979f4b1d42..e9070f852b93eda69029ddb47736483db4f444fc 100644 (file)
 #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)       \