[vorbis-dev] optimizing float to int conversions

dean gaudet dean-list-vorbis-dev at arctic.org
Wed May 5 21:03:53 PDT 2004



On Thu, 6 May 2004, Segher Boessenkool wrote:

> >   uint32_t u1 = **(uint32_t **)a;
> >   uint32_t u2 = **(uint32_t **)b;
>
> This isn't valid C (it's violating aliasing rules).

heh... as if that's the least valid C of the code i sent... i'd think the
assumptions about IEEE single precision format and endianness are a bit
more problematic than a few casts :)

but at any rate, those are void *a, void *b ... how am i violating
aliasing rules?  i see i dropped the const qualifier -- that's true of the
existing apsort() code as well though.

fwiw it's not possible for that routine to be inlined, it's called via
indirect function call from qsort().

-dean
--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list