Commit dd073bbb authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Cast the GetProcAddress() return value to avoid warnings about the

function pointer being of the wrong type. Fix assorted signed/unsigned comparison warnings.
parent e84f07de
......@@ -224,7 +224,7 @@ static void test_allocateLuid(void)
LUID luid1, luid2;
BOOL ret;
pAllocateLocallyUniqueId = GetProcAddress(hmod, "AllocateLocallyUniqueId");
pAllocateLocallyUniqueId = (void*)GetProcAddress(hmod, "AllocateLocallyUniqueId");
if (!pAllocateLocallyUniqueId) return;
ret = pAllocateLocallyUniqueId(&luid1);
......@@ -256,7 +256,7 @@ static void test_lookupPrivilegeName(void)
BOOL ret;
/* check whether it's available first */
pLookupPrivilegeNameA = GetProcAddress(hmod, "LookupPrivilegeNameA");
pLookupPrivilegeNameA = (void*)GetProcAddress(hmod, "LookupPrivilegeNameA");
if (!pLookupPrivilegeNameA) return;
luid.LowPart = SE_CREATE_TOKEN_PRIVILEGE;
ret = pLookupPrivilegeNameA(NULL, &luid, buf, &cchName);
......@@ -309,7 +309,7 @@ static void test_lookupPrivilegeName(void)
struct NameToLUID
{
const char *name;
LONG lowPart;
DWORD lowPart;
};
static void test_lookupPrivilegeValue(void)
......@@ -351,7 +351,7 @@ static void test_lookupPrivilegeValue(void)
BOOL ret;
/* check whether it's available first */
pLookupPrivilegeValueA = GetProcAddress(hmod, "LookupPrivilegeValueA");
pLookupPrivilegeValueA = (void*)GetProcAddress(hmod, "LookupPrivilegeValueA");
if (!pLookupPrivilegeValueA) return;
ret = pLookupPrivilegeValueA(NULL, "SeCreateTokenPrivilege", &luid);
if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
......
......@@ -259,8 +259,7 @@ static const unsigned char MF_PATTERN_BRUSH_BITS[] = {
static void dump_mf_bits (const HMETAFILE mf, const char *desc)
{
char buf[MF_BUFSIZE];
UINT mfsize;
int i;
UINT mfsize, i;
mfsize = GetMetaFileBitsEx (mf, MF_BUFSIZE, buf);
ok (mfsize > 0, "%s: GetMetaFileBitsEx failed.\n", desc);
......@@ -286,12 +285,12 @@ static void dump_mf_bits (const HMETAFILE mf, const char *desc)
* otherwise returns the number of non-matching bytes.
*/
static int compare_mf_bits (const HMETAFILE mf, const char *bits, int bsize,
static int compare_mf_bits (const HMETAFILE mf, const char *bits, UINT bsize,
const char *desc)
{
char buf[MF_BUFSIZE];
UINT mfsize;
int i, diff;
UINT mfsize, i;
int diff;
mfsize = GetMetaFileBitsEx (mf, MF_BUFSIZE, buf);
ok (mfsize > 0, "%s: GetMetaFileBitsEx failed.\n", desc);
......
......@@ -51,7 +51,7 @@ static void test_multibyte_to_unicode_translations(IMultiLanguage2 *iML2)
WCHAR stringW[] = {'J','u','s','t',' ','a',' ','t','e','s','t',' ','s','t','r','i','n','g',0};
char bufA[256];
WCHAR bufW[256];
UINT lenA, lenW, expected_len;
int lenA, lenW, expected_len;
HRESULT ret;
HMODULE hMlang;
FARPROC pConvertINetMultiByteToUnicode;
......@@ -105,7 +105,7 @@ static void test_multibyte_to_unicode_translations(IMultiLanguage2 *iML2)
ret = IMultiLanguage2_ConvertStringToUnicode(iML2, NULL, CP_UNICODE, stringA, &lenA, bufW, &lenW);
ok(ret == S_OK, "IMultiLanguage2_ConvertStringToUnicode failed: %08lx\n", ret);
ok(lenA == lstrlenA(stringA), "expected lenA %u, got %u\n", lstrlenA(stringA), lenA);
ok(lenW == lstrlenW(stringW)/sizeof(WCHAR), "expected lenW %u, got %u\n", lstrlenW(stringW)/sizeof(WCHAR), lenW);
ok(lenW == lstrlenW(stringW)/(int)sizeof(WCHAR), "expected lenW %u, got %u\n", lstrlenW(stringW)/sizeof(WCHAR), lenW);
ok(bufW[lenW] != 0, "buf should not be 0 terminated\n");
bufW[lenW] = 0; /* -1 doesn't include 0 terminator */
ok(!lstrcmpA((LPCSTR)bufW, stringA), "bufW/stringA mismatch\n");
......@@ -176,7 +176,7 @@ static void test_multibyte_to_unicode_translations(IMultiLanguage2 *iML2)
TRACE_2("Call IMultiLanguage2_ConvertStringFromUnicode\n");
ret = IMultiLanguage2_ConvertStringFromUnicode(iML2, NULL, CP_UNICODE, stringW, &lenW, bufA, &lenA);
ok(ret == S_OK, "IMultiLanguage2_ConvertStringFromUnicode failed: %08lx\n", ret);
ok(lenA == lstrlenA(stringA) * sizeof(WCHAR), "expected lenA %u, got %u\n", lstrlenA(stringA) * sizeof(WCHAR), lenA);
ok(lenA == lstrlenA(stringA) * (int)sizeof(WCHAR), "expected lenA %u, got %u\n", lstrlenA(stringA) * sizeof(WCHAR), lenA);
ok(lenW == lstrlenW(stringW), "expected lenW %u, got %u\n", lstrlenW(stringW), lenW);
ok(bufA[lenA] != 0 && bufA[lenA+1] != 0, "buf should not be 0 terminated\n");
bufA[lenA] = 0; /* -1 doesn't include 0 terminator */
......
......@@ -71,7 +71,7 @@ static void test_fileops( void )
ok(feof(file) !=0,"feof doesn't signal EOF\n");
rewind(file);
ok(fgets(buffer,strlen(outbuffer),file) !=0,"fgets failed unexpected\n");
ok(lstrlenA(buffer) == strlen(outbuffer) -1,"fgets didn't read right size\n");
ok(lstrlenA(buffer) == lstrlenA(outbuffer) -1,"fgets didn't read right size\n");
ok(fgets(buffer,sizeof(outbuffer),file) !=0,"fgets failed unexpected\n");
ok(strlen(buffer) == 1,"fgets dropped chars\n");
ok(buffer[0] == outbuffer[strlen(outbuffer)-1],"fgets exchanged chars\n");
......@@ -83,7 +83,7 @@ static void test_fileops( void )
ok(feof(file) !=0,"feof doesn't signal EOF\n");
rewind(file);
ok(fgetws(wbuffer,strlen(outbuffer),file) !=0,"fgetws failed unexpected\n");
ok(lstrlenW(wbuffer) == (strlen(outbuffer) -1),"fgetws didn't read right size\n");
ok(lstrlenW(wbuffer) == (lstrlenA(outbuffer) -1),"fgetws didn't read right size\n");
ok(fgetws(wbuffer,sizeof(outbuffer),file) !=0,"fgets failed unexpected\n");
ok(lstrlenW(wbuffer) == 1,"fgets dropped chars\n");
fclose (file);
......
......@@ -35,7 +35,7 @@ static void test_RtlDetermineDosPathNameType(void)
struct test
{
const char *path;
int ret;
UINT ret;
};
static const struct test tests[] =
......@@ -255,7 +255,7 @@ static void test_RtlGetFullPathName_U()
ULONG ret;
WCHAR *file_part;
DWORD reslen;
int len;
UINT len;
for (test = tests; test->path; test++)
{
......
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