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
00981b58
Commit
00981b58
authored
Jan 12, 2008
by
Andrew Talbot
Committed by
Alexandre Julliard
Jan 14, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Remove unneeded casts.
parent
a69418c5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
13 deletions
+12
-13
critsection.c
dlls/ntdll/critsection.c
+5
-6
serial.c
dlls/ntdll/serial.c
+2
-2
threadpool.c
dlls/ntdll/threadpool.c
+5
-5
No files found.
dlls/ntdll/critsection.c
View file @
00981b58
...
...
@@ -39,12 +39,12 @@ WINE_DECLARE_DEBUG_CHANNEL(relay);
static
inline
LONG
interlocked_inc
(
PLONG
dest
)
{
return
interlocked_xchg_add
(
(
int
*
)
dest
,
1
)
+
1
;
return
interlocked_xchg_add
(
dest
,
1
)
+
1
;
}
static
inline
LONG
interlocked_dec
(
PLONG
dest
)
{
return
interlocked_xchg_add
(
(
int
*
)
dest
,
-
1
)
-
1
;
return
interlocked_xchg_add
(
dest
,
-
1
)
-
1
;
}
static
inline
void
small_pause
(
void
)
...
...
@@ -208,8 +208,7 @@ static inline HANDLE get_semaphore( RTL_CRITICAL_SECTION *crit )
{
HANDLE
sem
;
if
(
NtCreateSemaphore
(
&
sem
,
SEMAPHORE_ALL_ACCESS
,
NULL
,
0
,
1
))
return
0
;
if
(
!
(
ret
=
(
HANDLE
)
interlocked_cmpxchg_ptr
(
(
PVOID
*
)
&
crit
->
LockSemaphore
,
sem
,
0
)))
if
(
!
(
ret
=
interlocked_cmpxchg_ptr
(
&
crit
->
LockSemaphore
,
sem
,
0
)))
ret
=
sem
;
else
NtClose
(
sem
);
/* somebody beat us to it */
...
...
@@ -490,7 +489,7 @@ NTSTATUS WINAPI RtlEnterCriticalSection( RTL_CRITICAL_SECTION *crit )
if
(
crit
->
LockCount
>
0
)
break
;
/* more than one waiter, don't bother spinning */
if
(
crit
->
LockCount
==
-
1
)
/* try again */
{
if
(
interlocked_cmpxchg
(
(
int
*
)
&
crit
->
LockCount
,
0
,
-
1
)
==
-
1
)
goto
done
;
if
(
interlocked_cmpxchg
(
&
crit
->
LockCount
,
0
,
-
1
)
==
-
1
)
goto
done
;
}
small_pause
();
}
...
...
@@ -534,7 +533,7 @@ done:
BOOL
WINAPI
RtlTryEnterCriticalSection
(
RTL_CRITICAL_SECTION
*
crit
)
{
BOOL
ret
=
FALSE
;
if
(
interlocked_cmpxchg
(
(
int
*
)
&
crit
->
LockCount
,
0
,
-
1
)
==
-
1
)
if
(
interlocked_cmpxchg
(
&
crit
->
LockCount
,
0
,
-
1
)
==
-
1
)
{
crit
->
OwningThread
=
ULongToHandle
(
GetCurrentThreadId
());
crit
->
RecursionCount
=
1
;
...
...
dlls/ntdll/serial.c
View file @
00981b58
...
...
@@ -264,9 +264,9 @@ static NTSTATUS get_line_control(int fd, SERIAL_LINE_CONTROL* slc)
case
CS6
:
slc
->
WordLength
=
6
;
break
;
case
CS7
:
slc
->
WordLength
=
7
;
break
;
case
CS8
:
slc
->
WordLength
=
8
;
break
;
default:
ERR
(
"unknown size %x
\n
"
,
(
UINT
)(
port
.
c_cflag
&
CSIZE
)
);
default:
ERR
(
"unknown size %x
\n
"
,
port
.
c_cflag
&
CSIZE
);
}
if
(
port
.
c_cflag
&
CSTOPB
)
{
if
(
slc
->
WordLength
==
5
)
...
...
dlls/ntdll/threadpool.c
View file @
00981b58
...
...
@@ -73,12 +73,12 @@ struct work_item
static
inline
LONG
interlocked_inc
(
PLONG
dest
)
{
return
interlocked_xchg_add
(
(
int
*
)
dest
,
1
)
+
1
;
return
interlocked_xchg_add
(
dest
,
1
)
+
1
;
}
static
inline
LONG
interlocked_dec
(
PLONG
dest
)
{
return
interlocked_xchg_add
(
(
int
*
)
dest
,
-
1
)
-
1
;
return
interlocked_xchg_add
(
dest
,
-
1
)
-
1
;
}
static
void
WINAPI
worker_thread_proc
(
void
*
param
)
...
...
@@ -148,7 +148,7 @@ static NTSTATUS add_work_item_to_queue(struct work_item *work_item)
{
HANDLE
sem
;
status
=
NtCreateSemaphore
(
&
sem
,
SEMAPHORE_ALL_ACCESS
,
NULL
,
1
,
LONG_MAX
);
if
(
interlocked_cmpxchg_ptr
(
(
PVOID
*
)
&
work_item_event
,
sem
,
0
))
if
(
interlocked_cmpxchg_ptr
(
&
work_item_event
,
sem
,
0
))
NtClose
(
sem
);
/* somebody beat us to it */
}
else
...
...
@@ -486,14 +486,14 @@ NTSTATUS WINAPI RtlDeregisterWaitEx(HANDLE WaitHandle, HANDLE CompletionEvent)
status
=
NtCreateEvent
(
&
CompletionEvent
,
EVENT_ALL_ACCESS
,
NULL
,
TRUE
,
FALSE
);
if
(
status
!=
STATUS_SUCCESS
)
return
status
;
interlocked_xchg_ptr
(
(
PVOID
*
)
&
wait_work_item
->
CompletionEvent
,
CompletionEvent
);
interlocked_xchg_ptr
(
&
wait_work_item
->
CompletionEvent
,
CompletionEvent
);
if
(
wait_work_item
->
CallbackInProgress
)
NtWaitForSingleObject
(
CompletionEvent
,
FALSE
,
NULL
);
NtClose
(
CompletionEvent
);
}
else
{
interlocked_xchg_ptr
(
(
PVOID
*
)
&
wait_work_item
->
CompletionEvent
,
CompletionEvent
);
interlocked_xchg_ptr
(
&
wait_work_item
->
CompletionEvent
,
CompletionEvent
);
if
(
wait_work_item
->
CallbackInProgress
)
status
=
STATUS_PENDING
;
}
...
...
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