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
2d044dd6
Commit
2d044dd6
authored
Sep 16, 2004
by
James Hawkins
Committed by
Alexandre Julliard
Sep 16, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use InterlockedDecrement and InterlockedIncrement instead of ++/--.
parent
b970aeb4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
17 deletions
+11
-17
avifile.c
dlls/avifil32/avifile.c
+9
-15
vartype.c
dlls/oleaut32/tests/vartype.c
+2
-2
No files found.
dlls/avifil32/avifile.c
View file @
2d044dd6
...
...
@@ -284,17 +284,19 @@ static ULONG WINAPI IAVIFile_fnAddRef(IAVIFile *iface)
IAVIFileImpl
*
This
=
(
IAVIFileImpl
*
)
iface
;
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
This
->
ref
+
1
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
IAVIFile_fnRelease
(
IAVIFile
*
iface
)
{
IAVIFileImpl
*
This
=
(
IAVIFileImpl
*
)
iface
;
UINT
i
;
ULONG
ret
;
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
This
->
ref
-
1
);
if
(
!--
(
This
->
ref
))
{
ret
=
InterlockedDecrement
(
&
This
->
ref
);
if
(
!
ret
)
{
if
(
This
->
fDirty
)
{
/* need to write headers to file */
AVIFILE_SaveFile
(
This
);
...
...
@@ -334,9 +336,8 @@ static ULONG WINAPI IAVIFile_fnRelease(IAVIFile *iface)
}
LocalFree
((
HLOCAL
)
This
);
return
0
;
}
return
This
->
ref
;
return
ret
;
}
static
HRESULT
WINAPI
IAVIFile_fnInfo
(
IAVIFile
*
iface
,
LPAVIFILEINFOW
afi
,
...
...
@@ -743,27 +744,20 @@ static ULONG WINAPI IAVIStream_fnAddRef(IAVIStream *iface)
if
(
This
->
paf
!=
NULL
)
IAVIFile_AddRef
((
PAVIFILE
)
This
->
paf
);
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
IAVIStream_fnRelease
(
IAVIStream
*
iface
)
{
IAVIStreamImpl
*
This
=
(
IAVIStreamImpl
*
)
iface
;
ULONG
ret
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
This
->
ref
-
1
);
/* we belong to the AVIFile, which must free us! */
if
(
This
->
ref
==
0
)
{
ERR
(
": already released!
\n
"
);
return
0
;
}
This
->
ref
--
;
TRACE
(
"(%p) -> %ld
\n
"
,
iface
,
ret
);
if
(
This
->
paf
!=
NULL
)
IAVIFile_Release
((
PAVIFILE
)
This
->
paf
);
return
This
->
ref
;
return
ret
;
}
static
HRESULT
WINAPI
IAVIStream_fnCreate
(
IAVIStream
*
iface
,
LPARAM
lParam1
,
...
...
dlls/oleaut32/tests/vartype.c
View file @
2d044dd6
...
...
@@ -527,13 +527,13 @@ static DummyDispatch dispatch;
static
ULONG
WINAPI
DummyDispatch_AddRef
(
LPDISPATCH
iface
)
{
trace
(
"AddRef(%p)
\n
"
,
iface
);
return
++
((
DummyDispatch
*
)
iface
)
->
ref
;
return
InterlockedIncrement
(
&
((
DummyDispatch
*
)
iface
)
->
ref
)
;
}
static
ULONG
WINAPI
DummyDispatch_Release
(
LPDISPATCH
iface
)
{
trace
(
"Release(%p)
\n
"
,
iface
);
return
((
DummyDispatch
*
)
iface
)
->
ref
--
;
return
InterlockedDecrement
(
&
((
DummyDispatch
*
)
iface
)
->
ref
)
;
}
static
HRESULT
WINAPI
DummyDispatch_QueryInterface
(
LPDISPATCH
iface
,
...
...
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