bug-coreutils
[Top][All Lists]
Advanced

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

Re: sort --random-sort


From: Andreas Schwab
Subject: Re: sort --random-sort
Date: Sat, 26 Nov 2005 17:02:31 +0100
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux)

Jim Meyering <address@hidden> writes:

>> +  memcpy (s, rand_state, sizeof (struct isaac_state));
>
> Please do this instead:
>   memcpy (s, rand_state, sizeof *s);

"*s = *rand_state" should work just fine.

> ...
>> +      else if (key->random_hash)
>> +        {
>> +          char diga[HASH_SIZE];
>> +          char digb[HASH_SIZE];
>
> If you declare these to be of type `uint32_t diga[HASH_WORDS]',
> then you can remove the casts below:

This is not only cosmetical, the char arrays will likely be unaligned for
uint32_t.

Andreas.

-- 
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]