Re: [AD] Pending patches request

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


> srand(time(NULL)) at the start of the program?

Yes.

> Yes I tried it, and it didn't improve randomness in any way.
> The problem is the OSX libc rand() implementation places the most random
> bits in the higher word, while the lower word always gets values that
> repeat somewhat often. On Intel machines it seems to be the contrary.

Endianess, endianess...

> So (rand()+(rand()>>16)) should solve the issue...

But it's ugly. Try to devise an elegant macro to hide this ugliness.

> > This patch is only a last resort solution. We have first to understand
> > why we are not able to manipulate UTF16-BE, especially on big-endian
> > platforms.
>
> I agree; I'll investigate more on this.

I will too. The good news is that I can reproduce the failures on x86 by 
switching everything (code and data) to UTF16-BE. And it's a bit weird 
because if I swap back the first two bytes of message_it[], I get 'nuti' on 
the screen!

-- 
Eric Botcazou




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