regedit: Cast-qual warnings fix

Andrew Talbot Andrew.Talbot at talbotville.com
Thu Oct 5 16:01:55 CDT 2006


Changelog:
    regedit: Cast-qual warnings fix.

diff -urN a/programs/regedit/edit.c b/programs/regedit/edit.c
--- a/programs/regedit/edit.c	2006-05-23 13:49:20.000000000 +0100
+++ b/programs/regedit/edit.c	2006-10-05 21:58:34.000000000 +0100
@@ -89,13 +89,13 @@
     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,11 @@
 	parentKey = hRootKey;
 	srcSubKey = keyPath;
     } else {
+	LPTSTR srcSubKey_copy;
+
 	parentPath = strdup(keyPath);
-	srcSubKey = strrchr(parentPath, '\\') + 1;
-	*((LPTSTR)srcSubKey - 1) = 0;
+	srcSubKey = srcSubKey_copy = strrchr(parentPath, '\\') + 1;
+	*(srcSubKey_copy - 1) = 0;
 	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-patches mailing list