cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1286?usp=email )
Change subject: gremlin: Avoid some conversion warnings ...................................................................... gremlin: Avoid some conversion warnings We know these casts are safe, so make them explicit. Change-Id: I2554b9baec6af191b0adb137e64124586dc4331c Signed-off-by: Frank Lichtenheld <[email protected]> Acked-by: Gert Doering <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1286 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg33964.html Signed-off-by: Gert Doering <[email protected]> --- M src/openvpn/gremlin.c 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/openvpn/gremlin.c b/src/openvpn/gremlin.c index 0e5e93f..a3dbff1 100644 --- a/src/openvpn/gremlin.c +++ b/src/openvpn/gremlin.c @@ -98,11 +98,6 @@ return (get_random() % n) == 0; } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wconversion" -#endif - /* * Return uniformly distributed random number between * low and high. @@ -112,7 +107,7 @@ { int ret; ASSERT(low <= high); - ret = low + (get_random() % (high - low + 1)); + ret = low + (int)(get_random() % (high - low + 1)); ASSERT(ret >= low && ret <= high); return ret; } @@ -195,7 +190,7 @@ { if (buf->len > 0) { - uint8_t r = roll(0, 255); + uint8_t r = (uint8_t)roll(0, 255); int method = roll(0, 5); switch (method) @@ -235,8 +230,4 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - #endif /* ifdef ENABLE_DEBUG */ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1286?usp=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I2554b9baec6af191b0adb137e64124586dc4331c Gerrit-Change-Number: 1286 Gerrit-PatchSet: 3 Gerrit-Owner: flichtenheld <[email protected]> Gerrit-Reviewer: cron2 <[email protected]> Gerrit-Reviewer: plaisthos <[email protected]> Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
