netapi32: Remove superfluous pointer casts.

oldstable
Michael Stefaniuc 2009-03-05 09:39:01 +01:00 committed by Alexandre Julliard
parent 258d953a3f
commit a8510589c3
5 changed files with 24 additions and 26 deletions

View File

@ -658,7 +658,7 @@ NetQueryDisplayInformation(
admin_size - sizeof(NET_DISPLAY_USER) +
guest_size - sizeof(NET_DISPLAY_USER),
SortedBuffer);
inf = (PNET_DISPLAY_USER) *SortedBuffer;
inf = *SortedBuffer;
str = (LPWSTR) ((PBYTE) inf + sizeof(NET_DISPLAY_USER) * records);
inf->usri1_name = str;
str = (LPWSTR) (
@ -826,8 +826,7 @@ NET_API_STATUS WINAPI NetUserModalsGet(
}
umi = (USER_MODALS_INFO_2 *) *pbuffer;
umi->usrmod2_domain_id = (PSID)(*pbuffer +
sizeof(USER_MODALS_INFO_2));
umi->usrmod2_domain_id = *pbuffer + sizeof(USER_MODALS_INFO_2);
umi->usrmod2_domain_name = (LPWSTR)(*pbuffer +
sizeof(USER_MODALS_INFO_2) + GetLengthSid(domainIdentifier));

View File

@ -400,7 +400,7 @@ typedef struct _NetBTNameQueryData {
static BOOL NetBTFindNameAnswerCallback(void *pVoid, WORD answerCount,
WORD answerIndex, PUCHAR rData, WORD rLen)
{
NetBTNameQueryData *queryData = (NetBTNameQueryData *)pVoid;
NetBTNameQueryData *queryData = pVoid;
BOOL ret;
if (queryData)
@ -696,7 +696,7 @@ typedef struct _NetBTNodeQueryData
static BOOL NetBTNodeStatusAnswerCallback(void *pVoid, WORD answerCount,
WORD answerIndex, PUCHAR rData, WORD rLen)
{
NetBTNodeQueryData *data = (NetBTNodeQueryData *)pVoid;
NetBTNodeQueryData *data = pVoid;
if (data && !data->gotResponse && rData && rLen >= 1)
{
@ -811,7 +811,7 @@ static UCHAR NetBTAstatRemote(NetBTAdapter *adapter, PNCB ncb)
static UCHAR NetBTAstat(void *adapt, PNCB ncb)
{
NetBTAdapter *adapter = (NetBTAdapter *)adapt;
NetBTAdapter *adapter = adapt;
UCHAR ret;
TRACE("adapt %p, NCB %p\n", adapt, ncb);
@ -856,7 +856,7 @@ static UCHAR NetBTAstat(void *adapt, PNCB ncb)
static UCHAR NetBTFindName(void *adapt, PNCB ncb)
{
NetBTAdapter *adapter = (NetBTAdapter *)adapt;
NetBTAdapter *adapter = adapt;
UCHAR ret;
const NBNameCacheEntry *cacheEntry = NULL;
PFIND_NAME_HEADER foundName;
@ -973,7 +973,7 @@ static UCHAR NetBTSessionReq(SOCKET fd, const UCHAR *calledName,
static UCHAR NetBTCall(void *adapt, PNCB ncb, void **sess)
{
NetBTAdapter *adapter = (NetBTAdapter *)adapt;
NetBTAdapter *adapter = adapt;
UCHAR ret;
const NBNameCacheEntry *cacheEntry = NULL;
@ -1074,8 +1074,8 @@ static UCHAR NetBTCall(void *adapt, PNCB ncb, void **sess)
*/
static UCHAR NetBTSend(void *adapt, void *sess, PNCB ncb)
{
NetBTAdapter *adapter = (NetBTAdapter *)adapt;
NetBTSession *session = (NetBTSession *)sess;
NetBTAdapter *adapter = adapt;
NetBTSession *session = sess;
UCHAR buffer[NBSS_HDRSIZE], ret;
int r;
WSABUF wsaBufs[2];
@ -1123,8 +1123,8 @@ static UCHAR NetBTSend(void *adapt, void *sess, PNCB ncb)
static UCHAR NetBTRecv(void *adapt, void *sess, PNCB ncb)
{
NetBTAdapter *adapter = (NetBTAdapter *)adapt;
NetBTSession *session = (NetBTSession *)sess;
NetBTAdapter *adapter = adapt;
NetBTSession *session = sess;
UCHAR buffer[NBSS_HDRSIZE], ret;
int r;
WSABUF wsaBufs[2];
@ -1231,7 +1231,7 @@ error:
static UCHAR NetBTHangup(void *adapt, void *sess)
{
NetBTSession *session = (NetBTSession *)sess;
NetBTSession *session = sess;
TRACE("adapt %p, session %p\n", adapt, session);
@ -1255,7 +1255,7 @@ static void NetBTCleanupAdapter(void *adapt)
TRACE("adapt %p\n", adapt);
if (adapt)
{
NetBTAdapter *adapter = (NetBTAdapter *)adapt;
NetBTAdapter *adapter = adapt;
if (adapter->nameCache)
NBNameCacheDestroy(adapter->nameCache);
@ -1310,7 +1310,7 @@ static BOOL NetBTEnumCallback(UCHAR totalLANAs, UCHAR lanaIndex,
ULONG transport, const NetBIOSAdapterImpl *data, void *closure)
{
BOOL ret;
PMIB_IPADDRTABLE table = (PMIB_IPADDRTABLE)closure;
PMIB_IPADDRTABLE table = closure;
if (table && data)
{
@ -1319,7 +1319,7 @@ static BOOL NetBTEnumCallback(UCHAR totalLANAs, UCHAR lanaIndex,
ret = FALSE;
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)
{

View File

@ -762,7 +762,7 @@ static UCHAR nbDispatch(NetBIOSAdapter *adapter, PNCB ncb)
static DWORD WINAPI nbCmdThread(LPVOID lpVoid)
{
PNCB ncb = (PNCB)lpVoid;
PNCB ncb = lpVoid;
if (ncb)
{

View File

@ -42,12 +42,12 @@ static void run_apibuf_tests(void)
NET_API_STATUS res;
/* test normal logic */
ok(pNetApiBufferAllocate(1024, (LPVOID *)&p) == NERR_Success,
ok(pNetApiBufferAllocate(1024, &p) == NERR_Success,
"Reserved memory\n");
ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size\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");
ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size\n");
ok(dwSize >= 1500, "The size is correct\n");
@ -58,14 +58,14 @@ static void run_apibuf_tests(void)
ok(pNetApiBufferSize(NULL, &dwSize) == ERROR_INVALID_PARAMETER, "Error for NULL pointer\n");
/* 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(pNetApiBufferAllocate(1024, (LPVOID *)&p) == NERR_Success, "Memory not reserved\n");
ok(pNetApiBufferReallocate(p, 0, (LPVOID *) &p) == NERR_Success, "Not freed\n");
ok(pNetApiBufferAllocate(1024, &p) == NERR_Success, "Memory not reserved\n");
ok(pNetApiBufferReallocate(p, 0, &p) == NERR_Success, "Not freed\n");
ok(p == NULL, "Pointer not cleared\n");
/* 0-length buffer */
ok(pNetApiBufferAllocate(0, (LPVOID *)&p) == NERR_Success,
ok(pNetApiBufferAllocate(0, &p) == NERR_Success,
"Reserved memory\n");
ok(pNetApiBufferSize(p, &dwSize) == NERR_Success, "Got size\n");
ok(dwSize < 0xFFFFFFFF, "The size of the 0-length buffer\n");

View File

@ -157,8 +157,7 @@ static BOOL WkstaEnumAdaptersCallback(UCHAR totalLANAs, UCHAR lanaIndex,
ULONG transport, const NetBIOSAdapterImpl *data, void *closure)
{
BOOL ret;
struct WkstaTransportEnumData *enumData = (struct WkstaTransportEnumData *)
closure;
struct WkstaTransportEnumData *enumData = closure;
if (enumData && enumData->pbuf)
{