diff options
author | Khem Raj <raj.khem@gmail.com> | 2019-12-29 10:22:01 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-12-29 10:32:10 -0800 |
commit | a721c091a81ae8c62788f0e7035f34f805fe63e3 (patch) | |
tree | 06dcb5c742749d8851f3e98006c35cd6233db4c0 | |
parent | 81072061635a20789a4f084f94cea699a47c8580 (diff) | |
download | meta-openembedded-a721c091a81ae8c62788f0e7035f34f805fe63e3.tar.gz |
ruli: Fix implicit conversion from 'unsigned int' to 'float'
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-networking/recipes-support/ruli/files/float-conversion.patch | 19 | ||||
-rw-r--r-- | meta-networking/recipes-support/ruli/ruli_0.36.bb | 1 |
2 files changed, 20 insertions, 0 deletions
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 @@ | |||
1 | clarify type conversion | ||
2 | |||
3 | fixes | ||
4 | | ruli_rand.c:54:47: error: implicit conversion from 'unsigned int' to 'float' changes value from 4294967295 to 4294967296 [-Werror,-Wimplicit-int-float-conversion] | ||
5 | | | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | --- a/src/ruli_rand.c | ||
10 | +++ b/src/ruli_rand.c | ||
11 | @@ -51,7 +51,7 @@ int ruli_rand_next(ruli_rand_t *rand_ctx | ||
12 | |||
13 | u = isaac_rand(&rand_ctx->isaac_ctx); | ||
14 | |||
15 | - r = (int) ((float) (1.0 + max - min) * u / ISAAC_UB4MAXVAL + min); | ||
16 | + r = (int) ((float) (1.0 + max - min) * u / (float) (ISAAC_UB4MAXVAL + min)); | ||
17 | |||
18 | assert(min <= r); | ||
19 | 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 | |||
12 | file://0001-src-ruli_addr.c-Add-missing-format-string.patch \ | 12 | file://0001-src-ruli_addr.c-Add-missing-format-string.patch \ |
13 | file://0001-ruli_srv-Mark-prev_addr_list_size-as-unused.patch \ | 13 | file://0001-ruli_srv-Mark-prev_addr_list_size-as-unused.patch \ |
14 | file://0001-Make-space-for-flags-from-environment.patch \ | 14 | file://0001-Make-space-for-flags-from-environment.patch \ |
15 | file://float-conversion.patch \ | ||
15 | " | 16 | " |
16 | 17 | ||
17 | SRC_URI[md5sum] = "e73fbfdeadddb68a703a70cea5271468" | 18 | SRC_URI[md5sum] = "e73fbfdeadddb68a703a70cea5271468" |