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
5f55f154
Commit
5f55f154
authored
Nov 05, 2008
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Nov 06, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Remove superfluous casts of/to void pointers.
parent
095568df
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
32 deletions
+28
-32
clist.c
dlls/shlwapi/clist.c
+10
-14
istream.c
dlls/shlwapi/istream.c
+1
-1
ordinal.c
dlls/shlwapi/ordinal.c
+1
-1
reg.c
dlls/shlwapi/reg.c
+11
-11
string.c
dlls/shlwapi/string.c
+2
-2
string.c
dlls/shlwapi/tests/string.c
+2
-2
thread.c
dlls/shlwapi/thread.c
+1
-1
No files found.
dlls/shlwapi/clist.c
View file @
5f55f154
...
...
@@ -91,8 +91,7 @@ HRESULT WINAPI SHAddDataBlock(LPDBLIST* lppList, const DATABLOCK_HEADER *lpNewIt
if
(
!*
lppList
)
{
/* An empty list. Allocate space for terminal ulSize also */
*
lppList
=
(
LPDATABLOCK_HEADER
)
LocalAlloc
(
LMEM_ZEROINIT
,
ulSize
+
sizeof
(
ULONG
));
*
lppList
=
LocalAlloc
(
LMEM_ZEROINIT
,
ulSize
+
sizeof
(
ULONG
));
lpInsertAt
=
*
lppList
;
}
else
...
...
@@ -109,8 +108,7 @@ HRESULT WINAPI SHAddDataBlock(LPDBLIST* lppList, const DATABLOCK_HEADER *lpNewIt
}
/* Increase the size of the list */
lpIter
=
(
LPDATABLOCK_HEADER
)
LocalReAlloc
((
HLOCAL
)
*
lppList
,
ulTotalSize
+
ulSize
+
sizeof
(
ULONG
),
lpIter
=
LocalReAlloc
(
*
lppList
,
ulTotalSize
+
ulSize
+
sizeof
(
ULONG
),
LMEM_ZEROINIT
|
LMEM_MOVEABLE
);
if
(
lpIter
)
{
...
...
@@ -247,7 +245,7 @@ HRESULT WINAPI SHReadDataBlockList(IStream* lpStream, LPDBLIST* lppList)
if
(
*
lppList
)
{
/* Free any existing list */
LocalFree
(
(
HLOCAL
)
*
lppList
);
LocalFree
(
*
lppList
);
*
lppList
=
NULL
;
}
...
...
@@ -283,10 +281,9 @@ HRESULT WINAPI SHReadDataBlockList(IStream* lpStream, LPDBLIST* lppList)
LPDATABLOCK_HEADER
lpTemp
;
if
(
pItem
==
bBuff
)
lpTemp
=
(
LPDATABLOCK_HEADER
)
LocalAlloc
(
LMEM_ZEROINIT
,
ulSize
);
lpTemp
=
LocalAlloc
(
LMEM_ZEROINIT
,
ulSize
);
else
lpTemp
=
(
LPDATABLOCK_HEADER
)
LocalReAlloc
((
HLOCAL
)
pItem
,
ulSize
,
LMEM_ZEROINIT
|
LMEM_MOVEABLE
);
lpTemp
=
LocalReAlloc
(
pItem
,
ulSize
,
LMEM_ZEROINIT
|
LMEM_MOVEABLE
);
if
(
!
lpTemp
)
{
...
...
@@ -312,7 +309,7 @@ HRESULT WINAPI SHReadDataBlockList(IStream* lpStream, LPDBLIST* lppList)
/* If we allocated space, free it */
if
(
pItem
!=
bBuff
)
LocalFree
(
(
HLOCAL
)
pItem
);
LocalFree
(
pItem
);
return
hRet
;
}
...
...
@@ -336,7 +333,7 @@ VOID WINAPI SHFreeDataBlockList(LPDBLIST lpList)
TRACE
(
"(%p)
\n
"
,
lpList
);
if
(
lpList
)
LocalFree
(
(
HLOCAL
)
lpList
);
LocalFree
(
lpList
);
}
/*************************************************************************
...
...
@@ -389,20 +386,19 @@ BOOL WINAPI SHRemoveDataBlock(LPDBLIST* lppList, DWORD dwSignature)
lpList
=
NextItem
(
lpList
);
/* Resize the list */
ulNewSize
=
LocalSize
(
(
HLOCAL
)
*
lppList
)
-
lpItem
->
cbSize
;
ulNewSize
=
LocalSize
(
*
lppList
)
-
lpItem
->
cbSize
;
/* Copy following elements over lpItem */
memmove
(
lpItem
,
lpNext
,
(
char
*
)
lpList
-
(
char
*
)
lpNext
+
sizeof
(
ULONG
));
if
(
ulNewSize
<=
sizeof
(
ULONG
))
{
LocalFree
(
(
HLOCAL
)
*
lppList
);
LocalFree
(
*
lppList
);
*
lppList
=
NULL
;
/* Removed the last element */
}
else
{
lpList
=
(
LPDATABLOCK_HEADER
)
LocalReAlloc
((
HLOCAL
)
*
lppList
,
ulNewSize
,
LMEM_ZEROINIT
|
LMEM_MOVEABLE
);
lpList
=
LocalReAlloc
(
*
lppList
,
ulNewSize
,
LMEM_ZEROINIT
|
LMEM_MOVEABLE
);
if
(
lpList
)
*
lppList
=
lpList
;
}
...
...
dlls/shlwapi/istream.c
View file @
5f55f154
...
...
@@ -101,7 +101,7 @@ static ULONG WINAPI IStream_fnRelease(IStream *iface)
if
(
!
refCount
)
{
IStream_fnCommit
(
iface
,
0
);
/* If ever buffered, this will be needed */
LocalFree
(
(
HLOCAL
)
This
->
lpszPath
);
LocalFree
(
This
->
lpszPath
);
CloseHandle
(
This
->
hFile
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
dlls/shlwapi/ordinal.c
View file @
5f55f154
...
...
@@ -4335,7 +4335,7 @@ INT WINAPIV ShellMessageBoxWrapW(HINSTANCE hInstance, HWND hWnd, LPCWSTR lpText,
va_end
(
args
);
ret
=
MessageBoxW
(
hWnd
,
pszTemp
,
pszTitle
,
uType
);
LocalFree
(
(
HLOCAL
)
pszTemp
);
LocalFree
(
pszTemp
);
return
ret
;
}
...
...
dlls/shlwapi/reg.c
View file @
5f55f154
...
...
@@ -68,8 +68,8 @@ HRESULT WINAPI SHRegGetCLSIDKeyW(REFGUID,LPCWSTR,BOOL,BOOL,PHKEY);
*/
static
HKEY
WINAPI
REG_GetHKEYFromHUSKEY
(
HUSKEY
hUSKey
,
BOOL
which
)
{
HKEY
test
=
(
HKEY
)
hUSKey
;
LPSHUSKEY
mihk
=
(
LPSHUSKEY
)
hUSKey
;
HKEY
test
=
hUSKey
;
LPSHUSKEY
mihk
=
hUSKey
;
if
((
test
==
HKEY_CLASSES_ROOT
)
||
(
test
==
HKEY_CURRENT_CONFIG
)
||
...
...
@@ -174,7 +174,7 @@ LONG WINAPI SHRegOpenUSKeyW(LPCWSTR Path, REGSAM AccessType, HUSKEY hRelativeUSK
TRACE
(
"HUSKEY=%p
\n
"
,
hKey
);
if
(
phNewUSKey
)
*
phNewUSKey
=
(
HUSKEY
)
hKey
;
*
phNewUSKey
=
hKey
;
return
ERROR_SUCCESS
;
}
...
...
@@ -1398,21 +1398,21 @@ DWORD WINAPI SHQueryValueExA( HKEY hKey, LPCSTR lpszValue,
char
cNull
=
'\0'
;
nBytesToAlloc
=
dwUnExpDataLen
;
szData
=
(
LPSTR
)
LocalAlloc
(
LMEM_ZEROINIT
,
nBytesToAlloc
);
szData
=
LocalAlloc
(
LMEM_ZEROINIT
,
nBytesToAlloc
);
RegQueryValueExA
(
hKey
,
lpszValue
,
lpReserved
,
NULL
,
(
LPBYTE
)
szData
,
&
nBytesToAlloc
);
dwExpDataLen
=
ExpandEnvironmentStringsA
(
szData
,
&
cNull
,
1
);
dwUnExpDataLen
=
max
(
nBytesToAlloc
,
dwExpDataLen
);
LocalFree
(
(
HLOCAL
)
szData
);
LocalFree
(
szData
);
}
else
{
nBytesToAlloc
=
(
lstrlenA
(
pvData
)
+
1
)
*
sizeof
(
CHAR
);
szData
=
(
LPSTR
)
LocalAlloc
(
LMEM_ZEROINIT
,
nBytesToAlloc
);
szData
=
LocalAlloc
(
LMEM_ZEROINIT
,
nBytesToAlloc
);
lstrcpyA
(
szData
,
pvData
);
dwExpDataLen
=
ExpandEnvironmentStringsA
(
szData
,
pvData
,
*
pcbData
/
sizeof
(
CHAR
));
if
(
dwExpDataLen
>
*
pcbData
)
dwRet
=
ERROR_MORE_DATA
;
dwUnExpDataLen
=
max
(
nBytesToAlloc
,
dwExpDataLen
);
LocalFree
(
(
HLOCAL
)
szData
);
LocalFree
(
szData
);
}
}
...
...
@@ -1459,21 +1459,21 @@ DWORD WINAPI SHQueryValueExW(HKEY hKey, LPCWSTR lpszValue,
WCHAR
cNull
=
'\0'
;
nBytesToAlloc
=
dwUnExpDataLen
;
szData
=
(
LPWSTR
)
LocalAlloc
(
LMEM_ZEROINIT
,
nBytesToAlloc
);
szData
=
LocalAlloc
(
LMEM_ZEROINIT
,
nBytesToAlloc
);
RegQueryValueExW
(
hKey
,
lpszValue
,
lpReserved
,
NULL
,
(
LPBYTE
)
szData
,
&
nBytesToAlloc
);
dwExpDataLen
=
ExpandEnvironmentStringsW
(
szData
,
&
cNull
,
1
);
dwUnExpDataLen
=
max
(
nBytesToAlloc
,
dwExpDataLen
);
LocalFree
(
(
HLOCAL
)
szData
);
LocalFree
(
szData
);
}
else
{
nBytesToAlloc
=
(
lstrlenW
(
pvData
)
+
1
)
*
sizeof
(
WCHAR
);
szData
=
(
LPWSTR
)
LocalAlloc
(
LMEM_ZEROINIT
,
nBytesToAlloc
);
szData
=
LocalAlloc
(
LMEM_ZEROINIT
,
nBytesToAlloc
);
lstrcpyW
(
szData
,
pvData
);
dwExpDataLen
=
ExpandEnvironmentStringsW
(
szData
,
pvData
,
*
pcbData
/
sizeof
(
WCHAR
)
);
if
(
dwExpDataLen
>
*
pcbData
)
dwRet
=
ERROR_MORE_DATA
;
dwUnExpDataLen
=
max
(
nBytesToAlloc
,
dwExpDataLen
);
LocalFree
(
(
HLOCAL
)
szData
);
LocalFree
(
szData
);
}
}
...
...
dlls/shlwapi/string.c
View file @
5f55f154
...
...
@@ -911,7 +911,7 @@ LPSTR WINAPI StrDupA(LPCSTR lpszStr)
TRACE
(
"(%s)
\n
"
,
debugstr_a
(
lpszStr
));
iLen
=
lpszStr
?
strlen
(
lpszStr
)
+
1
:
1
;
lpszRet
=
(
LPSTR
)
LocalAlloc
(
LMEM_FIXED
,
iLen
);
lpszRet
=
LocalAlloc
(
LMEM_FIXED
,
iLen
);
if
(
lpszRet
)
{
...
...
@@ -936,7 +936,7 @@ LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
TRACE
(
"(%s)
\n
"
,
debugstr_w
(
lpszStr
));
iLen
=
(
lpszStr
?
strlenW
(
lpszStr
)
+
1
:
1
)
*
sizeof
(
WCHAR
);
lpszRet
=
(
LPWSTR
)
LocalAlloc
(
LMEM_FIXED
,
iLen
);
lpszRet
=
LocalAlloc
(
LMEM_FIXED
,
iLen
);
if
(
lpszRet
)
{
...
...
dlls/shlwapi/tests/string.c
View file @
5f55f154
...
...
@@ -486,7 +486,7 @@ static void test_StrDupA(void)
if
(
lpszStr
)
{
ok
(
!
strcmp
(
result
->
byte_size_64
,
lpszStr
),
"Copied string wrong
\n
"
);
LocalFree
(
(
HLOCAL
)
lpszStr
);
LocalFree
(
lpszStr
);
}
result
++
;
}
...
...
@@ -496,7 +496,7 @@ static void test_StrDupA(void)
*/
lpszStr
=
StrDupA
(
NULL
);
ok
(
lpszStr
==
NULL
||
*
lpszStr
==
'\0'
,
"NULL string returned %p
\n
"
,
lpszStr
);
LocalFree
(
(
HLOCAL
)
lpszStr
);
LocalFree
(
lpszStr
);
}
static
void
test_StrFormatByteSize64A
(
void
)
...
...
dlls/shlwapi/thread.c
View file @
5f55f154
...
...
@@ -140,7 +140,7 @@ HRESULT WINAPI SHGetThreadRef(IUnknown **lppUnknown)
if
(
!
lppUnknown
||
SHLWAPI_ThreadRef_index
==
TLS_OUT_OF_INDEXES
)
return
E_NOINTERFACE
;
*
lppUnknown
=
(
IUnknown
*
)
TlsGetValue
(
SHLWAPI_ThreadRef_index
);
*
lppUnknown
=
TlsGetValue
(
SHLWAPI_ThreadRef_index
);
if
(
!*
lppUnknown
)
return
E_NOINTERFACE
;
...
...
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