[vorbis-dev] libvorbis-1.0 patch for Solaris 5.8 buggy libc qsort.

Jason Bruce jbruce at JBruce.net
Fri Jul 26 12:56:52 PDT 2002


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;
 }
 


More information about the Vorbis-dev mailing list