Fix gcc 4.0 warnings.

This commit is contained in:
Mike McCormack 2005-09-07 11:31:17 +00:00 committed by Alexandre Julliard
parent 5d7f7f56be
commit dc1c62a592
7 changed files with 79 additions and 36 deletions

View File

@ -900,8 +900,8 @@ BOOL PRINTDLG_ChangePrinterA(HWND hDlg, char *name,
dmSize = DocumentPropertiesA(0, 0, name, PrintStructures->lpDevMode, NULL, dmSize = DocumentPropertiesA(0, 0, name, PrintStructures->lpDevMode, NULL,
DM_OUT_BUFFER); DM_OUT_BUFFER);
if(lppd->hDevMode && (lpdm = GlobalLock(lppd->hDevMode)) && if(lppd->hDevMode && (lpdm = GlobalLock(lppd->hDevMode)) &&
!lstrcmpA(lpdm->dmDeviceName, !lstrcmpA( (LPSTR) lpdm->dmDeviceName,
PrintStructures->lpDevMode->dmDeviceName)) { (LPSTR) PrintStructures->lpDevMode->dmDeviceName)) {
/* Supplied devicemode matches current printer so try to use it */ /* Supplied devicemode matches current printer so try to use it */
DocumentPropertiesA(0, 0, name, PrintStructures->lpDevMode, lpdm, DocumentPropertiesA(0, 0, name, PrintStructures->lpDevMode, lpdm,
DM_OUT_BUFFER | DM_IN_BUFFER); DM_OUT_BUFFER | DM_IN_BUFFER);

View File

@ -335,12 +335,15 @@ static void test_decodeInt(DWORD dwEncoding)
"Expected STATUS_ACCESS_VIOLATION, got %08lx\n", GetLastError()); "Expected STATUS_ACCESS_VIOLATION, got %08lx\n", GetLastError());
} }
static const BYTE bin18[] = {0x0a,0x01,0x01,0};
static const BYTE bin19[] = {0x0a,0x05,0x00,0xff,0xff,0xff,0x80,0};
/* These are always encoded unsigned, and aren't constrained to be any /* These are always encoded unsigned, and aren't constrained to be any
* particular value * particular value
*/ */
static const struct encodedInt enums[] = { static const struct encodedInt enums[] = {
{ 1, "\x0a\x01\x01" }, { 1, bin18 },
{ -128, "\x0a\x05\x00\xff\xff\xff\x80" }, { -128, bin19 },
}; };
/* X509_CRL_REASON_CODE is also an enumerated type, but it's #defined to /* X509_CRL_REASON_CODE is also an enumerated type, but it's #defined to
@ -478,10 +481,17 @@ static void testTimeDecoding(DWORD dwEncoding, LPCSTR structType,
"Expected CRYPT_E_ASN1_BADTAG, got 0x%08lx\n", GetLastError()); "Expected CRYPT_E_ASN1_BADTAG, got 0x%08lx\n", GetLastError());
} }
static const BYTE bin20[] = {
0x17,0x0d,'0','5','0','6','0','6','1','6','1','0','0','0','Z',0};
static const BYTE bin21[] = {
0x18,0x0f,'1','9','4','5','0','6','0','6','1','6','1','0','0','0','Z',0};
static const BYTE bin22[] = {
0x18,0x0f,'2','1','4','5','0','6','0','6','1','6','1','0','0','0','Z',0};
static const struct encodedFiletime times[] = { static const struct encodedFiletime times[] = {
{ { 2005, 6, 1, 6, 16, 10, 0, 0 }, "\x17" "\x0d" "050606161000Z" }, { { 2005, 6, 1, 6, 16, 10, 0, 0 }, bin20 },
{ { 1945, 6, 1, 6, 16, 10, 0, 0 }, "\x18" "\x0f" "19450606161000Z" }, { { 1945, 6, 1, 6, 16, 10, 0, 0 }, bin21 },
{ { 2145, 6, 1, 6, 16, 10, 0, 0 }, "\x18" "\x0f" "21450606161000Z" }, { { 2145, 6, 1, 6, 16, 10, 0, 0 }, bin22 },
}; };
static void test_encodeFiletime(DWORD dwEncoding) static void test_encodeFiletime(DWORD dwEncoding)
@ -496,33 +506,66 @@ static void test_encodeFiletime(DWORD dwEncoding)
} }
} }
static const BYTE bin23[] = {
0x18,0x13,'1','9','4','5','0','6','0','6','1','6','1','0','0','0','.','0','0','0','Z',0};
static const BYTE bin24[] = {
0x18,0x13,'1','9','4','5','0','6','0','6','1','6','1','0','0','0','.','9','9','9','Z',0};
static const BYTE bin25[] = {
0x18,0x13,'1','9','4','5','0','6','0','6','1','6','1','0','0','0','+','0','1','0','0',0};
static const BYTE bin26[] = {
0x18,0x13,'1','9','4','5','0','6','0','6','1','6','1','0','0','0','-','0','1','0','0',0};
static const BYTE bin27[] = {
0x18,0x13,'1','9','4','5','0','6','0','6','1','6','1','0','0','0','-','0','1','1','5',0};
static const BYTE bin28[] = {
0x18,0x0a,'2','1','4','5','0','6','0','6','1','6',0};
static const BYTE bin29[] = {
0x17,0x0a,'4','5','0','6','0','6','1','6','1','0',0};
static const BYTE bin30[] = {
0x17,0x0b,'4','5','0','6','0','6','1','6','1','0','Z',0};
static const BYTE bin31[] = {
0x17,0x0d,'4','5','0','6','0','6','1','6','1','0','+','0','1',0};
static const BYTE bin32[] = {
0x17,0x0d,'4','5','0','6','0','6','1','6','1','0','-','0','1',0};
static const BYTE bin33[] = {
0x17,0x0f,'4','5','0','6','0','6','1','6','1','0','+','0','1','0','0',0};
static const BYTE bin34[] = {
0x17,0x0f,'4','5','0','6','0','6','1','6','1','0','-','0','1','0','0',0};
static const BYTE bin35[] = {
0x17,0x08, '4','5','0','6','0','6','1','6',0};
static const BYTE bin36[] = {
0x18,0x0f, 'a','a','a','a','a','a','a','a','a','a','a','a','a','a','Z',0};
static const BYTE bin37[] = {
0x18,0x04, '2','1','4','5',0};
static const BYTE bin38[] = {
0x18,0x08, '2','1','4','5','0','6','0','6',0};
static void test_decodeFiletime(DWORD dwEncoding) static void test_decodeFiletime(DWORD dwEncoding)
{ {
static const struct encodedFiletime otherTimes[] = { static const struct encodedFiletime otherTimes[] = {
{ { 1945, 6, 1, 6, 16, 10, 0, 0 }, "\x18" "\x13" "19450606161000.000Z" }, { { 1945, 6, 1, 6, 16, 10, 0, 0 }, bin23 },
{ { 1945, 6, 1, 6, 16, 10, 0, 999 }, "\x18" "\x13" "19450606161000.999Z" }, { { 1945, 6, 1, 6, 16, 10, 0, 999 }, bin24 },
{ { 1945, 6, 1, 6, 17, 10, 0, 0 }, "\x18" "\x13" "19450606161000+0100" }, { { 1945, 6, 1, 6, 17, 10, 0, 0 }, bin25 },
{ { 1945, 6, 1, 6, 15, 10, 0, 0 }, "\x18" "\x13" "19450606161000-0100" }, { { 1945, 6, 1, 6, 15, 10, 0, 0 }, bin26 },
{ { 1945, 6, 1, 6, 14, 55, 0, 0 }, "\x18" "\x13" "19450606161000-0115" }, { { 1945, 6, 1, 6, 14, 55, 0, 0 }, bin27 },
{ { 2145, 6, 1, 6, 16, 0, 0, 0 }, "\x18" "\x0a" "2145060616" }, { { 2145, 6, 1, 6, 16, 0, 0, 0 }, bin28 },
{ { 2045, 6, 1, 6, 16, 10, 0, 0 }, "\x17" "\x0a" "4506061610" }, { { 2045, 6, 1, 6, 16, 10, 0, 0 }, bin29 },
{ { 2045, 6, 1, 6, 16, 10, 0, 0 }, "\x17" "\x0b" "4506061610Z" }, { { 2045, 6, 1, 6, 16, 10, 0, 0 }, bin30 },
{ { 2045, 6, 1, 6, 17, 10, 0, 0 }, "\x17" "\x0d" "4506061610+01" }, { { 2045, 6, 1, 6, 17, 10, 0, 0 }, bin31 },
{ { 2045, 6, 1, 6, 15, 10, 0, 0 }, "\x17" "\x0d" "4506061610-01" }, { { 2045, 6, 1, 6, 15, 10, 0, 0 }, bin32 },
{ { 2045, 6, 1, 6, 17, 10, 0, 0 }, "\x17" "\x0f" "4506061610+0100" }, { { 2045, 6, 1, 6, 17, 10, 0, 0 }, bin33 },
{ { 2045, 6, 1, 6, 15, 10, 0, 0 }, "\x17" "\x0f" "4506061610-0100" }, { { 2045, 6, 1, 6, 15, 10, 0, 0 }, bin34 },
}; };
/* An oddball case that succeeds in Windows, but doesn't seem correct /* An oddball case that succeeds in Windows, but doesn't seem correct
{ { 2145, 6, 1, 2, 11, 31, 0, 0 }, "\x18" "\x13" "21450606161000-9999" }, { { 2145, 6, 1, 2, 11, 31, 0, 0 }, "\x18" "\x13" "21450606161000-9999" },
*/ */
static const char *bogusTimes[] = { static const unsigned char *bogusTimes[] = {
/* oddly, this succeeds on Windows, with year 2765 /* oddly, this succeeds on Windows, with year 2765
"\x18" "\x0f" "21r50606161000Z", "\x18" "\x0f" "21r50606161000Z",
*/ */
"\x17" "\x08" "45060616", bin35,
"\x18" "\x0f" "aaaaaaaaaaaaaaZ", bin36,
"\x18" "\x04" "2145", bin37,
"\x18" "\x08" "21450606", bin38,
}; };
DWORD i, size; DWORD i, size;
FILETIME ft1 = { 0 }, ft2 = { 0 }; FILETIME ft1 = { 0 }, ft2 = { 0 };

