diff options
author | Brian Paul <[email protected]> | 2002-04-17 19:30:41 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2002-04-17 19:30:41 +0000 |
commit | 4c1f79264e1923b21571abb13983f38ea1a90dee (patch) | |
tree | b63d03a2fbb4fe56bea9c292cb41c39f26073d9e | |
parent | 620735af454cc2617d3d2fc681cf86f1bf47f833 (diff) |
fixed problem with swap() function and GCC3 (patch 414404)
-rw-r--r-- | src/glu/sgi/libnurbs/nurbtess/quicksort.cc | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/glu/sgi/libnurbs/nurbtess/quicksort.cc b/src/glu/sgi/libnurbs/nurbtess/quicksort.cc index 0806882e723..f411aaa82a5 100644 --- a/src/glu/sgi/libnurbs/nurbtess/quicksort.cc +++ b/src/glu/sgi/libnurbs/nurbtess/quicksort.cc @@ -31,16 +31,23 @@ ** 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 @@ -58,7 +65,6 @@ void quicksort(void *v[], int left, int right, 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*/ @@ -71,12 +77,3 @@ void quicksort(void *v[], int left, int right, 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; -} - |