** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
**
-** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
+** $Date: 2002/04/17 19:30:41 $ $Revision: 1.2 $
*/
/*
-** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/quicksort.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
+** $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/nurbtess/quicksort.cc,v 1.2 2002/04/17 19:30:41 brianp Exp $
*/
#include <stdlib.h>
#include <stdio.h>
-static void swap(void *v[], int i, int j);
+
+static void swap(void *v[], int i, int j)
+{
+ void *temp;
+ temp = v[i];
+ v[i] = v[j];
+ v[j] = temp;
+}
/*as an example to use this function to
*sort integers, you need to supply the function
int (*comp) (void *, void *))
{
int i, last;
- void swap(void *v[], int , int);
if(left >= right) /*do nothing if array contains */
return; /*fewer than two elements*/
quicksort(v, left, last-1, comp);
quicksort(v, last+1, right, comp);
}
-
-void swap(void *v[], int i, int j)
-{
- void *temp;
- temp = v[i];
- v[i] = v[j];
- v[j] = temp;
-}
-