From 2fc7b8100973408a0508156fc1bcce8c4e503290 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Tue, 13 Jan 2009 10:57:53 +0100 Subject: [PATCH] advapi32/tests: Remove superfluous pointer casts. --- dlls/advapi32/tests/crypt.c | 12 ++++++------ dlls/advapi32/tests/crypt_lmhash.c | 2 +- dlls/advapi32/tests/crypt_md4.c | 2 +- dlls/advapi32/tests/crypt_md5.c | 2 +- dlls/advapi32/tests/security.c | 16 ++++++++-------- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/dlls/advapi32/tests/crypt.c b/dlls/advapi32/tests/crypt.c index 44d08966c16..5a5b26e004f 100644 --- a/dlls/advapi32/tests/crypt.c +++ b/dlls/advapi32/tests/crypt.c @@ -461,8 +461,8 @@ static BOOL FindProvRegVals(DWORD dwIndex, DWORD *pdwProvType, LPSTR *pszProvNam RegQueryInfoKey(hKey, NULL, NULL, NULL, pdwProvCount, pcbProvName, NULL, NULL, NULL, NULL, NULL, NULL); (*pcbProvName)++; - - if (!(*pszProvName = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, *pcbProvName)))) + + if (!(*pszProvName = LocalAlloc(LMEM_ZEROINIT, *pcbProvName))) return FALSE; RegEnumKeyEx(hKey, dwIndex, *pszProvName, pcbProvName, NULL, NULL, NULL, NULL); @@ -518,7 +518,7 @@ static void test_enum_providers(void) /* alloc provider to half the size required * cbName holds the size required */ providerLen = cbName / 2; - if (!(provider = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, providerLen)))) + if (!(provider = LocalAlloc(LMEM_ZEROINIT, providerLen))) return; result = pCryptEnumProvidersA(dwIndex, NULL, 0, &type, provider, &providerLen); @@ -546,7 +546,7 @@ static void test_enum_providers(void) /* check expected versus actual values returned */ result = pCryptEnumProvidersA(dwIndex, NULL, 0, &type, NULL, &providerLen); ok(result && providerLen==cbName, "expected %i, got %i\n", (int)cbName, (int)providerLen); - if (!(provider = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, providerLen)))) + if (!(provider = LocalAlloc(LMEM_ZEROINIT, providerLen))) return; providerLen = 0xdeadbeef; @@ -670,7 +670,7 @@ static void test_enum_provider_types(void) /* alloc provider type to half the size required * cbTypeName holds the size required */ typeNameSize = cbTypeName / 2; - if (!(typeName = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, typeNameSize)))) + if (!(typeName = LocalAlloc(LMEM_ZEROINIT, typeNameSize))) goto cleanup; SetLastError(0xdeadbeef); @@ -700,7 +700,7 @@ static void test_enum_provider_types(void) /* check expected versus actual values returned */ result = pCryptEnumProviderTypesA(index, NULL, 0, &provType, NULL, &typeNameSize); ok(result && typeNameSize==cbTypeName, "expected %d, got %d\n", cbTypeName, typeNameSize); - if (!(typeName = ((LPSTR)LocalAlloc(LMEM_ZEROINIT, typeNameSize)))) + if (!(typeName = LocalAlloc(LMEM_ZEROINIT, typeNameSize))) goto cleanup; typeNameSize = 0xdeadbeef; diff --git a/dlls/advapi32/tests/crypt_lmhash.c b/dlls/advapi32/tests/crypt_lmhash.c index 63ab2c0da4d..df1d3a73b6b 100644 --- a/dlls/advapi32/tests/crypt_lmhash.c +++ b/dlls/advapi32/tests/crypt_lmhash.c @@ -259,7 +259,7 @@ static void test_SystemFunction004(void) key.Length = 0x100; key.MaximumLength = 0x100; - r = pSystemFunction004(&in, &key, (struct ustring *)&out); + r = pSystemFunction004(&in, &key, &out); ok(r == STATUS_BUFFER_TOO_SMALL, "function failed\n"); in.Buffer = inbuf; diff --git a/dlls/advapi32/tests/crypt_md4.c b/dlls/advapi32/tests/crypt_md4.c index 15a594bf904..02e4c02b192 100644 --- a/dlls/advapi32/tests/crypt_md4.c +++ b/dlls/advapi32/tests/crypt_md4.c @@ -49,7 +49,7 @@ fnSystemFunction007 pSystemFunction007; md4hashfunc pSystemFunction010; md4hashfunc pSystemFunction011; -#define ctxcmp( a, b ) memcmp( (char*)a, (char*)b, FIELD_OFFSET( MD4_CTX, in ) ) +#define ctxcmp( a, b ) memcmp( a, b, FIELD_OFFSET( MD4_CTX, in ) ) static void test_md4_ctx(void) { diff --git a/dlls/advapi32/tests/crypt_md5.c b/dlls/advapi32/tests/crypt_md5.c index 23d7d6bdcaa..4c6346cba44 100644 --- a/dlls/advapi32/tests/crypt_md5.c +++ b/dlls/advapi32/tests/crypt_md5.c @@ -41,7 +41,7 @@ fnMD5Init pMD5Init; fnMD5Update pMD5Update; fnMD5Final pMD5Final; -#define ctxcmp( a, b ) memcmp( (char*)a, (char*)b, FIELD_OFFSET( MD5_CTX, in ) ) +#define ctxcmp( a, b ) memcmp( a, b, FIELD_OFFSET( MD5_CTX, in ) ) static void test_md5_ctx(void) { diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 0eccbaae96a..8682cc9bf2f 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -240,7 +240,7 @@ static void test_sid(void) GetLastError() ); ok(pConvertStringSidToSidA("S-1-5-21-93476-23408-4576", &psid), "ConvertStringSidToSidA failed\n"); - pisid = (SID *)psid; + pisid = psid; ok(pisid->SubAuthorityCount == 4, "Invalid sub authority count - expected 4, got %d\n", pisid->SubAuthorityCount); ok(pisid->SubAuthority[0] == 21, "Invalid subauthority 0 - expceted 21, got %d\n", pisid->SubAuthority[0]); ok(pisid->SubAuthority[3] == 4576, "Invalid subauthority 0 - expceted 4576, got %d\n", pisid->SubAuthority[3]); @@ -266,7 +266,7 @@ static void test_sid(void) r = pConvertStringSidToSidA( refs[i].refStr, &psid ); ok( r, "failed to parse sid string\n" ); - pisid = (PISID)psid; + pisid = psid; ok( pisid && !memcmp( pisid->IdentifierAuthority.Value, refs[i].auth.Value, sizeof(refs[i].auth) ), @@ -373,7 +373,7 @@ static void test_trustee(void) "MultipleTrusteeOperation wrong\n"); ok( trustee.TrusteeForm == TRUSTEE_IS_SID, "TrusteeForm wrong\n"); ok( trustee.TrusteeType == TRUSTEE_IS_UNKNOWN, "TrusteeType wrong\n"); - ok( trustee.ptstrName == (LPSTR) psid, "ptstrName wrong\n" ); + ok( trustee.ptstrName == psid, "ptstrName wrong\n" ); /* test BuildTrusteeWithObjectsAndSidA (test 1) */ memset( &trustee, 0xff, sizeof trustee ); @@ -2215,7 +2215,7 @@ static void test_SetEntriesInAcl(void) ExplicitAccess.Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE; ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_IS_SID; ExplicitAccess.Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN; - ExplicitAccess.Trustee.ptstrName = (LPWSTR)EveryoneSid; + ExplicitAccess.Trustee.ptstrName = EveryoneSid; res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl); ok(res == ERROR_SUCCESS, "SetEntriesInAclW failed: %u\n", res); ok(NewAcl != NULL, "returned acl was NULL\n"); @@ -2263,7 +2263,7 @@ static void test_SetEntriesInAcl(void) ExplicitAccess.grfAccessMode = REVOKE_ACCESS; ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_IS_SID; - ExplicitAccess.Trustee.ptstrName = (LPWSTR)UsersSid; + ExplicitAccess.Trustee.ptstrName = UsersSid; res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl); ok(res == ERROR_SUCCESS, "SetEntriesInAclW failed: %u\n", res); ok(NewAcl != NULL, "returned acl was NULL\n"); @@ -2508,17 +2508,17 @@ static void test_ConvertSecurityDescriptorToString() size = 4096; pCreateWellKnownSid(WinLocalSid, NULL, sid_buf, &size); - SetSecurityDescriptorOwner(&desc, (PSID)sid_buf, FALSE); + SetSecurityDescriptorOwner(&desc, sid_buf, FALSE); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n"); CHECK_RESULT_AND_FREE("O:S-1-2-0"); - SetSecurityDescriptorOwner(&desc, (PSID)sid_buf, TRUE); + SetSecurityDescriptorOwner(&desc, sid_buf, TRUE); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n"); CHECK_RESULT_AND_FREE("O:S-1-2-0"); size = sizeof(sid_buf); pCreateWellKnownSid(WinLocalSystemSid, NULL, sid_buf, &size); - SetSecurityDescriptorOwner(&desc, (PSID)sid_buf, TRUE); + SetSecurityDescriptorOwner(&desc, sid_buf, TRUE); ok(pConvertSecurityDescriptorToStringSecurityDescriptorA(&desc, SDDL_REVISION_1, sec_info, &string, &len), "Conversion failed\n"); CHECK_RESULT_AND_FREE("O:SY");