aboutsummaryrefslogtreecommitdiff
path: root/sort.c
diff options
context:
space:
mode:
authorAlecs King <alecsk@gmail.com>2005-12-31 15:21:18 +0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-31 11:32:36 -0800
commit9ec2ac4c8860418beeb107bd58dc6f1284c492d0 (patch)
tree148e7d8c53f45c321cd21d202a88e9fe56230795 /sort.c
parent[PATCH] fix a memory leak in pack_ptr_list (diff)
downloadsparse-9ec2ac4c8860418beeb107bd58dc6f1284c492d0.tar.gz
sparse-9ec2ac4c8860418beeb107bd58dc6f1284c492d0.tar.bz2
sparse-9ec2ac4c8860418beeb107bd58dc6f1284c492d0.zip
[PATCH] fix sparse warnings
sort.c:192:5: warning: mixing declarations and code sort.c:234:2: warning: mixing declarations and code Signed-off-by: Alecs King <alecsk@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sort.c')
-rw-r--r--sort.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sort.c b/sort.c
index c2ac8b7..749339a 100644
--- a/sort.c
+++ b/sort.c
@@ -186,10 +186,10 @@ merge_block_seqs (struct ptr_list *b1, int n,
// Element from b2 is smaller
buffer[nbuf++] = d2;
if (++i2 >= b2->nr) {
+ struct ptr_list *l = b2;
BEEN_THERE('M');
// Ok, we finished with b2. Pull it out
// and plug it in before b1.
- struct ptr_list *l = b2;
b2 = b2->next;
b2->prev = l->prev;
@@ -224,14 +224,13 @@ merge_block_seqs (struct ptr_list *b1, int n,
void sort_list(struct ptr_list **plist, int (*cmp)(const void *, const void *))
{
- struct ptr_list *head = *plist;
+ struct ptr_list *head = *plist, *list = head;
int blocks = 1;
if (!head)
return;
// Sort all the sub-lists
- struct ptr_list *list = head;
do {
array_sort(list->list, list->nr, cmp);
#ifdef PARANOIA