Jason Bruce
2002-Jul-26 12:56 UTC
[vorbis-dev] libvorbis-1.0 patch for Solaris 5.8 buggy libc qsort.
Solaris 5.8 has a quirky qsort that requires the ability to recognize elements as equal. here is a patch I have created to deal w/ this problem. I apologize if the patch is in the wrong format and would love to be corrected if wrong. I used the following to create the patch libvorbis-1.0> diff -u lib/psy.c lib/psy_new.c > libv.patch <p><p><p><p> -------------- next part -------------- --- lib/psy.c Sat Jul 13 05:18:33 2002 +++ lib/psy_new.c Fri Jul 26 14:50:10 2002 @@ -950,7 +950,10 @@ /* this is for per-channel noise normalization */ static int apsort(const void *a, const void *b){ - if(fabs(**(float **)a)>fabs(**(float **)b))return -1; + float f1=fabsf(**(float**)a); + float f2=fabsf(**(float**)b); + if(f1>f2)return -1; + if(f1==f2)return 0; return 1; }
Segher Boessenkool
2002-Jul-26 18:34 UTC
[vorbis-dev] libvorbis-1.0 patch for Solaris 5.8 buggy libc qsort.
Jason Bruce wrote:> > Solaris 5.8 has a quirky qsort that requires the ability to recognize > elements as equal. here is a patch I have created to deal w/ this > problem. I apologize if the patch is in the wrong format and would love > to be corrected if wrong. I used the following to create the patchThe patch is fine, and the patch format is fine, too. Someone please apply to CVS? Thanks :) Segher --- >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@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.