[Top][All Lists]
[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."
- sort --random-sort, Frederik Eaton, 2005/11/26
- Re: sort --random-sort, Frederik Eaton, 2005/11/26
- Re: sort --random-sort, Jim Meyering, 2005/11/26
- Re: sort --random-sort,
Andreas Schwab <=
- Re: sort --random-sort, Frederik Eaton, 2005/11/26
- Re: sort --random-sort, Jim Meyering, 2005/11/29
- Re: sort --random-sort, Paul Eggert, 2005/11/29
- Re: sort --random-sort, Frederik Eaton, 2005/11/30
- Re: sort --random-sort, Jim Meyering, 2005/11/30
- Re: sort --random-sort, Frederik Eaton, 2005/11/30
- Re: sort --random-sort, Paul Eggert, 2005/11/28
- Re: sort --random-sort, Jim Meyering, 2005/11/28
- Re: sort --random-sort, Frederik Eaton, 2005/11/28