Module: wine Branch: master Commit: 0c868151dbe6f8baeaff02942d9414b7f7fb3816 URL: http://source.winehq.org/git/wine.git/?a=commit;h=0c868151dbe6f8baeaff02942d...
Author: Andrew Talbot Andrew.Talbot@talbotville.com Date: Sun Oct 22 13:32:29 2006 +0100
comdlg32: Cast-qual warnings fix.
---
dlls/comdlg32/colordlg.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/comdlg32/colordlg.c b/dlls/comdlg32/colordlg.c index 92523b3..86926f5 100644 --- a/dlls/comdlg32/colordlg.c +++ b/dlls/comdlg32/colordlg.c @@ -1328,7 +1328,9 @@ BOOL WINAPI ChooseColorW( LPCHOOSECOLORW BOOL WINAPI ChooseColorA( LPCHOOSECOLORA lpChCol )
{ + LPWSTR template_name = NULL; BOOL ret; + LPCHOOSECOLORW lpcc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CHOOSECOLORW)); lpcc->lStructSize = sizeof(*lpcc); lpcc->hwndOwner = lpChCol->hwndOwner; @@ -1341,8 +1343,9 @@ BOOL WINAPI ChooseColorA( LPCHOOSECOLORA if ((lpcc->Flags & CC_ENABLETEMPLATE) && (lpChCol->lpTemplateName)) { if (HIWORD(lpChCol->lpTemplateName)) { INT len = MultiByteToWideChar( CP_ACP, 0, lpChCol->lpTemplateName, -1, NULL, 0); - lpcc->lpTemplateName = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); - MultiByteToWideChar( CP_ACP, 0, lpChCol->lpTemplateName, -1, (LPWSTR)lpcc->lpTemplateName, len ); + template_name = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); + MultiByteToWideChar( CP_ACP, 0, lpChCol->lpTemplateName, -1, template_name, len ); + lpcc->lpTemplateName = template_name; } else { lpcc->lpTemplateName = (LPCWSTR)lpChCol->lpTemplateName; } @@ -1352,7 +1355,7 @@ BOOL WINAPI ChooseColorA( LPCHOOSECOLORA
if (ret) lpChCol->rgbResult = lpcc->rgbResult; - if (HIWORD(lpcc->lpTemplateName)) HeapFree(GetProcessHeap(), 0, (LPSTR)lpcc->lpTemplateName); + HeapFree(GetProcessHeap(), 0, template_name); HeapFree(GetProcessHeap(), 0, lpcc); return ret; }