From f49f36f9eb7ceb47d5b5745219488d1ca646dac8 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Tue, 23 Aug 2005 09:37:30 +0000 Subject: [PATCH] Fix gcc 4.0 warnings. --- dlls/shell32/tests/shlexec.c | 4 ++-- dlls/twain/capability.c | 2 +- dlls/version/resource.c | 8 ++++---- dlls/winaspi/winaspi16.c | 6 ++++-- dlls/winaspi/winaspi32.c | 8 +++++--- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index 89ca407fbca..3acd5a424f2 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -206,7 +206,7 @@ static void create_test_association(const char* extension) rc=RegCreateKeyEx(HKEY_CLASSES_ROOT, extension, 0, NULL, 0, KEY_SET_VALUE, NULL, &hkey, NULL); 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); 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); 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); free(cmd); diff --git a/dlls/twain/capability.c b/dlls/twain/capability.c index 3b033eb7fb2..64b480e4873 100644 --- a/dlls/twain/capability.c +++ b/dlls/twain/capability.c @@ -223,7 +223,7 @@ TW_UINT16 TWAIN_ICAPXferMech (activeDS *pSource, pTW_CAPABILITY pCapability, case MSG_SET: if (pCapability->ConType == TWON_ONEVALUE) { - TW_UINT32 xfermechtemp; + TW_UINT32 xfermechtemp = 0; if (!TWAIN_OneValueGet (pCapability, &xfermechtemp)) return TWCC_LOWMEMORY; pSource->capXferMech = xfermechtemp; diff --git a/dlls/version/resource.c b/dlls/version/resource.c index 2d36d3ccd0a..3670f66b284 100644 --- a/dlls/version/resource.c +++ b/dlls/version/resource.c @@ -200,7 +200,7 @@ static BOOL find_ne_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid, if ( !resTab ) return FALSE; 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 ); return FALSE; @@ -217,7 +217,7 @@ static BOOL find_ne_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid, if (!(typeInfo->type_id & 0x8000)) { 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->count * sizeof(NE_NAMEINFO)); @@ -247,7 +247,7 @@ static BOOL find_ne_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid, { BYTE *p = resTab + nameInfo->id; 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 */ @@ -340,7 +340,7 @@ static BOOL find_pe_resource( HFILE lzfd, LPCSTR typeid, LPCSTR resid, } 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 */ resDir = resSection + (resDataDir->VirtualAddress - sections[i].VirtualAddress); diff --git a/dlls/winaspi/winaspi16.c b/dlls/winaspi/winaspi16.c index c0663e2895f..f8b718742be 100644 --- a/dlls/winaspi/winaspi16.c +++ b/dlls/winaspi/winaspi16.c @@ -391,6 +391,8 @@ DWORD ASPI_SendASPICommand(DWORD ptrSRB, UINT16 mode) { #ifdef linux LPSRB16 lpSRB = PTR_TO_LIN( ptrSRB, mode ); + static const char szId[] = "Wine ASPI16"; + static const char szWh[] = "Wine host"; 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.HA_Count = HA_Count; lpSRB->inquiry.HA_SCSI_ID = 7; /* not always ID 7 */ - strcat(lpSRB->inquiry.HA_ManagerId, "Wine ASPI16"); /* max 15 chars */ - strcat(lpSRB->inquiry.HA_Identifier, "Wine host"); /* FIXME: return host + memcpy(lpSRB->inquiry.HA_ManagerId, szId, sizeof szId); /* max 15 chars */ + memcpy(lpSRB->inquiry.HA_Identifier, szWh, sizeof szWh); /* FIXME: return host adapter name */ memset(lpSRB->inquiry.HA_Unique, 0, 16); /* default HA_Unique content */ lpSRB->inquiry.HA_Unique[6] = 0x02; /* Maximum Transfer Length (128K, Byte> 4-7) */ diff --git a/dlls/winaspi/winaspi32.c b/dlls/winaspi/winaspi32.c index 0e975d9ad72..e0b4af9cc6e 100644 --- a/dlls/winaspi/winaspi32.c +++ b/dlls/winaspi/winaspi32.c @@ -513,13 +513,15 @@ DWORD __cdecl GetASPI32SupportInfo(void) DWORD __cdecl SendASPI32Command(LPSRB lpSRB) { #ifdef linux + static const char szId[] = "ASPI for WIN32"; + static const char szWh[] = "Wine host"; switch (lpSRB->common.SRB_Cmd) { case SC_HA_INQUIRY: lpSRB->inquiry.SRB_Status = SS_COMP; /* completed successfully */ lpSRB->inquiry.HA_Count = ASPI_GetNumControllers(); lpSRB->inquiry.HA_SCSI_ID = 7; /* not always ID 7 */ - strcpy(lpSRB->inquiry.HA_ManagerId, "ASPI for WIN32"); /* max 15 chars, don't change */ - strcpy(lpSRB->inquiry.HA_Identifier, "Wine host"); /* FIXME: return host adapter name */ + memcpy(lpSRB->inquiry.HA_ManagerId, szId, sizeof szId); /* max 15 chars, don't change */ + memcpy(lpSRB->inquiry.HA_Identifier, szWh, sizeof szWh); /* FIXME: return host adapter name */ 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[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_INVALID_HA if HostAdapter!=0 */ SRB tmpsrb; - char inqbuf[200]; + unsigned char inqbuf[200]; DWORD ret; memset(&tmpsrb,0,sizeof(tmpsrb));