Fix gcc 4.0 warnings.

This commit is contained in:
Mike McCormack 2005-08-23 09:37:30 +00:00 committed by Alexandre Julliard
parent 7ab2813735
commit f49f36f9eb
5 changed files with 16 additions and 12 deletions

View File

@ -206,7 +206,7 @@ static void create_test_association(const char* extension)
rc=RegCreateKeyEx(HKEY_CLASSES_ROOT, extension, 0, NULL, 0, KEY_SET_VALUE, rc=RegCreateKeyEx(HKEY_CLASSES_ROOT, extension, 0, NULL, 0, KEY_SET_VALUE,
NULL, &hkey, NULL); NULL, &hkey, NULL);
assert(rc==ERROR_SUCCESS); assert(rc==ERROR_SUCCESS);
rc=RegSetValueEx(hkey, NULL, 0, REG_SZ, class, strlen(class)+1); rc=RegSetValueEx(hkey, NULL, 0, REG_SZ, (LPBYTE) class, strlen(class)+1);
assert(rc==ERROR_SUCCESS); assert(rc==ERROR_SUCCESS);
CloseHandle(hkey); CloseHandle(hkey);
@ -250,7 +250,7 @@ static void create_test_verb(const char* extension, const char* verb,
cmd=malloc(strlen(argv0)+10+strlen(child_file)+2+strlen(cmdtail)+1); cmd=malloc(strlen(argv0)+10+strlen(child_file)+2+strlen(cmdtail)+1);
sprintf(cmd,"%s shlexec \"%s\" %s", argv0, child_file, cmdtail); sprintf(cmd,"%s shlexec \"%s\" %s", argv0, child_file, cmdtail);
rc=RegSetValueEx(hkey_cmd, NULL, 0, REG_SZ, cmd, strlen(cmd)+1); rc=RegSetValueEx(hkey_cmd, NULL, 0, REG_SZ, (LPBYTE) cmd, strlen(cmd)+1);
assert(rc==ERROR_SUCCESS); assert(rc==ERROR_SUCCESS);
free(cmd); free(cmd);

View File

@ -223,7 +223,7 @@ TW_UINT16 TWAIN_ICAPXferMech (activeDS *pSource, pTW_CAPABILITY pCapability,
case MSG_SET: case MSG_SET:
if (pCapability->ConType == TWON_ONEVALUE) if (pCapability->ConType == TWON_ONEVALUE)
{ {
TW_UINT32 xfermechtemp; TW_UINT32 xfermechtemp = 0;
if (!TWAIN_OneValueGet (pCapability, &xfermechtemp)) if (!TWAIN_OneValueGet (pCapability, &xfermechtemp))
return TWCC_LOWMEMORY; return TWCC_LOWMEMORY;
pSource->capXferMech = xfermechtemp; pSource->capXferMech = xfermechtemp;

View File

@ -200,7 +200,7 @@ static BOOL find_ne_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid,
if ( !resTab ) return FALSE; if ( !resTab ) return FALSE;
LZSeek( lzfd, nehd.ne_rsrctab + nehdoffset, SEEK_SET ); LZSeek( lzfd, nehd.ne_rsrctab + nehdoffset, SEEK_SET );
if ( resTabSize != LZRead( lzfd, resTab, resTabSize ) ) if ( resTabSize != LZRead( lzfd, (char*)resTab, resTabSize ) )
{ {
HeapFree( GetProcessHeap(), 0, resTab ); HeapFree( GetProcessHeap(), 0, resTab );
return FALSE; return FALSE;
@ -217,7 +217,7 @@ static BOOL find_ne_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid,
if (!(typeInfo->type_id & 0x8000)) if (!(typeInfo->type_id & 0x8000))
{ {
BYTE *p = resTab + typeInfo->type_id; BYTE *p = resTab + typeInfo->type_id;
if ((*p == len) && !strncasecmp( p+1, typeid, len )) goto found_type; if ((*p == len) && !strncasecmp( (char*)p+1, typeid, len )) goto found_type;
} }
typeInfo = (NE_TYPEINFO *)((char *)(typeInfo + 1) + typeInfo = (NE_TYPEINFO *)((char *)(typeInfo + 1) +
typeInfo->count * sizeof(NE_NAMEINFO)); typeInfo->count * sizeof(NE_NAMEINFO));
@ -247,7 +247,7 @@ static BOOL find_ne_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid,
{ {
BYTE *p = resTab + nameInfo->id; BYTE *p = resTab + nameInfo->id;
if (nameInfo->id & 0x8000) continue; if (nameInfo->id & 0x8000) continue;
if ((*p == len) && !strncasecmp( p+1, resid, len )) goto found_name; if ((*p == len) && !strncasecmp( (char*)p+1, resid, len )) goto found_name;
} }
} }
else /* numeric resource id */ else /* numeric resource id */
@ -340,7 +340,7 @@ static BOOL find_pe_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid,
} }
LZSeek( lzfd, sections[i].PointerToRawData, SEEK_SET ); LZSeek( lzfd, sections[i].PointerToRawData, SEEK_SET );
if ( resSectionSize != LZRead( lzfd, resSection, resSectionSize ) ) goto done; if ( resSectionSize != LZRead( lzfd, (char*)resSection, resSectionSize ) ) goto done;
/* Find resource */ /* Find resource */
resDir = resSection + (resDataDir->VirtualAddress - sections[i].VirtualAddress); resDir = resSection + (resDataDir->VirtualAddress - sections[i].VirtualAddress);

View File

@ -391,6 +391,8 @@ DWORD ASPI_SendASPICommand(DWORD ptrSRB, UINT16 mode)
{ {
#ifdef linux #ifdef linux
LPSRB16 lpSRB = PTR_TO_LIN( ptrSRB, mode ); LPSRB16 lpSRB = PTR_TO_LIN( ptrSRB, mode );
static const char szId[] = "Wine ASPI16";
static const char szWh[] = "Wine host";
if (mode == ASPI_WIN16 && ASPIChainFunc) if (mode == ASPI_WIN16 && ASPIChainFunc)
{ {
@ -412,8 +414,8 @@ DWORD ASPI_SendASPICommand(DWORD ptrSRB, UINT16 mode)
lpSRB->inquiry.SRB_ExtBufferSize = 0x2000; /* bogus value */ lpSRB->inquiry.SRB_ExtBufferSize = 0x2000; /* bogus value */
lpSRB->inquiry.HA_Count = HA_Count; lpSRB->inquiry.HA_Count = HA_Count;
lpSRB->inquiry.HA_SCSI_ID = 7; /* not always ID 7 */ lpSRB->inquiry.HA_SCSI_ID = 7; /* not always ID 7 */
strcat(lpSRB->inquiry.HA_ManagerId, "Wine ASPI16"); /* max 15 chars */ memcpy(lpSRB->inquiry.HA_ManagerId, szId, sizeof szId); /* max 15 chars */
strcat(lpSRB->inquiry.HA_Identifier, "Wine host"); /* FIXME: return host memcpy(lpSRB->inquiry.HA_Identifier, szWh, sizeof szWh); /* FIXME: return host
adapter name */ adapter name */
memset(lpSRB->inquiry.HA_Unique, 0, 16); /* default HA_Unique content */ memset(lpSRB->inquiry.HA_Unique, 0, 16); /* default HA_Unique content */
lpSRB->inquiry.HA_Unique[6] = 0x02; /* Maximum Transfer Length (128K, Byte> 4-7) */ lpSRB->inquiry.HA_Unique[6] = 0x02; /* Maximum Transfer Length (128K, Byte> 4-7) */

View File

@ -513,13 +513,15 @@ DWORD __cdecl GetASPI32SupportInfo(void)
DWORD __cdecl SendASPI32Command(LPSRB lpSRB) DWORD __cdecl SendASPI32Command(LPSRB lpSRB)
{ {
#ifdef linux #ifdef linux
static const char szId[] = "ASPI for WIN32";
static const char szWh[] = "Wine host";
switch (lpSRB->common.SRB_Cmd) { switch (lpSRB->common.SRB_Cmd) {
case SC_HA_INQUIRY: case SC_HA_INQUIRY:
lpSRB->inquiry.SRB_Status = SS_COMP; /* completed successfully */ lpSRB->inquiry.SRB_Status = SS_COMP; /* completed successfully */
lpSRB->inquiry.HA_Count = ASPI_GetNumControllers(); lpSRB->inquiry.HA_Count = ASPI_GetNumControllers();
lpSRB->inquiry.HA_SCSI_ID = 7; /* not always ID 7 */ lpSRB->inquiry.HA_SCSI_ID = 7; /* not always ID 7 */
strcpy(lpSRB->inquiry.HA_ManagerId, "ASPI for WIN32"); /* max 15 chars, don't change */ memcpy(lpSRB->inquiry.HA_ManagerId, szId, sizeof szId); /* max 15 chars, don't change */
strcpy(lpSRB->inquiry.HA_Identifier, "Wine host"); /* FIXME: return host adapter name */ memcpy(lpSRB->inquiry.HA_Identifier, szWh, sizeof szWh); /* FIXME: return host adapter name */
memset(lpSRB->inquiry.HA_Unique, 0, 16); /* default HA_Unique content */ memset(lpSRB->inquiry.HA_Unique, 0, 16); /* default HA_Unique content */
lpSRB->inquiry.HA_Unique[6] = 0x02; /* Maximum Transfer Length (128K, Byte> 4-7) */ lpSRB->inquiry.HA_Unique[6] = 0x02; /* Maximum Transfer Length (128K, Byte> 4-7) */
lpSRB->inquiry.HA_Unique[3] = 0x08; /* Maximum number of SCSI targets */ lpSRB->inquiry.HA_Unique[3] = 0x08; /* Maximum number of SCSI targets */
@ -530,7 +532,7 @@ DWORD __cdecl SendASPI32Command(LPSRB lpSRB)
/* FIXME: We should return SS_NO_DEVICE if the device is not configured */ /* FIXME: We should return SS_NO_DEVICE if the device is not configured */
/* FIXME: We should return SS_INVALID_HA if HostAdapter!=0 */ /* FIXME: We should return SS_INVALID_HA if HostAdapter!=0 */
SRB tmpsrb; SRB tmpsrb;
char inqbuf[200]; unsigned char inqbuf[200];
DWORD ret; DWORD ret;
memset(&tmpsrb,0,sizeof(tmpsrb)); memset(&tmpsrb,0,sizeof(tmpsrb));