Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
1d241bb2
Commit
1d241bb2
authored
Oct 02, 2010
by
Stefan Oberhumer
Committed by
Alexandre Julliard
Oct 04, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Make NTDLL_mergesort() stable.
parent
98134a8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
misc.c
dlls/ntdll/misc.c
+7
-3
No files found.
dlls/ntdll/misc.c
View file @
1d241bb2
...
...
@@ -270,9 +270,9 @@ NTDLL_mergesort( void *arr, void *barr, size_t elemsize, int(__cdecl *compar)(co
for
(
j
=
m
;
j
<
right
;
j
++
)
memcpy
(
X
(
barr
,(
right
+
m
-
j
)),
X
(
arr
,(
j
+
1
)),
elemsize
);
for
(
k
=
left
;
k
<=
right
;
k
++
)
{
/*arr[k]=(barr[i]<barr[j])?barr[i++]:barr[j--];*/
if
(
i
!=
j
&&
compar
(
X
(
barr
,
i
),
X
(
barr
,
j
))
<
0
)
{
/* i=left; j=right; */
for
(
k
=
left
;
i
<=
m
&&
j
>
m
;
k
++
)
{
if
(
compar
(
X
(
barr
,
i
),
X
(
barr
,
j
))
<=
0
)
{
memcpy
(
X
(
arr
,
k
),
X
(
barr
,
i
),
elemsize
);
i
++
;
}
else
{
...
...
@@ -280,6 +280,10 @@ NTDLL_mergesort( void *arr, void *barr, size_t elemsize, int(__cdecl *compar)(co
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
);
}
#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