From 79a46799e052d4ae31b3bf6d96353df9604e9ed4 Mon Sep 17 00:00:00 2001 From: "VMware, Inc" <> Date: Mon, 26 Apr 2010 11:22:47 -0700 Subject: [PATCH] lib/misc: cleanup code standard cleanup Signed-off-by: Marcelo Vanzin --- open-vm-tools/lib/misc/random.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/open-vm-tools/lib/misc/random.c b/open-vm-tools/lib/misc/random.c index abe027785..a4b4925d5 100644 --- a/open-vm-tools/lib/misc/random.c +++ b/open-vm-tools/lib/misc/random.c @@ -285,7 +285,7 @@ Random_Quick(void *context) // IN/OUT: } -/** +/* *---------------------------------------------------------------------- * * FastRand -- @@ -309,11 +309,12 @@ Random_Quick(void *context) // IN/OUT: */ int -FastRand(int seed) +FastRand(int seed) // IN: { uint64 product = 33614 * (uint64)seed; uint32 product_lo = (uint32)(product & 0xffffffff) >> 1; uint32 product_hi = product >> 32; int32 test = product_lo + product_hi; + return test > 0 ? test : (test & 0x7fffffff) + 1; } -- 2.47.3