mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-06 15:20:12 +00:00
ruli: Fix implicit conversion from 'unsigned int' to 'float'
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
clarify type conversion
|
||||
|
||||
fixes
|
||||
| ruli_rand.c:54:47: error: implicit conversion from 'unsigned int' to 'float' changes value from 4294967295 to 4294967296 [-Werror,-Wimplicit-int-float-conversion]
|
||||
|
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
--- a/src/ruli_rand.c
|
||||
+++ b/src/ruli_rand.c
|
||||
@@ -51,7 +51,7 @@ int ruli_rand_next(ruli_rand_t *rand_ctx
|
||||
|
||||
u = isaac_rand(&rand_ctx->isaac_ctx);
|
||||
|
||||
- r = (int) ((float) (1.0 + max - min) * u / ISAAC_UB4MAXVAL + min);
|
||||
+ r = (int) ((float) (1.0 + max - min) * u / (float) (ISAAC_UB4MAXVAL + min));
|
||||
|
||||
assert(min <= r);
|
||||
assert(r <= max);
|
||||
@@ -12,6 +12,7 @@ SRC_URI = "http://download.savannah.gnu.org/releases/ruli/ruli_${PV}.orig.tar.gz
|
||||
file://0001-src-ruli_addr.c-Add-missing-format-string.patch \
|
||||
file://0001-ruli_srv-Mark-prev_addr_list_size-as-unused.patch \
|
||||
file://0001-Make-space-for-flags-from-environment.patch \
|
||||
file://float-conversion.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "e73fbfdeadddb68a703a70cea5271468"
|
||||
|
||||
Reference in New Issue
Block a user