Re: [AD] Pending patches request

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> No, same on intel. I.e., the lower bits aren't random with rand(). I
> don't know where in the test program rand is used, but i usually do
> (rand()>>8). Or if 15/16bit are needed, this has to be
> (rand()>>8)+(rand()&0xff00) for windows.

Ok. Given that and the overflow problem, can we settle on

	(rand()>>8)+(rand()&0xff00)

for the bundled programs and

	(rand()>>8)

for the three invocations in colblend.c which look like

	return ((rand() & 255) < (int)n) ? x : y;


Angelo, is that good enough for you?

> Maybe it's time to add the "al_rand(int min, int max)" function to
> Allegro?

As a wrapper around rand()?

-- 
Eric Botcazou




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/