Re: [PATCH] small glib fix.



On 30 May 2001 12:47:18 -0700, Darin Adler wrote:
> On Wednesday, May 30, 2001, at 12:19  PM, Anders Carlsson wrote:
> 
> > this patch fixes the g_random_boolean macro. Is it ok to commit?
> 
> Patch looks wrong to me.
> 
> > -#define g_random_boolean() (g_rand_boolean ((rand)))
> > +#define g_random_boolean() (g_rand_int () & (1<<15))
> 
> I'd want to see this:
> 
> #define g_random_boolean() ((g_rand_int () >> 15) & 1)
> 

Really? I just based it on the g_rand_boolean macro:

#define g_rand_boolean(rand) (g_rand_int ((rand)) & (1<<15))

Is that wrong too?

>      -- Darin
> 

//andersca
andersca gnu org





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]