Skip to content

Commit 5f076e5

Browse files
SergeGautherieThFabba
authored andcommitted
[GDI32] MirrorRgnByWidth(): Fix 'phrgn' parameter handling
Detected by Cppcheck: uselessAssignmentPtrArg. Addendum to 794e7aa (r31523) and e647530 (r65893).
1 parent fb023ad commit 5f076e5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

win32ss/gdi/gdi32/objects/region.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ FASTCALL
8585
MirrorRgnByWidth(
8686
_In_ HRGN hrgn,
8787
_In_ INT Width,
88-
_In_ HRGN *phrgn)
88+
_Out_opt_ HRGN *phrgn)
8989
{
9090
INT cRgnDSize, Ret = 0;
9191
PRGNDATA pRgnData;
@@ -118,7 +118,10 @@ MirrorRgnByWidth(
118118
hRgnex = ExtCreateRegion(NULL, cRgnDSize , pRgnData);
119119
if (hRgnex)
120120
{
121-
if (phrgn) phrgn = (HRGN *)hRgnex;
121+
if (phrgn)
122+
{
123+
*phrgn = hRgnex;
124+
}
122125
else
123126
{
124127
CombineRgn(hrgn, hRgnex, 0, RGN_COPY);
@@ -138,7 +141,7 @@ WINAPI
138141
MirrorRgnDC(
139142
_In_ HDC hdc,
140143
_In_ HRGN hrgn,
141-
_In_ HRGN *phrn)
144+
_Out_opt_ HRGN *phrn)
142145
{
143146
if (!GdiValidateHandle((HGDIOBJ) hdc) ||
144147
(GDI_HANDLE_GET_TYPE(hdc) != GDI_OBJECT_TYPE_DC))

0 commit comments

Comments
 (0)