Fix sort comparison functions to return -1,0,1 as per spec
[platform/upstream/libvorbis.git] / lib / lsp.c
index 0048aaa..83b1bee 100644 (file)
--- a/lib/lsp.c
+++ b/lib/lsp.c
@@ -11,7 +11,7 @@
  ********************************************************************
 
   function: LSP (also called LSF) conversion routines
-  last mod: $Id: lsp.c,v 1.22 2002/07/17 21:28:37 xiphmont Exp $
+  last mod: $Id: lsp.c,v 1.23 2002/10/11 07:44:28 xiphmont Exp $
 
   The LSP generation code is taken (with minimal modification and a
   few bugfixes) from "On the Computation of the LSP Frequencies" by
@@ -294,10 +294,7 @@ static void cheby(float *g, int ord) {
 }
 
 static int comp(const void *a,const void *b){
-  if(*(float *)a<*(float *)b)
-    return(1);
-  else
-    return(-1);
+  return (*(float *)a<*(float *)b)-(*(float *)a>*(float *)b);
 }
 
 /* Newton-Raphson-Maehly actually functioned as a decent root finder,