Ver código fonte

More fixes to libottery.

tags/1.0.6
Vsevolod Stakhov 8 anos atrás
pai
commit
b8bc9298b1

+ 10
- 0
contrib/libottery/ottery-internal.h Ver arquivo

@@ -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. */

+ 0
- 6
contrib/libottery/ottery.c Ver arquivo

@@ -33,12 +33,6 @@
#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


+ 0
- 9
contrib/libottery/ottery_global.c Ver arquivo

@@ -17,15 +17,6 @@
#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;

Carregando…
Cancelar
Salvar