git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prepare for post-2.2.0 (2.2.90).
[sliver-openvswitch.git]
/
lib
/
random.h
diff --git
a/lib/random.h
b/lib/random.h
index
5bb041e
..
5fe50b7
100644
(file)
--- a/
lib/random.h
+++ b/
lib/random.h
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2008, 2009, 2010, 2012 Nicira
Networks
.
+ * Copyright (c) 2008, 2009, 2010, 2012 Nicira
, Inc
.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-24,10
+24,25
@@
void random_init(void);
void random_set_seed(uint32_t);
void random_bytes(void *, size_t);
void random_set_seed(uint32_t);
void random_bytes(void *, size_t);
-uint8_t random_uint8(void);
-uint16_t random_uint16(void);
uint32_t random_uint32(void);
uint64_t random_uint64(void);
uint32_t random_uint32(void);
uint64_t random_uint64(void);
-int random_range(int max);
+
+static inline int
+random_range(int max)
+{
+ return random_uint32() % max;
+}
+
+static inline uint8_t
+random_uint8(void)
+{
+ return random_uint32();
+}
+
+static inline uint16_t
+random_uint16(void)
+{
+ return random_uint32();
+}
#endif /* random.h */
#endif /* random.h */