Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
49250bec
Commit
49250bec
authored
Mar 30, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 30, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Don't call compare function on memory not provided by user in qsort.
parent
99bed5d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
misc.c
dlls/ntdll/misc.c
+11
-16
No files found.
dlls/ntdll/misc.c
View file @
49250bec
...
...
@@ -253,7 +253,6 @@ double CDECL NTDLL_tan( double d )
}
/* Merge Sort. Algorithm taken from http://www.linux-related.de/index.html?/coding/sort/sort_merge.htm */
static
void
NTDLL_mergesort
(
void
*
arr
,
void
*
barr
,
size_t
elemsize
,
int
(
__cdecl
*
compar
)(
const
void
*
,
const
void
*
),
size_t
left
,
size_t
right
)
...
...
@@ -265,25 +264,21 @@ NTDLL_mergesort( void *arr, void *barr, size_t elemsize, int(__cdecl *compar)(co
NTDLL_mergesort
(
arr
,
barr
,
elemsize
,
compar
,
m
+
1
,
right
);
#define X(a,i) ((char*)a+elemsize*(i))
for
(
i
=
m
+
1
;
i
>
left
;
i
--
)
memcpy
(
X
(
barr
,(
i
-
1
)),
X
(
arr
,(
i
-
1
)),
elemsize
);
for
(
j
=
m
;
j
<
right
;
j
++
)
memcpy
(
X
(
barr
,(
right
+
m
-
j
)),
X
(
arr
,(
j
+
1
)),
elemsize
);
/* i=left; j=right; */
for
(
k
=
left
;
i
<=
m
&&
j
>
m
;
k
++
)
{
if
(
i
==
j
||
compar
(
X
(
barr
,
i
),
X
(
barr
,
j
))
<=
0
)
{
memcpy
(
X
(
arr
,
k
),
X
(
barr
,
i
),
elemsize
);
for
(
k
=
left
,
i
=
left
,
j
=
m
+
1
;
i
<=
m
&&
j
<=
right
;
k
++
)
{
if
(
compar
(
X
(
arr
,
i
),
X
(
arr
,
j
))
<=
0
)
{
memcpy
(
X
(
barr
,
k
),
X
(
arr
,
i
),
elemsize
);
i
++
;
}
else
{
memcpy
(
X
(
arr
,
k
),
X
(
barr
,
j
),
elemsize
);
j
--
;
memcpy
(
X
(
barr
,
k
),
X
(
arr
,
j
),
elemsize
);
j
++
;
}
}
for
(;
i
<=
m
;
i
++
,
k
++
)
memcpy
(
X
(
arr
,
k
),
X
(
barr
,
i
),
elemsize
);
for
(;
j
>
m
;
j
--
,
k
++
)
memcpy
(
X
(
arr
,
k
),
X
(
barr
,
j
),
elemsize
);
if
(
i
<=
m
)
memcpy
(
X
(
barr
,
k
),
X
(
arr
,
i
),
(
m
-
i
+
1
)
*
elemsize
);
else
memcpy
(
X
(
barr
,
k
),
X
(
arr
,
j
),
(
right
-
j
+
1
)
*
elemsize
);
memcpy
(
X
(
arr
,
left
),
X
(
barr
,
left
),
(
right
-
left
+
1
)
*
elemsize
);
}
#undef X
}
...
...
Write
Preview
Markdown
is supported
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