On Fri, Aug 07, 2015 at 03:06:24PM +0100, Andrew Cooper wrote:
> Coverity warns for every occurrence of rand(), which is made worse
> because each time the IDL changes, some of the calls get re-flagged.
> 
> Collect all calls to rand() in a single function, test_rand(), which
> takes a modulo parameter for convenience.  This turns 40 defects
> currently into 1, which won't get re-flagged when the IDL changes.
> 
> In addition, fix the erroneous random choice for libxl_defbool_set().
> "!!rand() % 1" is unconditionally 0, and even without the "% 1" would
> still be very heavily skewed in one direction.
> 
> Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>

Acked-by: Wei Liu <wei.l...@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to