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
36482273
Commit
36482273
authored
Sep 21, 2004
by
James Hawkins
Committed by
Alexandre Julliard
Sep 21, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use InterlockedDecrement and InterlockedIncrement instead of ++/--.
parent
a1ccb921
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
26 deletions
+14
-26
olefont.c
dlls/oleaut32/olefont.c
+7
-13
olepicture.c
dlls/oleaut32/olepicture.c
+7
-13
No files found.
dlls/oleaut32/olefont.c
View file @
36482273
...
...
@@ -529,9 +529,7 @@ ULONG WINAPI OLEFontImpl_AddRef(
{
OLEFontImpl
*
this
=
(
OLEFontImpl
*
)
iface
;
TRACE
(
"(%p)->(ref=%ld)
\n
"
,
this
,
this
->
ref
);
this
->
ref
++
;
return
this
->
ref
;
return
InterlockedIncrement
(
&
this
->
ref
);
}
/************************************************************************
...
...
@@ -543,24 +541,20 @@ ULONG WINAPI OLEFontImpl_Release(
IFont
*
iface
)
{
OLEFontImpl
*
this
=
(
OLEFontImpl
*
)
iface
;
ULONG
ret
;
TRACE
(
"(%p)->(ref=%ld)
\n
"
,
this
,
this
->
ref
);
/*
* Decrease the reference count on this object.
*/
this
->
ref
--
;
ret
=
InterlockedDecrement
(
&
this
->
ref
)
;
/*
* If the reference count goes down to 0, perform suicide.
*/
if
(
this
->
ref
==
0
)
{
OLEFontImpl_Destroy
(
this
);
return
0
;
}
if
(
ret
==
0
)
OLEFontImpl_Destroy
(
this
);
return
this
->
ref
;
return
ret
;
}
/************************************************************************
...
...
@@ -2087,13 +2081,13 @@ SFCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
static
ULONG
WINAPI
SFCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
SFCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
--
(
This
->
ref
);
return
InterlockedDecrement
(
&
This
->
ref
);
}
static
HRESULT
WINAPI
SFCF_CreateInstance
(
...
...
dlls/oleaut32/olepicture.c
View file @
36482273
...
...
@@ -402,9 +402,7 @@ static ULONG WINAPI OLEPictureImpl_AddRef(
{
OLEPictureImpl
*
This
=
(
OLEPictureImpl
*
)
iface
;
TRACE
(
"(%p)->(ref=%ld)
\n
"
,
This
,
This
->
ref
);
This
->
ref
++
;
return
This
->
ref
;
return
InterlockedIncrement
(
&
This
->
ref
);
}
/************************************************************************
...
...
@@ -416,24 +414,20 @@ static ULONG WINAPI OLEPictureImpl_Release(
IPicture
*
iface
)
{
OLEPictureImpl
*
This
=
(
OLEPictureImpl
*
)
iface
;
ULONG
ret
;
TRACE
(
"(%p)->(ref=%ld)
\n
"
,
This
,
This
->
ref
);
/*
* Decrease the reference count on this object.
*/
This
->
ref
--
;
ret
=
InterlockedDecrement
(
&
This
->
ref
)
;
/*
* If the reference count goes down to 0, perform suicide.
*/
if
(
This
->
ref
==
0
)
{
OLEPictureImpl_Destroy
(
This
);
return
0
;
}
if
(
ret
==
0
)
OLEPictureImpl_Destroy
(
This
);
return
This
->
ref
;
return
ret
;
}
...
...
@@ -1691,13 +1685,13 @@ SPCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) {
static
ULONG
WINAPI
SPCF_AddRef
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
return
++
(
This
->
ref
);
return
InterlockedIncrement
(
&
This
->
ref
);
}
static
ULONG
WINAPI
SPCF_Release
(
LPCLASSFACTORY
iface
)
{
IClassFactoryImpl
*
This
=
(
IClassFactoryImpl
*
)
iface
;
/* static class, won't be freed */
return
--
(
This
->
ref
);
return
InterlockedDecrement
(
&
This
->
ref
);
}
static
HRESULT
WINAPI
SPCF_CreateInstance
(
...
...
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