programs: Fix compiler warnings with flag -Wcast-qual.

This commit is contained in:
Mikhail Maroukhine 2010-03-28 22:24:36 +07:00 committed by Alexandre Julliard
parent cad91b8d50
commit 93d9d8a3af
6 changed files with 16 additions and 16 deletions

View File

@ -123,8 +123,8 @@ static WCHAR * WCMD_filesize64 (ULONGLONG n) {
*/
static int WCMD_dir_sort (const void *a, const void *b)
{
WIN32_FIND_DATAW *filea = (WIN32_FIND_DATAW *)a;
WIN32_FIND_DATAW *fileb = (WIN32_FIND_DATAW *)b;
const WIN32_FIND_DATAW *filea = (const WIN32_FIND_DATAW *)a;
const WIN32_FIND_DATAW *fileb = (const WIN32_FIND_DATAW *)b;
int result = 0;
/* If /OG or /O-G supplied, dirs go at the top or bottom, ignoring the
@ -154,7 +154,7 @@ static int WCMD_dir_sort (const void *a, const void *b)
/* Order by Date: (Takes into account which date (/T option) */
} else if (dirOrder == Date) {
FILETIME *ft;
const FILETIME *ft;
ULONG64 timea, timeb;
if (dirTime == Written) {

View File

@ -149,7 +149,7 @@ static DWORD reg_set_string_value(HKEY hKey, LPCWSTR value_name, LPCWSTR string)
return ERROR_SUCCESS;
}
return RegSetValueExW(hKey, value_name, 0, REG_SZ, (LPBYTE)string, sizeof(WCHAR)*(strlenW(string) + 1));
return RegSetValueExW(hKey, value_name, 0, REG_SZ, (const BYTE*)string, sizeof(WCHAR)*(strlenW(string) + 1));
}
DWORD save_service_config(struct service_entry *entry)

View File

@ -161,7 +161,7 @@ done:
/* wrapper for RegSetValueExW */
static DWORD set_reg_value( HKEY hkey, const WCHAR *name, const WCHAR *value )
{
return RegSetValueExW( hkey, name, 0, REG_SZ, (BYTE *)value, (strlenW(value) + 1) * sizeof(WCHAR) );
return RegSetValueExW( hkey, name, 0, REG_SZ, (const BYTE *)value, (strlenW(value) + 1) * sizeof(WCHAR) );
}
/* create the volatile hardware registry keys */

View File

@ -245,7 +245,7 @@ static void dbg_exception_epilog(void)
static DWORD dbg_handle_exception(const EXCEPTION_RECORD* rec, BOOL first_chance)
{
BOOL is_debug = FALSE;
THREADNAME_INFO* pThreadName;
const THREADNAME_INFO* pThreadName;
struct dbg_thread* pThread;
assert(dbg_curr_thread);
@ -260,7 +260,7 @@ static DWORD dbg_handle_exception(const EXCEPTION_RECORD* rec, BOOL first_chance
is_debug = TRUE;
break;
case EXCEPTION_NAME_THREAD:
pThreadName = (THREADNAME_INFO*)(rec->ExceptionInformation);
pThreadName = (const THREADNAME_INFO*)(rec->ExceptionInformation);
if (pThreadName->dwThreadID == -1)
pThread = dbg_curr_thread;
else

View File

@ -922,7 +922,7 @@ static BOOL write_desktop_entry(const char *unix_link, const char *location, con
HKEY hkey = open_menus_reg_key();
if (hkey)
{
RegSetValueExA(hkey, location, 0, REG_SZ, (BYTE*) unix_link, lstrlenA(unix_link) + 1);
RegSetValueExA(hkey, location, 0, REG_SZ, (const BYTE*) unix_link, lstrlenA(unix_link) + 1);
RegCloseKey(hkey);
}
else
@ -1061,7 +1061,7 @@ end:
HKEY hkey = open_menus_reg_key();
if (hkey)
{
RegSetValueExA(hkey, menuPath, 0, REG_SZ, (BYTE*) unix_link, lstrlenA(unix_link) + 1);
RegSetValueExA(hkey, menuPath, 0, REG_SZ, (const BYTE*) unix_link, lstrlenA(unix_link) + 1);
RegCloseKey(hkey);
}
}
@ -1748,12 +1748,12 @@ static void update_association(LPCWSTR extension, LPCSTR mimeType, LPCWSTR progI
HKEY subkey;
if (RegCreateKeyW(assocKey, extension, &subkey) == ERROR_SUCCESS)
{
RegSetValueExA(subkey, "MimeType", 0, REG_SZ, (BYTE*) mimeType, lstrlenA(mimeType) + 1);
RegSetValueExW(subkey, ProgIDW, 0, REG_SZ, (BYTE*) progId, (lstrlenW(progId) + 1) * sizeof(WCHAR));
RegSetValueExA(subkey, "AppName", 0, REG_SZ, (BYTE*) appName, lstrlenA(appName) + 1);
RegSetValueExA(subkey, "MimeType", 0, REG_SZ, (const BYTE*) mimeType, lstrlenA(mimeType) + 1);
RegSetValueExW(subkey, ProgIDW, 0, REG_SZ, (const BYTE*) progId, (lstrlenW(progId) + 1) * sizeof(WCHAR));
RegSetValueExA(subkey, "AppName", 0, REG_SZ, (const BYTE*) appName, lstrlenA(appName) + 1);
if (docName)
RegSetValueExW(subkey, DocNameW, 0, REG_SZ, (BYTE*) docName, (lstrlenW(docName) + 1) * sizeof(WCHAR));
RegSetValueExA(subkey, "DesktopFile", 0, REG_SZ, (BYTE*) desktopFile, (lstrlenA(desktopFile) + 1));
RegSetValueExW(subkey, DocNameW, 0, REG_SZ, (const BYTE*) docName, (lstrlenW(docName) + 1) * sizeof(WCHAR));
RegSetValueExA(subkey, "DesktopFile", 0, REG_SZ, (const BYTE*) desktopFile, (lstrlenA(desktopFile) + 1));
RegCloseKey(subkey);
}
else

View File

@ -492,7 +492,7 @@ static int comp_FindSubFile(void *p, const void *key,
int leaf, void** next)
{
*next = (char *)p+strlen(p)+(leaf?5:3);
WINE_TRACE("Comparing '%s' with '%s'\n", (char *)p, (char *)key);
WINE_TRACE("Comparing '%s' with '%s'\n", (char *)p, (const char *)key);
return strcmp(p, key);
}
@ -1601,7 +1601,7 @@ static BOOL HLPFILE_BrowseParagraph(HLPFILE_PAGE* page, struct RtfData* rd,
case 0xEE:
case 0xEF:
{
char* ptr = (char*) format + 8;
const char* ptr = (const char*) format + 8;
BYTE type = format[3];
int wnd = -1;