[oe,meta-networking,4/5] ruli: Fix implicit conversion from 'unsigned int' to 'float'

Message ID 20191229182544.16104-4-raj.khem@gmail.com
State Accepted
Commit a721c091a81ae8c62788f0e7035f34f805fe63e3
Headers show
Series
  • [oe,meta-oe,v2,1/5] glm: Upgrade to 0.9.9.6
Related show

Commit Message

Khem Raj Dec. 29, 2019, 6:25 p.m.
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 .../ruli/files/float-conversion.patch         | 19 +++++++++++++++++++
 .../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

-- 
2.24.1

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

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 0000000000..999f23fc6a
--- /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 <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);
diff --git a/meta-networking/recipes-support/ruli/ruli_0.36.bb b/meta-networking/recipes-support/ruli/ruli_0.36.bb
index 8548f9a353..f920b592ac 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"