]> source.dussan.org Git - rspamd.git/commitdiff
More fixes to libottery.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Oct 2015 10:46:21 +0000 (11:46 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Oct 2015 10:46:21 +0000 (11:46 +0100)
contrib/libottery/ottery-internal.h
contrib/libottery/ottery.c
contrib/libottery/ottery_global.c

index 7e3f46e05eecf917c7d888cae4ccd0310317aaf7..24279043ec074b1fc5c2b33dcb0757448ceda4e1 100644 (file)
@@ -185,6 +185,16 @@ struct ottery_prf {
   void (*generate)(void *state, uint8_t *output, uint32_t idx);
 };
 
+/**
+ * Evaluate the condition 'x', while hinting to the compiler that it is
+ * likely to be false.
+ */
+#ifdef __GNUC__
+#define UNLIKELY(x) __builtin_expect((x), 0)
+#else
+#define UNLIKELY(x) (x)
+#endif
+
 #ifdef OTTERY_INTERNAL
 struct ottery_config {
   /** The PRF that we should use.  If NULL, we use the default. */
index 851932e94e2a082de7c6a7e5844ec1b1dc49b3b3..fd20b113264709662b669585c7aec1ba8ea2336b 100644 (file)
 #define OTTERY_NO_PID_CHECK
 #endif
 
-/**
- * Evaluate the condition 'x', while hinting to the compiler that it is
- * likely to be false.
- */
-#define UNLIKELY(x) __builtin_expect((x), 0)
-
 /** Magic number for deciding whether an ottery_state is initialized. */
 #define MAGIC_BASIS 0x11b07734
 
index a1d919885b64bcbcf8eca10e2f5469ff416132f3..3c814f5ecdf1d83da2a5c44db4e4001076082958 100644 (file)
 #include "ottery.h"
 #include "ottery_st.h"
 
-/**
- * Evaluate the condition 'x', while hinting to the compiler that it is
- * likely to be false.
- */
-#ifdef __GNUC__
-#define UNLIKELY(x) __builtin_expect((x), 0)
-#else
-#define UNLIKELY(x) (x)
-#endif
 
 /** Flag: true iff ottery_global_state_ is initialized. */
 static int ottery_global_state_initialized_ = 0;