We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5096667 commit 13009aaCopy full SHA for 13009aa
opal/util/alfg.c
@@ -1,6 +1,8 @@
1
/*
2
* Copyright (c) 2014 Mellanox Technologies, Inc.
3
* All rights reserved.
4
+ * Copyright (c) 2016 Research Organization for Information Science
5
+ * and Technology (RIST). All rights reserved.
6
* $COPYRIGHT$
7
*
8
* Additional copyrights may follow
@@ -128,5 +130,6 @@ uint32_t opal_rand(opal_rng_buff_t *buff){
128
130
* @param[out] int, the same as normal rand(3)
129
131
*/
132
int opal_random(void){
- return (int)opal_rand(&alfg_buffer);
133
+ /* always return a positive int */
134
+ return (int)(opal_rand(&alfg_buffer) & 0x7FFFFFFF);
135
}
0 commit comments