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
a7116b05
Commit
a7116b05
authored
Mar 28, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed memory allocations.
parent
533d3330
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
21 deletions
+21
-21
palette.c
graphics/x11drv/palette.c
+4
-4
palette.c
objects/palette.c
+17
-17
No files found.
graphics/x11drv/palette.c
View file @
a7116b05
...
@@ -462,7 +462,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void)
...
@@ -462,7 +462,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void)
(
X11DRV_PALETTE_PaletteFlags
&
X11DRV_PALETTE_VIRTUAL
||
!
(
X11DRV_PALETTE_PaletteFlags
&
X11DRV_PALETTE_FIXED
))
)
(
X11DRV_PALETTE_PaletteFlags
&
X11DRV_PALETTE_VIRTUAL
||
!
(
X11DRV_PALETTE_PaletteFlags
&
X11DRV_PALETTE_FIXED
))
)
?
NB_RESERVED_COLORS
/
2
:
-
1
;
?
NB_RESERVED_COLORS
/
2
:
-
1
;
COLOR_sysPal
=
(
PALETTEENTRY
*
)
malloc
(
sizeof
(
PALETTEENTRY
)
*
256
);
COLOR_sysPal
=
(
PALETTEENTRY
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PALETTEENTRY
)
*
256
);
if
(
COLOR_sysPal
==
NULL
)
{
if
(
COLOR_sysPal
==
NULL
)
{
ERR
(
"Can not allocate system palette!
\n
"
);
ERR
(
"Can not allocate system palette!
\n
"
);
return
FALSE
;
return
FALSE
;
...
@@ -483,7 +483,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void)
...
@@ -483,7 +483,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void)
* RGB->pixel calculation in X11DRV_PALETTE_ToPhysical().
* RGB->pixel calculation in X11DRV_PALETTE_ToPhysical().
*/
*/
X11DRV_PALETTE_PaletteToXPixel
=
(
int
*
)
malloc
(
sizeof
(
int
)
*
256
);
X11DRV_PALETTE_PaletteToXPixel
=
(
int
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
int
)
*
256
);
if
(
X11DRV_PALETTE_PaletteToXPixel
==
NULL
)
{
if
(
X11DRV_PALETTE_PaletteToXPixel
==
NULL
)
{
ERR
(
"Out of memory: PaletteToXPixel!
\n
"
);
ERR
(
"Out of memory: PaletteToXPixel!
\n
"
);
return
FALSE
;
return
FALSE
;
...
@@ -870,8 +870,8 @@ int X11DRV_PALETTE_SetMapping( PALETTEOBJ* palPtr, UINT uStart, UINT uNum, BOOL
...
@@ -870,8 +870,8 @@ int X11DRV_PALETTE_SetMapping( PALETTEOBJ* palPtr, UINT uStart, UINT uNum, BOOL
/* initialize palette mapping table */
/* initialize palette mapping table */
mapping
=
(
int
*
)
realloc
(
palPtr
->
mapping
,
sizeof
(
int
)
*
mapping
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
palPtr
->
mapping
,
palPtr
->
logpalette
.
palNumEntries
);
sizeof
(
int
)
*
palPtr
->
logpalette
.
palNumEntries
);
if
(
mapping
==
NULL
)
{
if
(
mapping
==
NULL
)
{
ERR
(
"Can not allocate new mapping -- memory exausted!"
);
ERR
(
"Can not allocate new mapping -- memory exausted!"
);
return
0
;
return
0
;
...
...
objects/palette.c
View file @
a7116b05
...
@@ -97,7 +97,7 @@ HPALETTE16 WINAPI CreatePalette16( const LOGPALETTE* palette )
...
@@ -97,7 +97,7 @@ HPALETTE16 WINAPI CreatePalette16( const LOGPALETTE* palette )
/***********************************************************************
/***********************************************************************
* CreatePalette
32
[GDI32.53] Creates a logical color palette
* CreatePalette [GDI32.53] Creates a logical color palette
*
*
* RETURNS
* RETURNS
* Success: Handle to logical palette
* Success: Handle to logical palette
...
@@ -145,7 +145,7 @@ HPALETTE16 WINAPI CreateHalftonePalette16(
...
@@ -145,7 +145,7 @@ HPALETTE16 WINAPI CreateHalftonePalette16(
/***********************************************************************
/***********************************************************************
* CreateHalftonePalette
32
[GDI32.47] Creates a halftone palette
* CreateHalftonePalette [GDI32.47] Creates a halftone palette
*
*
* RETURNS
* RETURNS
* Success: Handle to logical halftone palette
* Success: Handle to logical halftone palette
...
@@ -201,7 +201,7 @@ UINT16 WINAPI GetPaletteEntries16( HPALETTE16 hpalette, UINT16 start,
...
@@ -201,7 +201,7 @@ UINT16 WINAPI GetPaletteEntries16( HPALETTE16 hpalette, UINT16 start,
/***********************************************************************
/***********************************************************************
* GetPaletteEntries
32
[GDI32.209] Retrieves palette entries
* GetPaletteEntries [GDI32.209] Retrieves palette entries
*
*
* RETURNS
* RETURNS
* Success: Number of entries from logical palette
* Success: Number of entries from logical palette
...
@@ -253,7 +253,7 @@ UINT16 WINAPI SetPaletteEntries16( HPALETTE16 hpalette, UINT16 start,
...
@@ -253,7 +253,7 @@ UINT16 WINAPI SetPaletteEntries16( HPALETTE16 hpalette, UINT16 start,
/***********************************************************************
/***********************************************************************
* SetPaletteEntries
32
[GDI32.326] Sets color values for range in palette
* SetPaletteEntries [GDI32.326] Sets color values for range in palette
*
*
* RETURNS
* RETURNS
* Success: Number of entries that were set
* Success: Number of entries that were set
...
@@ -284,7 +284,7 @@ UINT WINAPI SetPaletteEntries(
...
@@ -284,7 +284,7 @@ UINT WINAPI SetPaletteEntries(
count
*
sizeof
(
PALETTEENTRY
)
);
count
*
sizeof
(
PALETTEENTRY
)
);
PALETTE_ValidateFlags
(
palPtr
->
logpalette
.
palPalEntry
,
PALETTE_ValidateFlags
(
palPtr
->
logpalette
.
palPalEntry
,
palPtr
->
logpalette
.
palNumEntries
);
palPtr
->
logpalette
.
palNumEntries
);
free
(
palPtr
->
mapping
);
HeapFree
(
GetProcessHeap
(),
0
,
palPtr
->
mapping
);
palPtr
->
mapping
=
NULL
;
palPtr
->
mapping
=
NULL
;
GDI_HEAP_UNLOCK
(
hpalette
);
GDI_HEAP_UNLOCK
(
hpalette
);
return
count
;
return
count
;
...
@@ -301,7 +301,7 @@ BOOL16 WINAPI ResizePalette16( HPALETTE16 hPal, UINT16 cEntries )
...
@@ -301,7 +301,7 @@ BOOL16 WINAPI ResizePalette16( HPALETTE16 hPal, UINT16 cEntries )
/***********************************************************************
/***********************************************************************
* ResizePalette
32
[GDI32.289] Resizes logical palette
* ResizePalette [GDI32.289] Resizes logical palette
*
*
* RETURNS
* RETURNS
* Success: TRUE
* Success: TRUE
...
@@ -372,7 +372,7 @@ void WINAPI AnimatePalette16( HPALETTE16 hPal, UINT16 StartIndex,
...
@@ -372,7 +372,7 @@ void WINAPI AnimatePalette16( HPALETTE16 hPal, UINT16 StartIndex,
/***********************************************************************
/***********************************************************************
* AnimatePalette
32
[GDI32.6] Replaces entries in logical palette
* AnimatePalette [GDI32.6] Replaces entries in logical palette
*
*
* RETURNS
* RETURNS
* Success: TRUE
* Success: TRUE
...
@@ -420,7 +420,7 @@ UINT16 WINAPI SetSystemPaletteUse16( HDC16 hdc, UINT16 use )
...
@@ -420,7 +420,7 @@ UINT16 WINAPI SetSystemPaletteUse16( HDC16 hdc, UINT16 use )
/***********************************************************************
/***********************************************************************
* SetSystemPaletteUse
32
[GDI32.335]
* SetSystemPaletteUse [GDI32.335]
*
*
* RETURNS
* RETURNS
* Success: Previous system palette
* Success: Previous system palette
...
@@ -447,7 +447,7 @@ UINT16 WINAPI GetSystemPaletteUse16( HDC16 hdc )
...
@@ -447,7 +447,7 @@ UINT16 WINAPI GetSystemPaletteUse16( HDC16 hdc )
/***********************************************************************
/***********************************************************************
* GetSystemPaletteUse
32
[GDI32.223] Gets state of system palette
* GetSystemPaletteUse [GDI32.223] Gets state of system palette
*
*
* RETURNS
* RETURNS
* Current state of system palette
* Current state of system palette
...
@@ -470,7 +470,7 @@ UINT16 WINAPI GetSystemPaletteEntries16( HDC16 hdc, UINT16 start, UINT16 count,
...
@@ -470,7 +470,7 @@ UINT16 WINAPI GetSystemPaletteEntries16( HDC16 hdc, UINT16 start, UINT16 count,
/***********************************************************************
/***********************************************************************
* GetSystemPaletteEntries
32
[GDI32.222] Gets range of palette entries
* GetSystemPaletteEntries [GDI32.222] Gets range of palette entries
*
*
* RETURNS
* RETURNS
* Success: Number of entries retrieved from palette
* Success: Number of entries retrieved from palette
...
@@ -518,7 +518,7 @@ UINT16 WINAPI GetNearestPaletteIndex16( HPALETTE16 hpalette, COLORREF color )
...
@@ -518,7 +518,7 @@ UINT16 WINAPI GetNearestPaletteIndex16( HPALETTE16 hpalette, COLORREF color )
/***********************************************************************
/***********************************************************************
* GetNearestPaletteIndex
32
[GDI32.203] Gets palette index for color
* GetNearestPaletteIndex [GDI32.203] Gets palette index for color
*
*
* NOTES
* NOTES
* Should index be initialized to CLR_INVALID instead of 0?
* Should index be initialized to CLR_INVALID instead of 0?
...
@@ -555,7 +555,7 @@ COLORREF WINAPI GetNearestColor16( HDC16 hdc, COLORREF color )
...
@@ -555,7 +555,7 @@ COLORREF WINAPI GetNearestColor16( HDC16 hdc, COLORREF color )
/***********************************************************************
/***********************************************************************
* GetNearestColor
32
[GDI32.202] Gets a system color to match
* GetNearestColor [GDI32.202] Gets a system color to match
*
*
* NOTES
* NOTES
* Should this return CLR_INVALID instead of FadeCafe?
* Should this return CLR_INVALID instead of FadeCafe?
...
@@ -608,7 +608,7 @@ BOOL PALETTE_UnrealizeObject( HPALETTE16 hpalette, PALETTEOBJ *palette )
...
@@ -608,7 +608,7 @@ BOOL PALETTE_UnrealizeObject( HPALETTE16 hpalette, PALETTEOBJ *palette )
{
{
if
(
palette
->
mapping
)
if
(
palette
->
mapping
)
{
{
free
(
palette
->
mapping
);
HeapFree
(
GetProcessHeap
(),
0
,
palette
->
mapping
);
palette
->
mapping
=
NULL
;
palette
->
mapping
=
NULL
;
}
}
if
(
hLastRealizedPalette
==
hpalette
)
hLastRealizedPalette
=
0
;
if
(
hLastRealizedPalette
==
hpalette
)
hLastRealizedPalette
=
0
;
...
@@ -621,7 +621,7 @@ BOOL PALETTE_UnrealizeObject( HPALETTE16 hpalette, PALETTEOBJ *palette )
...
@@ -621,7 +621,7 @@ BOOL PALETTE_UnrealizeObject( HPALETTE16 hpalette, PALETTEOBJ *palette )
*/
*/
BOOL
PALETTE_DeleteObject
(
HPALETTE16
hpalette
,
PALETTEOBJ
*
palette
)
BOOL
PALETTE_DeleteObject
(
HPALETTE16
hpalette
,
PALETTEOBJ
*
palette
)
{
{
free
(
palette
->
mapping
);
HeapFree
(
GetProcessHeap
(),
0
,
palette
->
mapping
);
if
(
hLastRealizedPalette
==
hpalette
)
hLastRealizedPalette
=
0
;
if
(
hLastRealizedPalette
==
hpalette
)
hLastRealizedPalette
=
0
;
return
GDI_FreeObject
(
hpalette
);
return
GDI_FreeObject
(
hpalette
);
}
}
...
@@ -755,7 +755,7 @@ HPALETTE16 WINAPI SelectPalette16( HDC16 hDC, HPALETTE16 hPal,
...
@@ -755,7 +755,7 @@ HPALETTE16 WINAPI SelectPalette16( HDC16 hDC, HPALETTE16 hPal,
/***********************************************************************
/***********************************************************************
* SelectPalette
32
[GDI32.300] Selects logical palette into DC
* SelectPalette [GDI32.300] Selects logical palette into DC
*
*
* RETURNS
* RETURNS
* Success: Previous logical palette
* Success: Previous logical palette
...
@@ -800,7 +800,7 @@ UINT16 WINAPI RealizePalette16( HDC16 hDC )
...
@@ -800,7 +800,7 @@ UINT16 WINAPI RealizePalette16( HDC16 hDC )
/***********************************************************************
/***********************************************************************
* RealizePalette
32
[GDI32.280] Maps palette entries to system palette
* RealizePalette [GDI32.280] Maps palette entries to system palette
*
*
* RETURNS
* RETURNS
* Success: Number of entries in logical palette
* Success: Number of entries in logical palette
...
@@ -858,7 +858,7 @@ INT16 WINAPI UpdateColors16( HDC16 hDC )
...
@@ -858,7 +858,7 @@ INT16 WINAPI UpdateColors16( HDC16 hDC )
/**********************************************************************
/**********************************************************************
* UpdateColors
32
[GDI32.359] Remaps current colors to logical palette
* UpdateColors [GDI32.359] Remaps current colors to logical palette
*
*
* RETURNS
* RETURNS
* Success: TRUE
* Success: TRUE
...
...
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