random: Rearrange random.h
I think ifdef is easier to read than ifndef. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
97c6c836d3
commit
86b15743a1
|
@ -4,17 +4,17 @@
|
|||
#ifndef OCARINA_CORE_RANDOM_H
|
||||
#define OCARINA_CORE_RANDOM_H
|
||||
|
||||
#ifndef CONFIG_TEST
|
||||
#ifdef CONFIG_TEST
|
||||
|
||||
void _seed_random(unsigned int);
|
||||
unsigned int _pick_random();
|
||||
|
||||
#else /* CONFIG_TEST */
|
||||
|
||||
#include <stdlib.h>
|
||||
static inline void _seed_random(unsigned int n) { srand(time(NULL) + n); }
|
||||
static inline unsigned int _pick_random() { return rand(); }
|
||||
|
||||
#else /* CONFIG_TEST */
|
||||
|
||||
void _seed_random(unsigned int);
|
||||
unsigned int _pick_random();
|
||||
|
||||
#endif /* CONFIG_TEST */
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue