Fix gcc 4.0 warnings.

This commit is contained in:
Mike McCormack 2005-08-26 08:53:31 +00:00 committed by Alexandre Julliard
parent 12c9b501fb
commit 93ab695a5c
13 changed files with 39 additions and 28 deletions

View File

@ -1342,7 +1342,7 @@ static HRESULT VARIANT_FormatNumber(LPVARIANT pVarIn, LPOLESTR lpszFormat,
case FMT_GEN_INLINE:
pToken += 2;
TRACE("copy %s\n", debugstr_a(pToken));
TRACE("copy %s\n", debugstr_a((LPCSTR)pToken));
while (*pToken)
*pBuff++ = *pToken++;
break;

View File

@ -1004,7 +1004,7 @@ static HCRYPTPROV new_key_container(PCCH pszContainerName, DWORD dwFlags, PVTabl
/* The new key container has to be inserted into the CSP immediately
* after creation to be available for CPGetProvParam's PP_ENUMCONTAINERS. */
if (!(dwFlags & CRYPT_VERIFYCONTEXT)) {
BYTE szRSABase[MAX_PATH];
CHAR szRSABase[MAX_PATH];
HKEY hRootKey, hKey;
sprintf(szRSABase, RSAENH_REGKEY, pKeyContainer->szName);
@ -1589,12 +1589,20 @@ BOOL WINAPI RSAENH_CPCreateHash(HCRYPTPROV hProv, ALG_ID Algid, HCRYPTKEY hKey,
init_data_blob(&pCryptHash->tpPRFParams.blobSeed);
if (Algid == CALG_SCHANNEL_MASTER_HASH) {
CRYPT_DATA_BLOB blobRandom, blobKeyExpansion = { 13, "key expansion" };
static const char keyex[] = "key expansion";
BYTE key_expansion[sizeof keyex];
CRYPT_DATA_BLOB blobRandom, blobKeyExpansion = { 13, key_expansion };
memcpy( key_expansion, keyex, sizeof keyex );
if (pCryptKey->dwState != RSAENH_KEYSTATE_MASTERKEY) {
CRYPT_DATA_BLOB blobLabel = { 13, "master secret" };
static const char msec[] = "master secret";
BYTE master_secret[sizeof msec];
CRYPT_DATA_BLOB blobLabel = { 13, master_secret };
BYTE abKeyValue[48];
memcpy( master_secret, msec, sizeof msec );
/* See RFC 2246, chapter 8.1 */
if (!concat_data_blobs(&blobRandom,
&pCryptKey->siSChannelInfo.blobClientRandom,
@ -2781,7 +2789,7 @@ BOOL WINAPI RSAENH_CPGetProvParam(HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData,
KEYCONTAINER *pKeyContainer;
PROV_ENUMALGS provEnumalgs;
DWORD dwTemp;
BYTE szRSABase[MAX_PATH];
CHAR szRSABase[MAX_PATH];
HKEY hKey, hRootKey;
/* This is for dwParam 41, which does not seem to be documented
@ -2866,7 +2874,7 @@ BOOL WINAPI RSAENH_CPGetProvParam(HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData,
}
dwTemp = *pdwDataLen;
switch (RegEnumKeyExA(hKey, pKeyContainer->dwEnumContainersCtr, pbData, &dwTemp,
switch (RegEnumKeyExA(hKey, pKeyContainer->dwEnumContainersCtr, (LPSTR)pbData, &dwTemp,
NULL, NULL, NULL, NULL))
{
case ERROR_MORE_DATA:

View File

@ -325,8 +325,8 @@ HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CONST REC
HRESULT WINAPI IWineD3DSwapChainImpl_GetFrontBufferData(IWineD3DSwapChain *iface, IWineD3DSurface *pDestSurface) {
IWineD3DSwapChainImpl *This = (IWineD3DSwapChainImpl *)iface;
WINED3DFORMAT d3dformat;
int width;
int height;
UINT width;
UINT height;
WINED3DSURFACE_DESC desc;
glDescriptor *glDescription;

View File

@ -892,7 +892,7 @@ struct IWineD3DStateBlockImpl
/* Vertex Shader Constants */
BOOL vertexShaderConstantB[MAX_VSHADER_CONSTANTS];
UINT vertexShaderConstantI[MAX_VSHADER_CONSTANTS * 4];
INT vertexShaderConstantI[MAX_VSHADER_CONSTANTS * 4];
float vertexShaderConstantF[MAX_VSHADER_CONSTANTS * 4];
BOOL softwareVertexProcessing;
@ -1133,7 +1133,7 @@ typedef struct IWineD3DVertexShaderImpl {
/* FIXME: This needs to be populated with some flags of VS_CONSTANT_NOT_USED, VS_CONSTANT_CONSTANT, VS_CONSTANT_INTEGER, VS_CONSTANT_BOOLEAN, VS_CONSTANT_FLOAT, a half byte bitmap will be the best option, but I'll keep it as chards for siplicity */
/* run time datas... */
VSHADERDATA* data;
GLint prgId;
GLuint prgId;
#if 0 /* needs reworking */
/* run time datas */
VSHADERINPUTDATA input;

View File

@ -214,7 +214,7 @@ void WINAPI DOSVM_ASPIHandler( CONTEXT86 *context )
/* Get SendASPI32Command by Ordinal 2 */
/* Cast to correct argument/return types */
pSendASPI32Command = (DWORD (*)(LPSRB))GetProcAddress(hWNASPI32, (LPBYTE)2);
pSendASPI32Command = (DWORD (*)(LPSRB))GetProcAddress(hWNASPI32, (LPCSTR)2);
if( !pSendASPI32Command )
{
ERR("Error getting ordinal 2 from WNASPI32\n");

View File

@ -166,9 +166,10 @@ static DWORD DOSMEM_GetTicksSinceMidnight(void)
*/
static void DOSMEM_FillBiosSegments(void)
{
char *pBiosSys = DOSMEM_dosmem + 0xf0000;
BYTE *pBiosSys = (BYTE*)DOSMEM_dosmem + 0xf0000;
BYTE *pBiosROMTable = pBiosSys+0xe6f5;
BIOSDATA *pBiosData = DOSVM_BiosData();
static const char bios_date[] = "13/01/99";
/* Clear all unused values */
memset( pBiosData, 0, sizeof(*pBiosData) );
@ -212,7 +213,7 @@ static void DOSMEM_FillBiosSegments(void)
*(pBiosROMTable+0x9) = 0x00; /* feature byte 5 */
/* BIOS date string */
strcpy(pBiosSys+0xfff5, "13/01/99");
memcpy(pBiosSys+0xfff5, bios_date, sizeof bios_date);
/* BIOS ID */
*(pBiosSys+0xfffe) = 0xfc;

View File

@ -205,7 +205,8 @@ static BOOL MZ_DoLoadImage( HANDLE hFile, LPCSTR filename, OverlayBlock *oblk, W
{
IMAGE_DOS_HEADER mz_header;
DWORD image_start,image_size,min_size,max_size,avail;
BYTE*psp_start,*load_start,*oldenv = 0;
BYTE*psp_start,*load_start;
LPSTR oldenv = 0;
int x, old_com=0, alloc;
SEGPTR reloc;
WORD env_seg, load_seg, rel_seg, oldpsp_seg;
@ -218,7 +219,7 @@ static BOOL MZ_DoLoadImage( HANDLE hFile, LPCSTR filename, OverlayBlock *oblk, W
oldpsp_seg = DOSVM_psp;
if( !par_env_seg) {
par_psp = (PDB16*)((DWORD)DOSVM_psp << 4);
oldenv = (LPBYTE)((DWORD)par_psp->environment << 4);
oldenv = (LPSTR)((DWORD)par_psp->environment << 4);
}
} else {
/* allocate new DOS process, inheriting from Wine environment */
@ -454,7 +455,7 @@ BOOL WINAPI MZ_Exec( CONTEXT86 *context, LPCSTR filename, BYTE func, LPVOID para
{
if(func == 0) /* load and execute */
{
LPBYTE fullCmdLine;
LPSTR fullCmdLine;
WORD fullCmdLength;
LPBYTE psp_start = (LPBYTE)((DWORD)DOSVM_psp << 4);
PDB16 *psp = (PDB16 *)psp_start;
@ -532,7 +533,7 @@ BOOL WINAPI MZ_Exec( CONTEXT86 *context, LPCSTR filename, BYTE func, LPVOID para
LPBYTE cmdline = PTR_REAL_TO_LIN(SELECTOROF(blk->cmdline),OFFSETOF(blk->cmdline));
/* First character contains the length of the command line. */
MZ_FillPSP(psp_start, cmdline + 1, cmdline[0]);
MZ_FillPSP(psp_start, (LPSTR)cmdline + 1, cmdline[0]);
/* the lame MS-DOS engineers decided that the return address should be in int22 */
DOSVM_SetRMHandler(0x22, (FARPROC16)MAKESEGPTR(context->SegCs, LOWORD(context->Eip)));

View File

@ -145,7 +145,7 @@ void PSDRV_MergeDevmodes(PSDRV_DEVMODEA *dm1, PSDRV_DEVMODEA *dm2,
if (dm2->dmPublic.dmFields & DM_COLLATE )
dm1->dmPublic.dmCollate = dm2->dmPublic.dmCollate;
if (dm2->dmPublic.dmFields & DM_FORMNAME )
lstrcpynA(dm1->dmPublic.dmFormName, dm2->dmPublic.dmFormName, CCHFORMNAME);
lstrcpynA((LPSTR)dm1->dmPublic.dmFormName, (LPCSTR)dm2->dmPublic.dmFormName, CCHFORMNAME);
if (dm2->dmPublic.dmFields & DM_BITSPERPEL )
dm1->dmPublic.dmBitsPerPel = dm2->dmPublic.dmBitsPerPel;
if (dm2->dmPublic.dmFields & DM_PELSWIDTH )

View File

@ -272,7 +272,7 @@ static LPDEVMODEA DEVMODEdupWtoA(HANDLE heap, const DEVMODEW *dmW)
Formname = (dmW->dmSize > off_formname);
size = dmW->dmSize - CCHDEVICENAME - (Formname ? CCHFORMNAME : 0);
dmA = HeapAlloc(heap, HEAP_ZERO_MEMORY, size + dmW->dmDriverExtra);
WideCharToMultiByte(CP_ACP, 0, dmW->dmDeviceName, -1, dmA->dmDeviceName,
WideCharToMultiByte(CP_ACP, 0, dmW->dmDeviceName, -1, (LPSTR)dmA->dmDeviceName,
CCHDEVICENAME, NULL, NULL);
if(!Formname) {
memcpy(&dmA->dmSpecVersion, &dmW->dmSpecVersion,
@ -280,7 +280,7 @@ static LPDEVMODEA DEVMODEdupWtoA(HANDLE heap, const DEVMODEW *dmW)
} else {
memcpy(&dmA->dmSpecVersion, &dmW->dmSpecVersion,
off_formname - CCHDEVICENAME * sizeof(WCHAR));
WideCharToMultiByte(CP_ACP, 0, dmW->dmFormName, -1, dmA->dmFormName,
WideCharToMultiByte(CP_ACP, 0, dmW->dmFormName, -1, (LPSTR)dmA->dmFormName,
CCHFORMNAME, NULL, NULL);
memcpy(&dmA->dmLogPixels, &dmW->dmLogPixels, dmW->dmSize -
(off_formname + CCHFORMNAME * sizeof(WCHAR)));
@ -308,7 +308,7 @@ BOOL PSDRV_CreateDC( HDC hdc, PSDRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR devi
if ( !device && *pdev )
{
physDev = *pdev;
strcpy(deviceA, physDev->Devmode->dmPublic.dmDeviceName);
lstrcpynA(deviceA, (LPCSTR)physDev->Devmode->dmPublic.dmDeviceName, CCHDEVICENAME);
}
else
WideCharToMultiByte(CP_ACP, 0, device, -1, deviceA, sizeof(deviceA), NULL, NULL);
@ -549,7 +549,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name)
if (pi->Devmode == NULL)
goto cleanup;
memcpy(pi->Devmode, &DefaultDevmode, sizeof(DefaultDevmode) );
strcpy(pi->Devmode->dmPublic.dmDeviceName,name);
lstrcpynA((LPSTR)pi->Devmode->dmPublic.dmDeviceName,name,CCHDEVICENAME);
using_default_devmode = TRUE;
/* need to do something here AddPrinter?? */
@ -591,7 +591,7 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name)
res = GetPrinterDataA(hPrinter, "PPD File", NULL, NULL, 0, &needed);
if ((res==ERROR_SUCCESS) || (res==ERROR_MORE_DATA)) {
ppdFileName=HeapAlloc(PSDRV_Heap, 0, needed);
res = GetPrinterDataA(hPrinter, "PPD File", &ppdType, ppdFileName, needed, &needed);
res = GetPrinterDataA(hPrinter, "PPD File", &ppdType, (LPBYTE)ppdFileName, needed, &needed);
}
}
/* Look for a ppd file for this printer in the config file.

View File

@ -745,7 +745,7 @@ BOOL PSDRV_WriteData(PSDRV_PDEVICE *physDev, const BYTE *data, DWORD number)
do {
num = min(num_left, 60);
PSDRV_WriteSpool(physDev, data, num);
PSDRV_WriteSpool(physDev, (LPCSTR)data, num);
PSDRV_WriteSpool(physDev, "\n", 1);
data += num;
num_left -= num;
@ -852,7 +852,7 @@ BOOL PSDRV_WriteDIBPatternDict(PSDRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usa
return FALSE;
}
bits = (char*)bmi + bmi->bmiHeader.biSize;
bits = (LPBYTE)bmi + bmi->bmiHeader.biSize;
colours = bmi->bmiHeader.biClrUsed;
if (colours > 256) colours = 256;
if(!colours && bmi->bmiHeader.biBitCount <= 8)

View File

@ -324,7 +324,7 @@ BOOL T42_download_glyph(PSDRV_PDEVICE *physDev, DOWNLOAD *pdl, DWORD index,
if(GET_BE_WORD(t42->tables[t42->glyf_tab].data + start) == 0xffff) {
/* Composite glyph */
char *sg_start = t42->tables[t42->glyf_tab].data + start + 10;
BYTE *sg_start = t42->tables[t42->glyf_tab].data + start + 10;
DWORD sg_flags, sg_index;
char sg_name[MAX_G_NAME + 1];

View File

@ -830,7 +830,8 @@ static void test_so_reuseaddr(void)
{
struct sockaddr_in saddr;
SOCKET s1,s2;
unsigned int rc,reuse,size;
unsigned int rc,reuse;
int size;
saddr.sin_family = AF_INET;
saddr.sin_port = htons(9375);

View File

@ -107,7 +107,7 @@ send_file (const char *name)
SOCKET s;
FILE *f;
#define BUFLEN 8192
unsigned char buffer[BUFLEN+1];
char buffer[BUFLEN+1];
size_t bytes_read, total, filesize;
char *str;
int ret;