Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nadezhda Ivanova
OpenLDAP
Commits
7bdb5be0
Commit
7bdb5be0
authored
Sep 23, 2013
by
Hallvard Furuseth
Browse files
Rename SWAP() to avoid conflict with sqlightning.
Happened since sqlightning #includes mdb.c, midl.c.
parent
52cb8b34
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/liblmdb/midl.c
View file @
7bdb5be0
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment