Module: wine Branch: master Commit: d7bd274eed6cf0b4e11ff82296032166878983bc URL: http://source.winehq.org/git/wine.git/?a=commit;h=d7bd274eed6cf0b4e11ff82296...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Oct 1 13:36:03 2010 +0200
crypt32/tests: Make some variables static.
---
dlls/crypt32/tests/base64.c | 19 +++++++------------ dlls/crypt32/tests/encode.c | 4 ++-- dlls/crypt32/tests/main.c | 2 +- dlls/crypt32/tests/str.c | 8 ++++---- 4 files changed, 14 insertions(+), 19 deletions(-)
diff --git a/dlls/crypt32/tests/base64.c b/dlls/crypt32/tests/base64.c index 5a260ed..dd85be4 100644 --- a/dlls/crypt32/tests/base64.c +++ b/dlls/crypt32/tests/base64.c @@ -40,15 +40,12 @@ #define X509_HEADER_NOCR "-----BEGIN X509 CRL-----\n" #define X509_TRAILER_NOCR "-----END X509 CRL-----\n"
-typedef BOOL (WINAPI *CryptBinaryToStringAFunc)(const BYTE *pbBinary, +static BOOL (WINAPI *pCryptBinaryToStringA)(const BYTE *pbBinary, DWORD cbBinary, DWORD dwFlags, LPSTR pszString, DWORD *pcchString); -typedef BOOL (WINAPI *CryptStringToBinaryAFunc)(LPCSTR pszString, +static BOOL (WINAPI *pCryptStringToBinaryA)(LPCSTR pszString, DWORD cchString, DWORD dwFlags, BYTE *pbBinary, DWORD *pcbBinary, DWORD *pdwSkip, DWORD *pdwFlags);
-CryptBinaryToStringAFunc pCryptBinaryToStringA; -CryptStringToBinaryAFunc pCryptStringToBinaryA; - struct BinTests { const BYTE *toEncode; @@ -64,7 +61,7 @@ static const BYTE toEncode4[] = "abcdefghijlkmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890" "abcdefghijlkmnopqrstuvwxyz01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890";
-struct BinTests tests[] = { +static const struct BinTests tests[] = { { toEncode1, sizeof(toEncode1), "AA==\r\n", }, { toEncode2, sizeof(toEncode2), "AQI=\r\n", }, /* { toEncode3, sizeof(toEncode3), "AQID\r\n", }, This test fails on Vista. */ @@ -76,7 +73,7 @@ struct BinTests tests[] = { "SElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NTY3ODkwAA==\r\n" }, };
-struct BinTests testsNoCR[] = { +static const struct BinTests testsNoCR[] = { { toEncode1, sizeof(toEncode1), "AA==\n", }, { toEncode2, sizeof(toEncode2), "AQI=\n", }, /* { toEncode3, sizeof(toEncode3), "AQID\n", }, This test fails on Vista. */ @@ -306,7 +303,7 @@ struct BadString DWORD format; };
-struct BadString badStrings[] = { +static const struct BadString badStrings[] = { { "A\r\nA\r\n=\r\n=\r\n", CRYPT_STRING_BASE64 }, { "AA\r\n=\r\n=\r\n", CRYPT_STRING_BASE64 }, { "AA=\r\n=\r\n", CRYPT_STRING_BASE64 }, @@ -441,10 +438,8 @@ START_TEST(base64) { HMODULE lib = GetModuleHandleA("crypt32");
- pCryptBinaryToStringA = (CryptBinaryToStringAFunc)GetProcAddress(lib, - "CryptBinaryToStringA"); - pCryptStringToBinaryA = (CryptStringToBinaryAFunc)GetProcAddress(lib, - "CryptStringToBinaryA"); + pCryptBinaryToStringA = (void *)GetProcAddress(lib, "CryptBinaryToStringA"); + pCryptStringToBinaryA = (void *)GetProcAddress(lib, "CryptStringToBinaryA");
if (pCryptBinaryToStringA) testBinaryToStringA(); diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c index cc59a59..214e170 100644 --- a/dlls/crypt32/tests/encode.c +++ b/dlls/crypt32/tests/encode.c @@ -2356,7 +2356,7 @@ struct EncodedRSAPubKey size_t decodedModulusLen; };
-struct EncodedRSAPubKey rsaPubKeys[] = { +static const struct EncodedRSAPubKey rsaPubKeys[] = { { modulus1, sizeof(modulus1), mod1_encoded, sizeof(modulus1) }, { modulus2, sizeof(modulus2), mod2_encoded, 5 }, { modulus3, sizeof(modulus3), mod3_encoded, 5 }, @@ -7137,7 +7137,7 @@ static CERT_GENERAL_SUBTREE IPAddressWithMinSubtree = { static CERT_GENERAL_SUBTREE IPAddressWithMinMaxSubtree = { { CERT_ALT_NAME_IP_ADDRESS, { 0 } }, 5, TRUE, 3 };
-struct EncodedNameConstraints encodedNameConstraints[] = { +static const struct EncodedNameConstraints encodedNameConstraints[] = { { { sizeof(emptySequence), (LPBYTE)emptySequence }, { 0 } }, { { sizeof(emptyDNSPermittedConstraints), emptyDNSPermittedConstraints }, { 1, &emptyDNSSubtree, 0, NULL } }, diff --git a/dlls/crypt32/tests/main.c b/dlls/crypt32/tests/main.c index 7c11e8e..410f9a9 100644 --- a/dlls/crypt32/tests/main.c +++ b/dlls/crypt32/tests/main.c @@ -28,7 +28,7 @@
#include "wine/test.h"
-HMODULE hCrypt; +static HMODULE hCrypt;
static void test_findAttribute(void) { diff --git a/dlls/crypt32/tests/str.c b/dlls/crypt32/tests/str.c index ebc3342..afc8544 100644 --- a/dlls/crypt32/tests/str.c +++ b/dlls/crypt32/tests/str.c @@ -191,7 +191,7 @@ typedef BOOL (WINAPI *CertStrToNameWFunc)(DWORD dwCertEncodingType, LPCWSTR pszX500, DWORD dwStrType, void *pvReserved, BYTE *pbEncoded, DWORD *pcbEncoded, LPCWSTR *ppszError);
-HMODULE dll; +static HMODULE dll; static CertNameToStrAFunc pCertNameToStrA; static CertNameToStrWFunc pCertNameToStrW; static CryptDecodeObjectFunc pCryptDecodeObject; @@ -470,7 +470,7 @@ struct StrToNameA const BYTE *encoded; };
-const BYTE encodedSimpleCN[] = { +static const BYTE encodedSimpleCN[] = { 0x30,0x0c,0x31,0x0a,0x30,0x08,0x06,0x03,0x55,0x04,0x03,0x13,0x01,0x31 }; static const BYTE encodedSingleQuotedCN[] = { 0x30,0x0e,0x31,0x0c,0x30,0x0a, 0x06,0x03,0x55,0x04,0x03,0x13,0x03,0x27,0x31,0x27 }; @@ -481,7 +481,7 @@ static const BYTE encodedQuotedCN[] = { 0x30,0x11,0x31,0x0f,0x30,0x0d,0x06,0x03, static const BYTE encodedMultipleAttrCN[] = { 0x30,0x0e,0x31,0x0c,0x30,0x0a, 0x06,0x03,0x55,0x04,0x03,0x13,0x03,0x31,0x2b,0x32 };
-struct StrToNameA namesA[] = { +static const struct StrToNameA namesA[] = { { "CN=1", sizeof(encodedSimpleCN), encodedSimpleCN }, { "CN="1"", sizeof(encodedSimpleCN), encodedSimpleCN }, { "CN = "1"", sizeof(encodedSimpleCN), encodedSimpleCN }, @@ -562,7 +562,7 @@ static const WCHAR japaneseCN_W[] = { 'C','N','=',0x226f,0x575b,0 }; static const BYTE encodedJapaneseCN[] = { 0x30,0x0f,0x31,0x0d,0x30,0x0b,0x06, 0x03,0x55,0x04,0x03,0x1e,0x04,0x22,0x6f,0x57,0x5b };
-struct StrToNameW namesW[] = { +static const struct StrToNameW namesW[] = { { simpleCN_W, sizeof(encodedSimpleCN), encodedSimpleCN }, { simpleCN2_W, sizeof(encodedSimpleCN), encodedSimpleCN }, { simpleCN3_W, sizeof(encodedSimpleCN), encodedSimpleCN },