Re: [AD] rand() vs random()

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


On 2003-05-25, Eric <ebotcazou@xxxxxxxxxx> wrote:
> > calling it on on the system driver's init method or allegro_install()
> > should suffice, but grepping through allegro's sources i only find one
> > occurrence of rand() and that's in colblend.c, no occurrence of srand()
> > though. i beleive i have just found a bug.
> 
> This call to rand() is in a blender and we probably don't care about real 
> randomness here.

Allegro shouldn't be calling rand() at all, IMHO.  If the user starts
using the blender, his output series from rand() will be mysteriously
affected.  Luckily the number of people using the dissolve blender _and_
expecting rand() to be unaffected is probably low.  I suppose we should
just use our own private, dumb-but-fast generator for this case
(something like what Paul Pridham posted).

-- 
王浩禎




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