lkml.org 
[lkml]   [2004]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] ASLA design, depth of code review and lack thereof
At Fri, 4 Jun 2004 16:29:20 -0700 (PDT),
Linus Torvalds wrote:
>
>
>
> On Sat, 5 Jun 2004 viro@parcelfarce.linux.theplanet.co.uk wrote:
> >
> >
> > case SNDRV_PCM_FORMAT_FLOAT_BE:
> > {
> > union {
> > float f;
> > u_int32_t i;
> > } u;
> > u.f = 0.0;
> > #ifdef SNDRV_LITTLE_ENDIAN
> > return bswap_32(u.i);
> > #else
> > return u.i;
> > #endif
>
> So what I wonder about is why anybody does something like this in the
> first place?
>
> Any IEEE format architecture will make 0.0 be all-zeroes, last I saw. In
> fact, any architecture (IEEE or not) where that isn't true will have
> serious problems with floating point values in bss (hint: the bss isn't
> initialzed to 0.0, it's initialized to the bit pattern 0).
>
> So what the above boils dow to is a very very strange way of writing
>
> return 0;
>
> and it has absolutely _zero_ to do with "little-endian" or anything else
> for that matter.

Yes, fully agreed.
We'll fix the code around this.


--
Takashi Iwai <tiwai@suse.de> ALSA Developer - www.alsa-project.org
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.078 / U:1.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site