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
a9b05bea
Commit
a9b05bea
authored
Dec 13, 2007
by
Andrew Talbot
Committed by
Alexandre Julliard
Dec 14, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Remove unneeded casts.
parent
167aa9b9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
18 deletions
+18
-18
format_msg.c
dlls/kernel32/format_msg.c
+2
-2
global16.c
dlls/kernel32/global16.c
+9
-9
heap.c
dlls/kernel32/heap.c
+7
-7
No files found.
dlls/kernel32/format_msg.c
View file @
a9b05bea
...
...
@@ -331,7 +331,7 @@ DWORD WINAPI FormatMessageA(
}
TRACE
(
"-- %s
\n
"
,
debugstr_a
(
target
));
if
(
dwFlags
&
FORMAT_MESSAGE_ALLOCATE_BUFFER
)
{
*
((
LPVOID
*
)
lpBuffer
)
=
(
LPVOID
)
LocalAlloc
(
LMEM_ZEROINIT
,
max
(
nSize
,
talloced
));
*
((
LPVOID
*
)
lpBuffer
)
=
LocalAlloc
(
LMEM_ZEROINIT
,
max
(
nSize
,
talloced
));
memcpy
(
*
(
LPSTR
*
)
lpBuffer
,
target
,
talloced
);
}
else
{
lstrcpynA
(
lpBuffer
,
target
,
nSize
);
...
...
@@ -547,7 +547,7 @@ DWORD WINAPI FormatMessageW(
if
(
dwFlags
&
FORMAT_MESSAGE_ALLOCATE_BUFFER
)
{
/* nSize is the MINIMUM size */
DWORD
len
=
strlenW
(
target
)
+
1
;
*
((
LPVOID
*
)
lpBuffer
)
=
(
LPVOID
)
LocalAlloc
(
LMEM_ZEROINIT
,
len
*
sizeof
(
WCHAR
));
*
((
LPVOID
*
)
lpBuffer
)
=
LocalAlloc
(
LMEM_ZEROINIT
,
len
*
sizeof
(
WCHAR
));
strcpyW
(
*
(
LPWSTR
*
)
lpBuffer
,
target
);
}
else
lstrcpynW
(
lpBuffer
,
target
,
nSize
);
...
...
dlls/kernel32/global16.c
View file @
a9b05bea
...
...
@@ -324,9 +324,9 @@ HGLOBAL16 WINAPI GlobalReAlloc16(
!
(
pArena
->
flags
&
GA_DISCARDABLE
)
||
(
pArena
->
lockCount
>
0
)
||
(
pArena
->
pageLockCount
>
0
))
return
0
;
if
(
pArena
->
flags
&
GA_DOSMEM
)
DOSMEM_FreeBlock
(
(
void
*
)
pArena
->
base
);
DOSMEM_FreeBlock
(
pArena
->
base
);
else
HeapFree
(
heap
,
0
,
(
void
*
)
pArena
->
base
);
HeapFree
(
heap
,
0
,
pArena
->
base
);
pArena
->
base
=
0
;
/* Note: we rely on the fact that SELECTOR_ReallocBlock won't
...
...
@@ -355,7 +355,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16(
/* Reallocate the linear memory */
ptr
=
(
void
*
)
pArena
->
base
;
ptr
=
pArena
->
base
;
oldsize
=
pArena
->
size
;
TRACE
(
"oldbase %p oldsize %08x newsize %08x
\n
"
,
ptr
,
oldsize
,
size
);
if
(
ptr
&&
(
size
==
oldsize
))
return
handle
;
/* Nothing to do */
...
...
@@ -399,7 +399,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16(
if
(
pArena
->
pageLockCount
<
1
)
{
if
(
pArena
->
flags
&
GA_DOSMEM
)
DOSMEM_FreeBlock
(
(
void
*
)
pArena
->
base
);
DOSMEM_FreeBlock
(
pArena
->
base
);
else
HeapFree
(
heap
,
0
,
ptr
);
SELECTOR_FreeBlock
(
sel
);
...
...
@@ -415,7 +415,7 @@ HGLOBAL16 WINAPI GlobalReAlloc16(
if
(
!
sel
)
{
if
(
pArena
->
flags
&
GA_DOSMEM
)
DOSMEM_FreeBlock
(
(
void
*
)
pArena
->
base
);
DOSMEM_FreeBlock
(
pArena
->
base
);
else
HeapFree
(
heap
,
0
,
ptr
);
memset
(
pArena
,
0
,
sizeof
(
GLOBALARENA
)
);
...
...
@@ -424,9 +424,9 @@ HGLOBAL16 WINAPI GlobalReAlloc16(
selcount
=
(
size
+
0xffff
)
/
0x10000
;
if
(
!
(
pNewArena
=
GLOBAL_GetArena
(
sel
,
selcount
)))
{
{
if
(
pArena
->
flags
&
GA_DOSMEM
)
DOSMEM_FreeBlock
(
(
void
*
)
pArena
->
base
);
DOSMEM_FreeBlock
(
pArena
->
base
);
else
HeapFree
(
heap
,
0
,
ptr
);
SELECTOR_FreeBlock
(
sel
);
...
...
@@ -468,7 +468,7 @@ HGLOBAL16 WINAPI GlobalFree16(
WARN
(
"Invalid handle 0x%04x passed to GlobalFree16!
\n
"
,
handle
);
return
0
;
}
ptr
=
(
void
*
)
GET_ARENA_PTR
(
handle
)
->
base
;
ptr
=
GET_ARENA_PTR
(
handle
)
->
base
;
TRACE
(
"%04x
\n
"
,
handle
);
if
(
!
GLOBAL_FreeBlock
(
handle
))
return
handle
;
/* failed */
...
...
@@ -533,7 +533,7 @@ LPVOID WINAPI GlobalLock16(
if
(
!
VALID_HANDLE
(
handle
))
return
0
;
GET_ARENA_PTR
(
handle
)
->
lockCount
++
;
return
(
LPVOID
)
GET_ARENA_PTR
(
handle
)
->
base
;
return
GET_ARENA_PTR
(
handle
)
->
base
;
}
...
...
dlls/kernel32/heap.c
View file @
a9b05bea
...
...
@@ -107,7 +107,7 @@ static inline HANDLE HEAP_CreateSystemHeap(void)
{
/* wait for the heap to be initialized */
WaitForSingleObject
(
event
,
INFINITE
);
systemHeap
=
(
HANDLE
)
base
;
systemHeap
=
base
;
}
CloseHandle
(
map
);
return
systemHeap
;
...
...
@@ -360,7 +360,7 @@ HGLOBAL WINAPI GlobalAlloc(
{
palloc
=
HeapAlloc
(
GetProcessHeap
(),
hpflags
,
size
);
TRACE
(
"(flags=%04x) returning %p
\n
"
,
flags
,
palloc
);
return
(
HGLOBAL
)
palloc
;
return
palloc
;
}
else
/* HANDLE */
{
...
...
@@ -620,10 +620,10 @@ HGLOBAL WINAPI GlobalReAlloc(
}
else
{
size
=
HeapSize
(
GetProcessHeap
(),
0
,
(
LPVOID
)
hmem
);
size
=
HeapSize
(
GetProcessHeap
(),
0
,
hmem
);
hnew
=
GlobalAlloc
(
flags
,
size
);
palloc
=
GlobalLock
(
hnew
);
memcpy
(
palloc
,
(
LPVOID
)
hmem
,
size
);
memcpy
(
palloc
,
hmem
,
size
);
GlobalUnlock
(
hnew
);
GlobalFree
(
hmem
);
}
...
...
@@ -743,7 +743,7 @@ HGLOBAL WINAPI GlobalFree(HGLOBAL hmem)
hreturned
=
0
;
if
(
ISPOINTER
(
hmem
))
/* POINTER */
{
if
(
!
HeapFree
(
GetProcessHeap
(),
0
,
(
LPVOID
)
hmem
))
if
(
!
HeapFree
(
GetProcessHeap
(),
0
,
hmem
))
{
SetLastError
(
ERROR_INVALID_HANDLE
);
hreturned
=
hmem
;
...
...
@@ -817,7 +817,7 @@ SIZE_T WINAPI GlobalSize(HGLOBAL hmem)
if
(
ISPOINTER
(
hmem
))
{
retval
=
HeapSize
(
GetProcessHeap
(),
0
,
(
LPVOID
)
hmem
);
retval
=
HeapSize
(
GetProcessHeap
(),
0
,
hmem
);
}
else
{
...
...
@@ -1159,7 +1159,7 @@ void WINAPI __regs_AllocMappedBuffer(
buffer
[
0
]
=
(
DWORD
)
handle
;
buffer
[
1
]
=
ptr
;
context
->
Eax
=
(
DWORD
)
ptr
;
context
->
Eax
=
ptr
;
context
->
Edi
=
(
DWORD
)(
buffer
+
2
);
}
}
...
...
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