View File

@ -1407,7 +1407,7 @@ static HRESULT WINAPI fnIMultiLanguage_ConvertString(
UINT* pcDstSize) UINT* pcDstSize)
{ {
return ConvertINetString(pdwMode, dwSrcEncoding, dwDstEncoding, return ConvertINetString(pdwMode, dwSrcEncoding, dwDstEncoding,
pSrcStr, pcSrcSize, pDstStr, pcDstSize); (LPCSTR)pSrcStr, (LPINT)pcSrcSize, (LPSTR)pDstStr, (LPINT)pcDstSize);
} }
static HRESULT WINAPI fnIMultiLanguage_ConvertStringToUnicode( static HRESULT WINAPI fnIMultiLanguage_ConvertStringToUnicode(
@ -1420,7 +1420,7 @@ static HRESULT WINAPI fnIMultiLanguage_ConvertStringToUnicode(
UINT* pcDstSize) UINT* pcDstSize)
{ {
return ConvertINetMultiByteToUnicode(pdwMode, dwEncoding, return ConvertINetMultiByteToUnicode(pdwMode, dwEncoding,
pSrcStr, pcSrcSize, pDstStr, pcDstSize); (LPCSTR)pSrcStr, (LPINT)pcSrcSize, pDstStr, (LPINT)pcDstSize);
} }
static HRESULT WINAPI fnIMultiLanguage_ConvertStringFromUnicode( static HRESULT WINAPI fnIMultiLanguage_ConvertStringFromUnicode(
@ -1433,7 +1433,7 @@ static HRESULT WINAPI fnIMultiLanguage_ConvertStringFromUnicode(
UINT* pcDstSize) UINT* pcDstSize)
{ {
return ConvertINetUnicodeToMultiByte(pdwMode, dwEncoding, return ConvertINetUnicodeToMultiByte(pdwMode, dwEncoding,
pSrcStr, pcSrcSize, pDstStr, pcDstSize); pSrcStr, (LPINT)pcSrcSize, pDstStr, (LPINT)pcDstSize);
} }
static HRESULT WINAPI fnIMultiLanguage_ConvertStringReset( static HRESULT WINAPI fnIMultiLanguage_ConvertStringReset(
@ -1705,7 +1705,7 @@ static HRESULT WINAPI fnIMultiLanguage2_ConvertString(
UINT* pcDstSize) UINT* pcDstSize)
{ {
return ConvertINetString(pdwMode, dwSrcEncoding, dwDstEncoding, return ConvertINetString(pdwMode, dwSrcEncoding, dwDstEncoding,
pSrcStr, pcSrcSize, pDstStr, pcDstSize); (LPCSTR)pSrcStr, (LPINT)pcSrcSize, (LPSTR)pDstStr, (LPINT)pcDstSize);
} }
static HRESULT WINAPI fnIMultiLanguage2_ConvertStringToUnicode( static HRESULT WINAPI fnIMultiLanguage2_ConvertStringToUnicode(
@ -1718,7 +1718,7 @@ static HRESULT WINAPI fnIMultiLanguage2_ConvertStringToUnicode(
UINT* pcDstSize) UINT* pcDstSize)
{ {
return ConvertINetMultiByteToUnicode(pdwMode, dwEncoding, return ConvertINetMultiByteToUnicode(pdwMode, dwEncoding,
pSrcStr, pcSrcSize, pDstStr, pcDstSize); pSrcStr, (LPINT)pcSrcSize, pDstStr, (LPINT)pcDstSize);
} }
static HRESULT WINAPI fnIMultiLanguage2_ConvertStringFromUnicode( static HRESULT WINAPI fnIMultiLanguage2_ConvertStringFromUnicode(
@ -1731,7 +1731,7 @@ static HRESULT WINAPI fnIMultiLanguage2_ConvertStringFromUnicode(
UINT* pcDstSize) UINT* pcDstSize)
{ {
return ConvertINetUnicodeToMultiByte(pdwMode, dwEncoding, return ConvertINetUnicodeToMultiByte(pdwMode, dwEncoding,
pSrcStr, pcSrcSize, pDstStr, pcDstSize); pSrcStr, (LPINT)pcSrcSize, pDstStr, (LPINT)pcDstSize);
} }
static HRESULT WINAPI fnIMultiLanguage2_ConvertStringReset( static HRESULT WINAPI fnIMultiLanguage2_ConvertStringReset(

View File

@ -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}; WCHAR stringW[] = {'J','u','s','t',' ','a',' ','t','e','s','t',' ','s','t','r','i','n','g',0};
char bufA[256]; char bufA[256];
WCHAR bufW[256]; WCHAR bufW[256];
int lenA, lenW, expected_len; UINT lenA, lenW, expected_len;
HRESULT ret; HRESULT ret;
HMODULE hMlang; HMODULE hMlang;
FARPROC pConvertINetMultiByteToUnicode; FARPROC pConvertINetMultiByteToUnicode;

View File

@ -1349,7 +1349,7 @@ static HRESULT SendFilterMessage(IMediaControl *iface, fnFoundFilter FoundFilter
IEnumPins* pEnum; IEnumPins* pEnum;
HRESULT hr; HRESULT hr;
IPin* pPin; IPin* pPin;
LONG dummy; DWORD dummy;
PIN_DIRECTION dir; PIN_DIRECTION dir;
TRACE("(%p/%p)->()\n", This, iface); TRACE("(%p/%p)->()\n", This, iface);

View File

@ -543,7 +543,7 @@ static HRESULT FM2_ReadFilterData(IPropertyBag * pPropBag, REGFILTER2 * prf2)
/* FIXME: check signature */ /* FIXME: check signature */
TRACE("\tsignature = %s\n", debugstr_an(prrfp->signature, 4)); TRACE("\tsignature = %s\n", debugstr_an((const char*)prrfp->signature, 4));
TRACE("\tpin[%ld]: flags = %lx, instances = %ld, media types = %ld, mediums = %ld\n", TRACE("\tpin[%ld]: flags = %lx, instances = %ld, media types = %ld, mediums = %ld\n",
i, prrfp->dwFlags, prrfp->dwInstances, prrfp->dwMediaTypes, prrfp->dwMediums); i, prrfp->dwFlags, prrfp->dwInstances, prrfp->dwMediaTypes, prrfp->dwMediums);
@ -577,7 +577,7 @@ static HRESULT FM2_ReadFilterData(IPropertyBag * pPropBag, REGFILTER2 * prf2)
CLSID * clsMinor = CoTaskMemAlloc(sizeof(CLSID)); CLSID * clsMinor = CoTaskMemAlloc(sizeof(CLSID));
/* FIXME: check signature */ /* FIXME: check signature */
TRACE("\t\tsignature = %s\n", debugstr_an(prt->signature, 4)); TRACE("\t\tsignature = %s\n", debugstr_an((const char*)prt->signature, 4));
memcpy(clsMajor, pData + prt->dwOffsetMajor, sizeof(CLSID)); memcpy(clsMajor, pData + prt->dwOffsetMajor, sizeof(CLSID));
memcpy(clsMinor, pData + prt->dwOffsetMinor, sizeof(CLSID)); memcpy(clsMinor, pData + prt->dwOffsetMinor, sizeof(CLSID));

View File

@ -1519,7 +1519,7 @@ static BOOL MMSYSTEM_MidiStream_MessageHandler(WINE_MIDIStream* lpMidiStrm, LPWI
* 3b 4c 00 99 23 5e 04 89 3b 00 00 89 23 00 7c 99 ;L..#^..;...#.|. * 3b 4c 00 99 23 5e 04 89 3b 00 00 89 23 00 7c 99 ;L..#^..;...#.|.
*/ */
lpMidiHdr = (LPMIDIHDR)msg->lParam; lpMidiHdr = (LPMIDIHDR)msg->lParam;
lpData = lpMidiHdr->lpData; lpData = (LPBYTE)lpMidiHdr->lpData;
TRACE("Adding %s lpMidiHdr=%p [lpData=0x%08lx dwBufferLength=%lu/%lu dwFlags=0x%08lx size=%u]\n", TRACE("Adding %s lpMidiHdr=%p [lpData=0x%08lx dwBufferLength=%lu/%lu dwFlags=0x%08lx size=%u]\n",
(lpMidiHdr->dwFlags & MHDR_ISSTRM) ? "stream" : "regular", lpMidiHdr, (lpMidiHdr->dwFlags & MHDR_ISSTRM) ? "stream" : "regular", lpMidiHdr,
(DWORD)lpMidiHdr, lpMidiHdr->dwBufferLength, lpMidiHdr->dwBytesRecorded, (DWORD)lpMidiHdr, lpMidiHdr->dwBufferLength, lpMidiHdr->dwBytesRecorded,
@ -1626,7 +1626,7 @@ static DWORD CALLBACK MMSYSTEM_MidiStream_Player(LPVOID pmt)
} }
if (!lpData) if (!lpData)
lpData = lpMidiHdr->lpData; lpData = (LPBYTE)lpMidiHdr->lpData;
me = (LPMIDIEVENT)(lpData + lpMidiHdr->dwOffset); me = (LPMIDIEVENT)(lpData + lpMidiHdr->dwOffset);