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
2d94915f
Commit
2d94915f
authored
Oct 23, 2008
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Oct 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Don't cast the void pointer returned by GDI_GetObjPtr().
parent
6a262ac7
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
35 additions
and
36 deletions
+35
-36
bitmap.c
dlls/gdi32/bitmap.c
+4
-4
brush.c
dlls/gdi32/brush.c
+1
-1
dib.c
dlls/gdi32/dib.c
+3
-3
enhmetafile.c
dlls/gdi32/enhmetafile.c
+3
-3
font.c
dlls/gdi32/font.c
+1
-1
metafile.c
dlls/gdi32/metafile.c
+2
-2
palette.c
dlls/gdi32/palette.c
+5
-5
region.c
dlls/gdi32/region.c
+15
-15
wing.c
dlls/gdi32/wing.c
+1
-2
No files found.
dlls/gdi32/bitmap.c
View file @
2d94915f
...
...
@@ -325,7 +325,7 @@ LONG WINAPI GetBitmapBits(
LONG
count
,
/* [in] Number of bytes to copy */
LPVOID
bits
)
/* [out] Pointer to buffer to receive bits */
{
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
BITMAPOBJ
*
bmp
=
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
LONG
height
,
ret
;
if
(
!
bmp
)
return
0
;
...
...
@@ -436,7 +436,7 @@ LONG WINAPI SetBitmapBits(
LONG
count
,
/* [in] Number of bytes in bitmap array */
LPCVOID
bits
)
/* [in] Address of array with bitmap bits */
{
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
BITMAPOBJ
*
bmp
=
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
LONG
height
,
ret
;
if
((
!
bmp
)
||
(
!
bits
))
...
...
@@ -729,7 +729,7 @@ BOOL WINAPI GetBitmapDimensionEx(
HBITMAP
hbitmap
,
/* [in] Handle to bitmap */
LPSIZE
size
)
/* [out] Address of struct receiving dimensions */
{
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
BITMAPOBJ
*
bmp
=
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
if
(
!
bmp
)
return
FALSE
;
*
size
=
bmp
->
size
;
GDI_ReleaseObj
(
hbitmap
);
...
...
@@ -754,7 +754,7 @@ BOOL WINAPI SetBitmapDimensionEx(
INT
y
,
/* [in] Bitmap height */
LPSIZE
prevSize
)
/* [out] Address of structure for orig dims */
{
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
BITMAPOBJ
*
bmp
=
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
if
(
!
bmp
)
return
FALSE
;
if
(
prevSize
)
*
prevSize
=
bmp
->
size
;
bmp
->
size
.
cx
=
x
;
...
...
dlls/gdi32/brush.c
View file @
2d94915f
...
...
@@ -461,7 +461,7 @@ BOOL16 WINAPI SetSolidBrush16(HBRUSH16 hBrush, COLORREF newColor )
BOOL16
res
=
FALSE
;
TRACE
(
"(hBrush %04x, newColor %08x)
\n
"
,
hBrush
,
newColor
);
if
(
!
(
brushPtr
=
(
BRUSHOBJ
*
)
GDI_GetObjPtr
(
HBRUSH_32
(
hBrush
),
BRUSH_MAGIC
)))
if
(
!
(
brushPtr
=
GDI_GetObjPtr
(
HBRUSH_32
(
hBrush
),
BRUSH_MAGIC
)))
return
FALSE
;
if
(
brushPtr
->
logbrush
.
lbStyle
==
BS_SOLID
)
...
...
dlls/gdi32/dib.c
View file @
2d94915f
...
...
@@ -235,7 +235,7 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst,
dwRop
==
SRCCOPY
)
{
BITMAPOBJ
*
bmp
;
if
((
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hBitmap
,
BITMAP_MAGIC
)))
if
((
bmp
=
GDI_GetObjPtr
(
hBitmap
,
BITMAP_MAGIC
)))
{
if
(
bmp
->
bitmap
.
bmBitsPixel
==
bpp
&&
bmp
->
bitmap
.
bmWidth
==
widthSrc
&&
...
...
@@ -609,7 +609,7 @@ INT WINAPI GetDIBits(
return
0
;
}
update_dc
(
dc
);
if
(
!
(
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
)))
if
(
!
(
bmp
=
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
)))
{
release_dc_ptr
(
dc
);
return
0
;
...
...
@@ -1153,7 +1153,7 @@ HBITMAP16 WINAPI CreateDIBSection16 (HDC16 hdc, const BITMAPINFO *bmi, UINT16 us
hbitmap
=
CreateDIBSection
(
HDC_32
(
hdc
),
bmi
,
usage
,
&
bits32
,
section
,
offset
);
if
(
hbitmap
)
{
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
BITMAPOBJ
*
bmp
=
GDI_GetObjPtr
(
hbitmap
,
BITMAP_MAGIC
);
if
(
bmp
&&
bmp
->
dib
&&
bits32
)
{
const
BITMAPINFOHEADER
*
bi
=
&
bmi
->
bmiHeader
;
...
...
dlls/gdi32/enhmetafile.c
View file @
2d94915f
...
...
@@ -278,8 +278,8 @@ HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, BOOL on_disk )
*/
static
BOOL
EMF_Delete_HENHMETAFILE
(
HENHMETAFILE
hmf
)
{
ENHMETAFILEOBJ
*
metaObj
=
(
ENHMETAFILEOBJ
*
)
GDI_GetObjPtr
(
hmf
,
ENHMETAFILE_MAGIC
);
ENHMETAFILEOBJ
*
metaObj
=
GDI_GetObjPtr
(
hmf
,
ENHMETAFILE_MAGIC
);
if
(
!
metaObj
)
return
FALSE
;
if
(
metaObj
->
on_disk
)
...
...
@@ -297,7 +297,7 @@ static BOOL EMF_Delete_HENHMETAFILE( HENHMETAFILE hmf )
static
ENHMETAHEADER
*
EMF_GetEnhMetaHeader
(
HENHMETAFILE
hmf
)
{
ENHMETAHEADER
*
ret
=
NULL
;
ENHMETAFILEOBJ
*
metaObj
=
(
ENHMETAFILEOBJ
*
)
GDI_GetObjPtr
(
hmf
,
ENHMETAFILE_MAGIC
);
ENHMETAFILEOBJ
*
metaObj
=
GDI_GetObjPtr
(
hmf
,
ENHMETAFILE_MAGIC
);
TRACE
(
"hmf %p -> enhmetaObj %p
\n
"
,
hmf
,
metaObj
);
if
(
metaObj
)
{
...
...
dlls/gdi32/font.c
View file @
2d94915f
...
...
@@ -828,7 +828,7 @@ INT WINAPI GetTextFaceW( HDC hdc, INT count, LPWSTR name )
if
(
dc
->
gdiFont
)
ret
=
WineEngGetTextFace
(
dc
->
gdiFont
,
count
,
name
);
else
if
((
font
=
(
FONTOBJ
*
)
GDI_GetObjPtr
(
dc
->
hFont
,
FONT_MAGIC
)))
else
if
((
font
=
GDI_GetObjPtr
(
dc
->
hFont
,
FONT_MAGIC
)))
{
INT
n
=
strlenW
(
font
->
logfont
.
lfFaceName
)
+
1
;
if
(
name
)
...
...
dlls/gdi32/metafile.c
View file @
2d94915f
...
...
@@ -126,7 +126,7 @@ HMETAFILE MF_Create_HMETAFILE(METAHEADER *mh)
static
METAHEADER
*
MF_GetMetaHeader
(
HMETAFILE
hmf
)
{
METAHEADER
*
ret
=
NULL
;
METAFILEOBJ
*
metaObj
=
(
METAFILEOBJ
*
)
GDI_GetObjPtr
(
hmf
,
METAFILE_MAGIC
);
METAFILEOBJ
*
metaObj
=
GDI_GetObjPtr
(
hmf
,
METAFILE_MAGIC
);
if
(
metaObj
)
{
ret
=
metaObj
->
mh
;
...
...
@@ -164,7 +164,7 @@ static POINT *convert_points( UINT count, POINT16 *pt16 )
BOOL
WINAPI
DeleteMetaFile
(
HMETAFILE
hmf
)
{
METAFILEOBJ
*
metaObj
=
(
METAFILEOBJ
*
)
GDI_GetObjPtr
(
hmf
,
METAFILE_MAGIC
);
METAFILEOBJ
*
metaObj
=
GDI_GetObjPtr
(
hmf
,
METAFILE_MAGIC
);
if
(
!
metaObj
)
return
FALSE
;
HeapFree
(
GetProcessHeap
(),
0
,
metaObj
->
mh
);
GDI_FreeObject
(
hmf
,
metaObj
);
...
...
dlls/gdi32/palette.c
View file @
2d94915f
...
...
@@ -278,7 +278,7 @@ UINT WINAPI GetPaletteEntries(
TRACE
(
"hpal = %p, count=%i
\n
"
,
hpalette
,
count
);
palPtr
=
(
PALETTEOBJ
*
)
GDI_GetObjPtr
(
hpalette
,
PALETTE_MAGIC
);
palPtr
=
GDI_GetObjPtr
(
hpalette
,
PALETTE_MAGIC
);
if
(
!
palPtr
)
return
0
;
/* NOTE: not documented but test show this to be the case */
...
...
@@ -328,7 +328,7 @@ UINT WINAPI SetPaletteEntries(
TRACE
(
"hpal=%p,start=%i,count=%i
\n
"
,
hpalette
,
start
,
count
);
if
(
hpalette
==
GetStockObject
(
DEFAULT_PALETTE
))
return
0
;
palPtr
=
(
PALETTEOBJ
*
)
GDI_GetObjPtr
(
hpalette
,
PALETTE_MAGIC
);
palPtr
=
GDI_GetObjPtr
(
hpalette
,
PALETTE_MAGIC
);
if
(
!
palPtr
)
return
0
;
numEntries
=
palPtr
->
logpalette
.
palNumEntries
;
...
...
@@ -359,7 +359,7 @@ BOOL WINAPI ResizePalette(
HPALETTE
hPal
,
/* [in] Handle of logical palette */
UINT
cEntries
)
/* [in] Number of entries in logical palette */
{
PALETTEOBJ
*
palPtr
=
(
PALETTEOBJ
*
)
GDI_GetObjPtr
(
hPal
,
PALETTE_MAGIC
);
PALETTEOBJ
*
palPtr
=
GDI_GetObjPtr
(
hPal
,
PALETTE_MAGIC
);
UINT
cPrevEnt
,
prevVer
;
int
prevsize
,
size
=
sizeof
(
LOGPALETTE
)
+
(
cEntries
-
1
)
*
sizeof
(
PALETTEENTRY
);
...
...
@@ -410,7 +410,7 @@ BOOL WINAPI AnimatePalette(
UINT
pal_entries
;
const
PALETTEENTRY
*
pptr
=
PaletteColors
;
palPtr
=
(
PALETTEOBJ
*
)
GDI_GetObjPtr
(
hPal
,
PALETTE_MAGIC
);
palPtr
=
GDI_GetObjPtr
(
hPal
,
PALETTE_MAGIC
);
if
(
!
palPtr
)
return
0
;
pal_entries
=
palPtr
->
logpalette
.
palNumEntries
;
...
...
@@ -537,7 +537,7 @@ UINT WINAPI GetNearestPaletteIndex(
HPALETTE
hpalette
,
/* [in] Handle of logical color palette */
COLORREF
color
)
/* [in] Color to be matched */
{
PALETTEOBJ
*
palObj
=
(
PALETTEOBJ
*
)
GDI_GetObjPtr
(
hpalette
,
PALETTE_MAGIC
);
PALETTEOBJ
*
palObj
=
GDI_GetObjPtr
(
hpalette
,
PALETTE_MAGIC
);
UINT
index
=
0
;
if
(
palObj
)
...
...
dlls/gdi32/region.c
View file @
2d94915f
...
...
@@ -603,7 +603,7 @@ static void REGION_OffsetRegion( WINEREGION *rgn, WINEREGION *srcrgn,
*/
INT
WINAPI
OffsetRgn
(
HRGN
hrgn
,
INT
x
,
INT
y
)
{
RGNOBJ
*
obj
=
(
RGNOBJ
*
)
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
);
RGNOBJ
*
obj
=
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
);
INT
ret
;
TRACE
(
"%p %d,%d
\n
"
,
hrgn
,
x
,
y
);
...
...
@@ -638,7 +638,7 @@ INT WINAPI OffsetRgn( HRGN hrgn, INT x, INT y )
*/
INT
WINAPI
GetRgnBox
(
HRGN
hrgn
,
LPRECT
rect
)
{
RGNOBJ
*
obj
=
(
RGNOBJ
*
)
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
);
RGNOBJ
*
obj
=
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
);
if
(
obj
)
{
INT
ret
;
...
...
@@ -729,7 +729,7 @@ BOOL WINAPI SetRectRgn( HRGN hrgn, INT left, INT top,
TRACE
(
"%p %d,%d-%d,%d
\n
"
,
hrgn
,
left
,
top
,
right
,
bottom
);
if
(
!
(
obj
=
(
RGNOBJ
*
)
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
)))
return
FALSE
;
if
(
!
(
obj
=
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
)))
return
FALSE
;
if
(
left
>
right
)
{
INT
tmp
=
left
;
left
=
right
;
right
=
tmp
;
}
if
(
top
>
bottom
)
{
INT
tmp
=
top
;
top
=
bottom
;
bottom
=
tmp
;
}
...
...
@@ -953,7 +953,7 @@ HRGN WINAPI CreateEllipticRgnIndirect( const RECT *rect )
DWORD
WINAPI
GetRegionData
(
HRGN
hrgn
,
DWORD
count
,
LPRGNDATA
rgndata
)
{
DWORD
size
;
RGNOBJ
*
obj
=
(
RGNOBJ
*
)
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
);
RGNOBJ
*
obj
=
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
);
TRACE
(
" %p count = %d, rgndata = %p
\n
"
,
hrgn
,
count
,
rgndata
);
...
...
@@ -1067,7 +1067,7 @@ HRGN WINAPI ExtCreateRegion( const XFORM* lpXform, DWORD dwCount, const RGNDATA*
if
(
(
hrgn
=
REGION_CreateRegion
(
rgndata
->
rdh
.
nCount
))
)
{
RECT
*
pCurRect
,
*
pEndRect
;
RGNOBJ
*
obj
=
(
RGNOBJ
*
)
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
);
RGNOBJ
*
obj
=
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
);
if
(
obj
)
{
pEndRect
=
(
RECT
*
)
rgndata
->
Buffer
+
rgndata
->
rdh
.
nCount
;
...
...
@@ -1106,7 +1106,7 @@ BOOL WINAPI PtInRegion( HRGN hrgn, INT x, INT y )
RGNOBJ
*
obj
;
BOOL
ret
=
FALSE
;
if
((
obj
=
(
RGNOBJ
*
)
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
)))
if
((
obj
=
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
)))
{
int
i
;
...
...
@@ -1141,7 +1141,7 @@ BOOL WINAPI RectInRegion( HRGN hrgn, const RECT *rect )
RGNOBJ
*
obj
;
BOOL
ret
=
FALSE
;
if
((
obj
=
(
RGNOBJ
*
)
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
)))
if
((
obj
=
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
)))
{
RECT
*
pCurRect
,
*
pRectEnd
;
...
...
@@ -1191,9 +1191,9 @@ BOOL WINAPI EqualRgn( HRGN hrgn1, HRGN hrgn2 )
RGNOBJ
*
obj1
,
*
obj2
;
BOOL
ret
=
FALSE
;
if
((
obj1
=
(
RGNOBJ
*
)
GDI_GetObjPtr
(
hrgn1
,
REGION_MAGIC
)))
if
((
obj1
=
GDI_GetObjPtr
(
hrgn1
,
REGION_MAGIC
)))
{
if
((
obj2
=
(
RGNOBJ
*
)
GDI_GetObjPtr
(
hrgn2
,
REGION_MAGIC
)))
if
((
obj2
=
GDI_GetObjPtr
(
hrgn2
,
REGION_MAGIC
)))
{
int
i
;
...
...
@@ -1251,12 +1251,12 @@ static void REGION_UnionRectWithRegion(const RECT *rect, WINEREGION *rgn)
BOOL
REGION_FrameRgn
(
HRGN
hDest
,
HRGN
hSrc
,
INT
x
,
INT
y
)
{
BOOL
bRet
;
RGNOBJ
*
srcObj
=
(
RGNOBJ
*
)
GDI_GetObjPtr
(
hSrc
,
REGION_MAGIC
);
RGNOBJ
*
srcObj
=
GDI_GetObjPtr
(
hSrc
,
REGION_MAGIC
);
if
(
!
srcObj
)
return
FALSE
;
if
(
srcObj
->
rgn
->
numRects
!=
0
)
{
RGNOBJ
*
destObj
=
(
RGNOBJ
*
)
GDI_GetObjPtr
(
hDest
,
REGION_MAGIC
);
RGNOBJ
*
destObj
=
GDI_GetObjPtr
(
hDest
,
REGION_MAGIC
);
WINEREGION
*
tmprgn
=
REGION_AllocWineRegion
(
srcObj
->
rgn
->
numRects
);
REGION_OffsetRegion
(
destObj
->
rgn
,
srcObj
->
rgn
,
-
x
,
0
);
...
...
@@ -1309,13 +1309,13 @@ BOOL REGION_FrameRgn( HRGN hDest, HRGN hSrc, INT x, INT y )
*/
INT
WINAPI
CombineRgn
(
HRGN
hDest
,
HRGN
hSrc1
,
HRGN
hSrc2
,
INT
mode
)
{
RGNOBJ
*
destObj
=
(
RGNOBJ
*
)
GDI_GetObjPtr
(
hDest
,
REGION_MAGIC
);
RGNOBJ
*
destObj
=
GDI_GetObjPtr
(
hDest
,
REGION_MAGIC
);
INT
result
=
ERROR
;
TRACE
(
" %p,%p -> %p mode=%x
\n
"
,
hSrc1
,
hSrc2
,
hDest
,
mode
);
if
(
destObj
)
{
RGNOBJ
*
src1Obj
=
(
RGNOBJ
*
)
GDI_GetObjPtr
(
hSrc1
,
REGION_MAGIC
);
RGNOBJ
*
src1Obj
=
GDI_GetObjPtr
(
hSrc1
,
REGION_MAGIC
);
if
(
src1Obj
)
{
...
...
@@ -1329,7 +1329,7 @@ INT WINAPI CombineRgn(HRGN hDest, HRGN hSrc1, HRGN hSrc2, INT mode)
}
else
{
RGNOBJ
*
src2Obj
=
(
RGNOBJ
*
)
GDI_GetObjPtr
(
hSrc2
,
REGION_MAGIC
);
RGNOBJ
*
src2Obj
=
GDI_GetObjPtr
(
hSrc2
,
REGION_MAGIC
);
if
(
src2Obj
)
{
...
...
@@ -2790,7 +2790,7 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count,
if
(
!
(
hrgn
=
REGION_CreateRegion
(
nbpolygons
)))
return
0
;
obj
=
(
RGNOBJ
*
)
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
);
obj
=
GDI_GetObjPtr
(
hrgn
,
REGION_MAGIC
);
region
=
obj
->
rgn
;
/* special case a rectangle */
...
...
dlls/gdi32/wing.c
View file @
2d94915f
...
...
@@ -144,8 +144,7 @@ HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 hdc, BITMAPINFO *bmpi,
*/
SEGPTR
WINAPI
WinGGetDIBPointer16
(
HBITMAP16
hWinGBitmap
,
BITMAPINFO
*
bmpi
)
{
BITMAPOBJ
*
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
HBITMAP_32
(
hWinGBitmap
),
BITMAP_MAGIC
);
BITMAPOBJ
*
bmp
=
GDI_GetObjPtr
(
HBITMAP_32
(
hWinGBitmap
),
BITMAP_MAGIC
);
SEGPTR
res
=
0
;
TRACE
(
"(%d,%p)
\n
"
,
hWinGBitmap
,
bmpi
);
...
...
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