]> git.sur5r.net Git - openldap/commitdiff
Rename SWAP() to avoid conflict with sqlightning.
authorHallvard Furuseth <hallvard@openldap.org>
Mon, 23 Sep 2013 18:20:05 +0000 (20:20 +0200)
committerHallvard Furuseth <hallvard@openldap.org>
Mon, 23 Sep 2013 18:20:05 +0000 (20:20 +0200)
Happened since sqlightning #includes mdb.c, midl.c.

libraries/liblmdb/midl.c

index 86e4592d2dbcda7dbc2e3fda618980e584eff93a..0225af95844abadbf1e4b0883e85a48761a96fd9 100644 (file)
@@ -203,7 +203,7 @@ int mdb_midl_append_range( MDB_IDL *idp, MDB_ID id, unsigned n )
 /* Quicksort + Insertion sort for small arrays */
 
 #define SMALL  8
-#define        SWAP(a,b)       { itmp=(a); (a)=(b); (b)=itmp; }
+#define        MIDL_SWAP(a,b)  { itmp=(a); (a)=(b); (b)=itmp; }
 
 void
 mdb_midl_sort( MDB_IDL ids )
@@ -231,15 +231,15 @@ mdb_midl_sort( MDB_IDL ids )
                        l = istack[jstack--];
                } else {
                        k = (l + ir) >> 1;      /* Choose median of left, center, right */
-                       SWAP(ids[k], ids[l+1]);
+                       MIDL_SWAP(ids[k], ids[l+1]);
                        if (ids[l] < ids[ir]) {
-                               SWAP(ids[l], ids[ir]);
+                               MIDL_SWAP(ids[l], ids[ir]);
                        }
                        if (ids[l+1] < ids[ir]) {
-                               SWAP(ids[l+1], ids[ir]);
+                               MIDL_SWAP(ids[l+1], ids[ir]);
                        }
                        if (ids[l] < ids[l+1]) {
-                               SWAP(ids[l], ids[l+1]);
+                               MIDL_SWAP(ids[l], ids[l+1]);
                        }
                        i = l+1;
                        j = ir;
@@ -248,7 +248,7 @@ mdb_midl_sort( MDB_IDL ids )
                                do i++; while(ids[i] > a);
                                do j--; while(ids[j] < a);
                                if (j < i) break;
-                               SWAP(ids[i],ids[j]);
+                               MIDL_SWAP(ids[i],ids[j]);
                        }
                        ids[l+1] = ids[j];
                        ids[j] = a;