Andrew Talbot : regedit: Cast-qual warnings fix.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Oct 12 15:28:55 CDT 2006
Module: wine
Branch: master
Commit: 4b2756ba5dd1248d57bcf34448c9b952102fa37c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4b2756ba5dd1248d57bcf34448c9b952102fa37c
Author: Andrew Talbot <Andrew.Talbot at talbotville.com>
Date: Thu Oct 5 22:01:55 2006 +0100
regedit: Cast-qual warnings fix.
---
programs/regedit/edit.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/programs/regedit/edit.c b/programs/regedit/edit.c
index e71a247..1741672 100644
--- a/programs/regedit/edit.c
+++ b/programs/regedit/edit.c
@@ -89,13 +89,13 @@ static void error_code_messagebox(HWND h
LPTSTR lpMsgBuf;
DWORD status;
TCHAR title[256];
- static const TCHAR fallback[] = TEXT("Error displaying error message.\n");
+ static TCHAR fallback[] = TEXT("Error displaying error message.\n");
if (!LoadString(hInst, IDS_ERROR, title, COUNT_OF(title)))
lstrcpy(title, TEXT("Error"));
status = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, error_code, 0, (LPTSTR)&lpMsgBuf, 0, NULL);
if (!status)
- lpMsgBuf = (LPTSTR)fallback;
+ lpMsgBuf = fallback;
MessageBox(hwnd, lpMsgBuf, title, MB_OK | MB_ICONERROR);
if (lpMsgBuf != fallback)
LocalFree(lpMsgBuf);
@@ -481,9 +481,12 @@ BOOL RenameKey(HWND hwnd, HKEY hRootKey,
parentKey = hRootKey;
srcSubKey = keyPath;
} else {
+ LPTSTR srcSubKey_copy;
+
parentPath = strdup(keyPath);
- srcSubKey = strrchr(parentPath, '\\') + 1;
- *((LPTSTR)srcSubKey - 1) = 0;
+ srcSubKey_copy = strrchr(parentPath, '\\');
+ *srcSubKey_copy = 0;
+ srcSubKey = srcSubKey_copy + 1;
lRet = RegOpenKeyEx(hRootKey, parentPath, 0, KEY_READ | KEY_CREATE_SUB_KEY, &parentKey);
if (lRet != ERROR_SUCCESS) {
error_code_messagebox(hwnd, lRet);
More information about the wine-cvs
mailing list