From a721c091a81ae8c62788f0e7035f34f805fe63e3 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 29 Dec 2019 10:22:01 -0800 Subject: ruli: Fix implicit conversion from 'unsigned int' to 'float' Signed-off-by: Khem Raj --- .../recipes-support/ruli/files/float-conversion.patch | 19 +++++++++++++++++++ meta-networking/recipes-support/ruli/ruli_0.36.bb | 1 + 2 files changed, 20 insertions(+) create mode 100644 meta-networking/recipes-support/ruli/files/float-conversion.patch diff --git a/meta-networking/recipes-support/ruli/files/float-conversion.patch b/meta-networking/recipes-support/ruli/files/float-conversion.patch new file mode 100644 index 000000000..999f23fc6 --- /dev/null +++ b/meta-networking/recipes-support/ruli/files/float-conversion.patch @@ -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 +--- 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); diff --git a/meta-networking/recipes-support/ruli/ruli_0.36.bb b/meta-networking/recipes-support/ruli/ruli_0.36.bb index 8548f9a35..f920b592a 100644 --- a/meta-networking/recipes-support/ruli/ruli_0.36.bb +++ b/meta-networking/recipes-support/ruli/ruli_0.36.bb @@ -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" -- cgit v1.2.3-54-g00ecf