Commit a8510589 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

netapi32: Remove superfluous pointer casts.

parent 258d953a
...@@ -658,7 +658,7 @@ NetQueryDisplayInformation( ...@@ -658,7 +658,7 @@ NetQueryDisplayInformation(
admin_size - sizeof(NET_DISPLAY_USER) + admin_size - sizeof(NET_DISPLAY_USER) +
guest_size - sizeof(NET_DISPLAY_USER), guest_size - sizeof(NET_DISPLAY_USER),
SortedBuffer); SortedBuffer);
inf = (PNET_DISPLAY_USER) *SortedBuffer; inf = *SortedBuffer;
str = (LPWSTR) ((PBYTE) inf + sizeof(NET_DISPLAY_USER) * records); str = (LPWSTR) ((PBYTE) inf + sizeof(NET_DISPLAY_USER) * records);
inf->usri1_name = str; inf->usri1_name = str;
str = (LPWSTR) ( str = (LPWSTR) (
...@@ -826,8 +826,7 @@ NET_API_STATUS WINAPI NetUserModalsGet( ...@@ -826,8 +826,7 @@ NET_API_STATUS WINAPI NetUserModalsGet(
} }
umi = (USER_MODALS_INFO_2 *) *pbuffer; umi = (USER_MODALS_INFO_2 *) *pbuffer;
umi->usrmod2_domain_id = (PSID)(*pbuffer + umi->usrmod2_domain_id = *pbuffer + sizeof(USER_MODALS_INFO_2);
sizeof(USER_MODALS_INFO_2));
umi->usrmod2_domain_name = (LPWSTR)(*pbuffer + umi->usrmod2_domain_name = (LPWSTR)(*pbuffer +
sizeof(USER_MODALS_INFO_2) + GetLengthSid(domainIdentifier)); sizeof(USER_MODALS_INFO_2) + GetLengthSid(domainIdentifier));
......
...@@ -400,7 +400,7 @@ typedef struct _NetBTNameQueryData { ...@@ -400,7 +400,7 @@ typedef struct _NetBTNameQueryData {
static BOOL NetBTFindNameAnswerCallback(void *pVoid, WORD answerCount, static BOOL NetBTFindNameAnswerCallback(void *pVoid, WORD answerCount,
WORD answerIndex, PUCHAR rData, WORD rLen) WORD answerIndex, PUCHAR rData, WORD rLen)
{ {
NetBTNameQueryData *queryData = (NetBTNameQueryData *)pVoid; NetBTNameQueryData *queryData = pVoid;
BOOL ret; BOOL ret;
if (queryData) if (queryData)
...@@ -696,7 +696,7 @@ typedef struct _NetBTNodeQueryData ...@@ -696,7 +696,7 @@ typedef struct _NetBTNodeQueryData
static BOOL NetBTNodeStatusAnswerCallback(void *pVoid, WORD answerCount, static BOOL NetBTNodeStatusAnswerCallback(void *pVoid, WORD answerCount,
WORD answerIndex, PUCHAR rData, WORD rLen) WORD answerIndex, PUCHAR rData, WORD rLen)
{ {
NetBTNodeQueryData *data = (NetBTNodeQueryData *)pVoid; NetBTNodeQueryData *data = pVoid;
if (data && !data->gotResponse && rData && rLen >= 1) if (data && !data->gotResponse && rData && rLen >= 1)
{ {
...@@ -811,7 +811,7 @@ static UCHAR NetBTAstatRemote(NetBTAdapter *adapter, PNCB ncb) ...@@ -811,7 +811,7 @@ static UCHAR NetBTAstatRemote(NetBTAdapter *adapter, PNCB ncb)
static UCHAR NetBTAstat(void *adapt, PNCB ncb) static UCHAR NetBTAstat(void *adapt, PNCB ncb)
{ {
NetBTAdapter *adapter = (NetBTAdapter *)adapt; NetBTAdapter *adapter = adapt;
UCHAR ret; UCHAR ret;
TRACE("adapt %p, NCB %p\n", adapt, ncb); TRACE("adapt %p, NCB %p\n", adapt, ncb);
...@@ -856,7 +856,7 @@ static UCHAR NetBTAstat(void *adapt, PNCB ncb) ...@@ -856,7 +856,7 @@ static UCHAR NetBTAstat(void *adapt, PNCB ncb)
static UCHAR NetBTFindName(void *adapt, PNCB ncb) static UCHAR NetBTFindName(void *adapt, PNCB ncb)
{ {
NetBTAdapter *adapter = (NetBTAdapter *)adapt; NetBTAdapter *adapter = adapt;
UCHAR ret; UCHAR ret;
const NBNameCacheEntry *cacheEntry = NULL; const NBNameCacheEntry *cacheEntry = NULL;
PFIND_NAME_HEADER foundName; PFIND_NAME_HEADER foundName;
...@@ -973,7 +973,7 @@ static UCHAR NetBTSessionReq(SOCKET fd, const UCHAR *calledName, ...@@ -973,7 +973,7 @@ static UCHAR NetBTSessionReq(SOCKET fd, const UCHAR *calledName,
static UCHAR NetBTCall(void *adapt, PNCB ncb, void **sess) static UCHAR NetBTCall(void *adapt, PNCB ncb, void **sess)
{ {
NetBTAdapter *adapter = (NetBTAdapter *)adapt; NetBTAdapter *adapter = adapt;
UCHAR ret; UCHAR ret;
const NBNameCacheEntry *cacheEntry = NULL; const NBNameCacheEntry *cacheEntry = NULL;
...@@ -1074,8 +1074,8 @@ static UCHAR NetBTCall(void *adapt, PNCB ncb, void **sess) ...@@ -1074,8 +1074,8 @@ static UCHAR NetBTCall(void *adapt, PNCB ncb, void **sess)
*/ */
static UCHAR NetBTSend(void *adapt, void *sess, PNCB ncb) static UCHAR NetBTSend(void *adapt, void *sess, PNCB ncb)
{ {
NetBTAdapter *adapter = (NetBTAdapter *)adapt; NetBTAdapter *adapter = adapt;
NetBTSession *session = (NetBTSession *)sess; NetBTSession *session = sess;
UCHAR buffer[NBSS_HDRSIZE], ret; UCHAR buffer[NBSS_HDRSIZE], ret;
int r; int r;
WSABUF wsaBufs[2]; WSABUF wsaBufs[2];
...@@ -1123,8 +1123,8 @@ static UCHAR NetBTSend(void *adapt, void *sess, PNCB ncb) ...@@ -1123,8 +1123,8 @@ static UCHAR NetBTSend(void *adapt, void *sess, PNCB ncb)
static UCHAR NetBTRecv(void *adapt, void *sess, PNCB ncb) static UCHAR NetBTRecv(void *adapt, void *sess, PNCB ncb)
{ {
NetBTAdapter *adapter = (NetBTAdapter *)adapt; NetBTAdapter *adapter = adapt;
NetBTSession *session = (NetBTSession *)sess; NetBTSession *session = sess;
UCHAR buffer[NBSS_HDRSIZE], ret; UCHAR buffer[NBSS_HDRSIZE], ret;
int r; int r;
WSABUF wsaBufs[2]; WSABUF wsaBufs[2];
...@@ -1231,7 +1231,7 @@ error: ...@@ -1231,7 +1231,7 @@ error:
static UCHAR NetBTHangup(void *adapt, void *sess) static UCHAR NetBTHangup(void *adapt, void *sess)
{ {
NetBTSession *session = (NetBTSession *)sess; NetBTSession *session = sess;
TRACE("adapt %p, session %p\n", adapt, session); TRACE("adapt %p, session %p\n", adapt, session);
...@@ -1255,7 +1255,7 @@ static void NetBTCleanupAdapter(void *adapt) ...@@ -1255,7 +1255,7 @@ static void NetBTCleanupAdapter(void *adapt)
TRACE("adapt %p\n", adapt); TRACE("adapt %p\n", adapt);
if (adapt) if (adapt)
{ {
NetBTAdapter *adapter = (NetBTAdapter *)adapt; NetBTAdapter *adapter = adapt;
if (adapter->nameCache) if (adapter->nameCache)
NBNameCacheDestroy(adapter->nameCache); NBNameCacheDestroy(adapter->nameCache);
...@@ -1310,7 +1310,7 @@ static BOOL NetBTEnumCallback(UCHAR totalLANAs, UCHAR lanaIndex, ...@@ -1310,7 +1310,7 @@ static BOOL NetBTEnumCallback(UCHAR totalLANAs, UCHAR lanaIndex,
ULONG transport, const NetBIOSAdapterImpl *data, void *closure) ULONG transport, const NetBIOSAdapterImpl *data, void *closure)
{ {
BOOL ret; BOOL ret;
PMIB_IPADDRTABLE table = (PMIB_IPADDRTABLE)closure; PMIB_IPADDRTABLE table = closure;
if (table && data) if (table && data)
{ {
...@@ -1319,7 +1319,7 @@ static BOOL NetBTEnumCallback(UCHAR totalLANAs, UCHAR lanaIndex, ...@@ -1319,7 +1319,7 @@ static BOOL NetBTEnumCallback(UCHAR totalLANAs, UCHAR lanaIndex,
ret = FALSE; ret = FALSE;
for (ndx = 0; !ret && ndx < table->dwNumEntries; ndx++) for (ndx = 0; !ret && ndx < table->dwNumEntries; ndx++)
{ {
const NetBTAdapter *adapter = (const NetBTAdapter *)data->data; const NetBTAdapter *adapter = data->data;
if (table->table[ndx].dwIndex == adapter->ipr.dwIndex) if (table->table[ndx].dwIndex == adapter->ipr.dwIndex)
{ {
......
...@@ -762,7 +762,7 @@ static UCHAR nbDispatch(NetBIOSAdapter *adapter, PNCB ncb) ...@@ -762,7 +762,7 @@ static UCHAR nbDispatch(NetBIOSAdapter *adapter, PNCB ncb)
static DWORD WINAPI nbCmdThread(LPVOID lpVoid) static DWORD WINAPI nbCmdThread(LPVOID lpVoid)
{ {
PNCB ncb = (PNCB)lpVoid; PNCB ncb = lpVoid;
if (ncb) if (ncb)
{ {
......
...@@ -42,12 +42,12 @@ static void run_apibuf_tests(void) ...@@ -42,12 +42,12 @@ static void run_apibuf_tests(void)
NET_API_STATUS res; NET_API_STATUS res;
/* test normal logic */ /* test normal logic */
ok(pNetApiBufferAllocate(1024, (LPVOID *)&p) == NERR_Success, ok(pNetApiBufferAllocate(1024, &p) == NERR_Success,
"Reserved memory\n"); "Reserved memory\n");
ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size\n"); ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size\n");
ok(dwSize >= 1024, "The size is correct\n"); ok(dwSize >= 1024, "The size is correct\n");
ok(pNetApiBufferReallocate(p, 1500, (LPVOID *) &p) == NERR_Success, ok(pNetApiBufferReallocate(p, 1500, &p) == NERR_Success,
"Reallocated\n"); "Reallocated\n");
ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size\n"); ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size\n");
ok(dwSize >= 1500, "The size is correct\n"); ok(dwSize >= 1500, "The size is correct\n");
...@@ -58,14 +58,14 @@ static void run_apibuf_tests(void) ...@@ -58,14 +58,14 @@ static void run_apibuf_tests(void)
ok(pNetApiBufferSize(NULL, &dwSize) == ERROR_INVALID_PARAMETER, "Error for NULL pointer\n"); ok(pNetApiBufferSize(NULL, &dwSize) == ERROR_INVALID_PARAMETER, "Error for NULL pointer\n");
/* border reallocate cases */ /* border reallocate cases */
ok(pNetApiBufferReallocate(0, 1500, (LPVOID *) &p) == NERR_Success, "Reallocate with OldBuffer = NULL failed\n"); ok(pNetApiBufferReallocate(0, 1500, &p) == NERR_Success, "Reallocate with OldBuffer = NULL failed\n");
ok(p != NULL, "No memory got allocated\n"); ok(p != NULL, "No memory got allocated\n");
ok(pNetApiBufferAllocate(1024, (LPVOID *)&p) == NERR_Success, "Memory not reserved\n"); ok(pNetApiBufferAllocate(1024, &p) == NERR_Success, "Memory not reserved\n");
ok(pNetApiBufferReallocate(p, 0, (LPVOID *) &p) == NERR_Success, "Not freed\n"); ok(pNetApiBufferReallocate(p, 0, &p) == NERR_Success, "Not freed\n");
ok(p == NULL, "Pointer not cleared\n"); ok(p == NULL, "Pointer not cleared\n");
/* 0-length buffer */ /* 0-length buffer */
ok(pNetApiBufferAllocate(0, (LPVOID *)&p) == NERR_Success, ok(pNetApiBufferAllocate(0, &p) == NERR_Success,
"Reserved memory\n"); "Reserved memory\n");
ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size\n"); ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size\n");
ok(dwSize < 0xFFFFFFFF, "The size of the 0-length buffer\n"); ok(dwSize < 0xFFFFFFFF, "The size of the 0-length buffer\n");
......
...@@ -157,8 +157,7 @@ static BOOL WkstaEnumAdaptersCallback(UCHAR totalLANAs, UCHAR lanaIndex, ...@@ -157,8 +157,7 @@ static BOOL WkstaEnumAdaptersCallback(UCHAR totalLANAs, UCHAR lanaIndex,
ULONG transport, const NetBIOSAdapterImpl *data, void *closure) ULONG transport, const NetBIOSAdapterImpl *data, void *closure)
{ {
BOOL ret; BOOL ret;
struct WkstaTransportEnumData *enumData = (struct WkstaTransportEnumData *) struct WkstaTransportEnumData *enumData = closure;
closure;
if (enumData && enumData->pbuf) if (enumData && enumData->pbuf)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment