summaryrefslogtreecommitdiff
path: root/glib/gqsort.c
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2012-03-20 13:19:11 +0800
committerMatthias Clasen <mclasen@redhat.com>2012-03-20 22:29:50 -0400
commitb08b3012235b089cc3c8d015c47f703da01a4d81 (patch)
tree571d17fa426d830f68bed17106b7c1dfa6616b04 /glib/gqsort.c
parentf23e7c3ef988a251c42a8a8f7e60566e0bab76fb (diff)
downloadglib-b08b3012235b089cc3c8d015c47f703da01a4d81.tar.gz
glib/gqsort.c: Fix C99ism/GCCism
-There were a number of variables that were declared in the middle of the block, so move these declarations to the start of the block -There was a use of mempcpy, but it is a GCC extension, so use memcpy since we didn't care about the return value of the call to mempcpy. https://bugzilla.gnome.org/show_bug.cgi?id=672095
Diffstat (limited to 'glib/gqsort.c')
-rw-r--r--glib/gqsort.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/glib/gqsort.c b/glib/gqsort.c
index cd321813b..fc699ea14 100644
--- a/glib/gqsort.c
+++ b/glib/gqsort.c
@@ -178,7 +178,7 @@ msort_with_tmp (const struct msort_param *p, void *b, size_t n)
}
else
{
- mempcpy (tmp, b2, s);
+ memcpy (tmp, b2, s);
tmp += s;
b2 += s;
--n2;
@@ -226,6 +226,8 @@ msort_r (void *b, size_t n, size_t s, GCompareDataFunc cmp, void *arg)
void **tp = (void **) (p.t + n * sizeof (void *));
void **t = tp;
void *tmp_storage = (void *) (tp + n);
+ char *kp;
+ size_t i;
while ((void *) t < tmp_storage)
{
@@ -238,8 +240,6 @@ msort_r (void *b, size_t n, size_t s, GCompareDataFunc cmp, void *arg)
/* tp[0] .. tp[n - 1] is now sorted, copy around entries of
the original array. Knuth vol. 3 (2nd ed.) exercise 5.2-10. */
- char *kp;
- size_t i;
for (i = 0, ip = (char *) b; i < n; i++, ip += s)
if ((kp = tp[i]) != ip)
{