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
a20b7921
Commit
a20b7921
authored
Apr 09, 2000
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Apr 09, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced xmalloc calls with malloc/HeapAlloc calls.
parent
d57f7d14
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
7 deletions
+23
-7
palette.c
graphics/ttydrv/palette.c
+7
-2
bitmap.c
graphics/x11drv/bitmap.c
+7
-1
palette.c
graphics/x11drv/palette.c
+9
-4
No files found.
graphics/ttydrv/palette.c
View file @
a20b7921
...
...
@@ -4,11 +4,12 @@
* Copyright 1999 Patrik Stridvall
*/
#include <stdlib.h>
#include "color.h"
#include "debugtools.h"
#include "palette.h"
#include "ttydrv.h"
#include "xmalloc.h"
DEFAULT_DEBUG_CHANNEL
(
ttydrv
)
...
...
@@ -35,7 +36,11 @@ BOOL TTYDRV_PALETTE_Initialize(void)
TTYDRV_DC_DevCaps
.
sizePalette
=
256
;
COLOR_sysPal
=
(
PALETTEENTRY
*
)
xmalloc
(
sizeof
(
PALETTEENTRY
)
*
TTYDRV_DC_DevCaps
.
sizePalette
);
COLOR_sysPal
=
(
PALETTEENTRY
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PALETTEENTRY
)
*
TTYDRV_DC_DevCaps
.
sizePalette
);
if
(
COLOR_sysPal
==
NULL
)
{
WARN
(
"No memory to create system palette!"
);
return
FALSE
;
}
for
(
i
=
0
;
i
<
TTYDRV_DC_DevCaps
.
sizePalette
;
i
++
)
{
const
PALETTEENTRY
*
src
;
...
...
graphics/x11drv/bitmap.c
View file @
a20b7921
...
...
@@ -357,7 +357,13 @@ static LONG X11DRV_SetBitmapBits(BITMAPOBJ *bmp, void *bits, LONG count)
EnterCriticalSection
(
&
X11DRV_CritSection
);
image
=
XCreateImage
(
display
,
X11DRV_GetVisual
(),
bmp
->
bitmap
.
bmBitsPixel
,
ZPixmap
,
0
,
NULL
,
bmp
->
bitmap
.
bmWidth
,
height
,
32
,
0
);
image
->
data
=
(
LPBYTE
)
xmalloc
(
image
->
bytes_per_line
*
height
);
if
(
!
(
image
->
data
=
(
LPBYTE
)
malloc
(
image
->
bytes_per_line
*
height
)))
{
WARN
(
"No memory to create image data.
\n
"
);
XDestroyImage
(
image
);
LeaveCriticalSection
(
&
X11DRV_CritSection
);
return
0
;
}
/* copy 16 bit padded image buffer with real bitsperpixel to XImage */
...
...
graphics/x11drv/palette.c
View file @
a20b7921
...
...
@@ -20,7 +20,6 @@
#include "options.h"
#include "palette.h"
#include "windef.h"
#include "xmalloc.h"
#include "x11drv.h"
DEFAULT_DEBUG_CHANNEL
(
palette
);
...
...
@@ -253,7 +252,10 @@ static BOOL X11DRV_PALETTE_BuildPrivateMap(void)
XColor
color
;
int
i
;
COLOR_sysPal
=
(
PALETTEENTRY
*
)
xmalloc
(
sizeof
(
PALETTEENTRY
)
*
X11DRV_DevCaps
.
sizePalette
);
if
((
COLOR_sysPal
=
(
PALETTEENTRY
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
PALETTEENTRY
)
*
X11DRV_DevCaps
.
sizePalette
))
==
NULL
)
{
WARN
(
"Can not allocate system palette
\n
"
);
return
FALSE
;
}
TRACE
(
"Building private map - %i palette entries
\n
"
,
X11DRV_DevCaps
.
sizePalette
);
...
...
@@ -402,7 +404,10 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void)
* X guidelines and does binary search...
*/
pixDynMapping
=
(
unsigned
long
*
)
xmalloc
(
sizeof
(
long
)
*
X11DRV_DevCaps
.
sizePalette
);
if
((
pixDynMapping
=
(
unsigned
long
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
long
)
*
X11DRV_DevCaps
.
sizePalette
))
==
NULL
)
{
WARN
(
"Out of memory while building system palette.
\n
"
);
return
FALSE
;
}
while
(
c_max
-
c_min
>
0
)
{
c_val
=
(
c_max
+
c_min
)
/
2
+
(
c_max
+
c_min
)
%
2
;
...
...
@@ -519,7 +524,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap(void)
X11DRV_PALETTE_XPixelToPalette
[
X11DRV_PALETTE_PaletteToXPixel
[
i
]]
=
i
;
}
if
(
pixDynMapping
)
free
(
pixDynMapping
);
if
(
pixDynMapping
)
HeapFree
(
GetProcessHeap
(),
0
,
pixDynMapping
);
return
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