From e1646dd215d5af12cdba32db9f2b527bd073dce5 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 12 Sep 2005 20:29:16 +0000 Subject: [PATCH] Use MAKEINTRESOURCE instead of casts where appropriate. --- dlls/atl/registrar.c | 3 +-- dlls/kernel/locale.c | 2 +- dlls/kernel/resource16.c | 2 +- dlls/oleaut32/vartype.c | 2 +- dlls/user/dialog.c | 6 +++--- dlls/user/dialog16.c | 4 ++-- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/dlls/atl/registrar.c b/dlls/atl/registrar.c index bce5b4b15a4..dd537924ac2 100644 --- a/dlls/atl/registrar.c +++ b/dlls/atl/registrar.c @@ -783,8 +783,7 @@ static HRESULT do_register_dll_server(LPCOLESTR wszDll, LPCOLESTR wszId, BOOL do static HRESULT do_register_server(BOOL do_register) { static const WCHAR wszDll[] = {'a','t','l','.','d','l','l',0}; - UINT nID = 101; - return do_register_dll_server(wszDll, (LPCOLESTR) nID, do_register); + return do_register_dll_server(wszDll, MAKEINTRESOURCEW(101), do_register); } /*********************************************************************** diff --git a/dlls/kernel/locale.c b/dlls/kernel/locale.c index 3ab10c7f116..0346a61ef9b 100644 --- a/dlls/kernel/locale.c +++ b/dlls/kernel/locale.c @@ -2683,7 +2683,7 @@ static BOOL NLS_RegGetDword(HANDLE hKey, LPCWSTR szValueName, DWORD *lpVal) static BOOL NLS_GetLanguageGroupName(LGRPID lgrpid, LPWSTR szName, ULONG nameSize) { LANGID langId; - LPCWSTR szResourceName = (LPCWSTR)(((lgrpid + 0x2000) >> 4) + 1); + LPCWSTR szResourceName = MAKEINTRESOURCEW(((lgrpid + 0x2000) >> 4) + 1); HRSRC hResource; BOOL bRet = FALSE; diff --git a/dlls/kernel/resource16.c b/dlls/kernel/resource16.c index 721fae210ac..20794b37f89 100644 --- a/dlls/kernel/resource16.c +++ b/dlls/kernel/resource16.c @@ -150,7 +150,7 @@ static WORD MapHRsrc16ToType( NE_MODULE *pModule, HRSRC16 hRsrc16 ) */ static inline LPCSTR get_res_name( LPCSTR name ) { - if (HIWORD(name) && name[0] == '#') name = (LPCSTR)atoi( name + 1 ); + if (HIWORD(name) && name[0] == '#') name = MAKEINTRESOURCEA( atoi( name + 1 ) ); return name; } diff --git a/dlls/oleaut32/vartype.c b/dlls/oleaut32/vartype.c index 7dca9092186..c53d3be4265 100644 --- a/dlls/oleaut32/vartype.c +++ b/dlls/oleaut32/vartype.c @@ -5014,7 +5014,7 @@ static BOOL VARIANT_GetLocalisedText(LANGID langId, DWORD dwId, WCHAR *lpszDest) HRSRC hrsrc; hrsrc = FindResourceExW( OLEAUT32_hModule, (LPWSTR)RT_STRING, - (LPCWSTR)((dwId >> 4) + 1), langId ); + MAKEINTRESOURCEW((dwId >> 4) + 1), langId ); if (hrsrc) { HGLOBAL hmem = LoadResource( OLEAUT32_hModule, hrsrc ); diff --git a/dlls/user/dialog.c b/dlls/user/dialog.c index 694fefcc75e..46993a1dacb 100644 --- a/dlls/user/dialog.c +++ b/dlls/user/dialog.c @@ -212,7 +212,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info, if (GET_WORD(p) == 0xffff) /* Is it an integer id? */ { - info->windowName = (LPCWSTR)(UINT)GET_WORD(p + 1); + info->windowName = MAKEINTRESOURCEW(GET_WORD(p + 1)); p += 2; } else @@ -385,7 +385,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result ) p++; break; case 0xffff: - result->menuName = (LPCWSTR)(UINT)GET_WORD( p + 1 ); + result->menuName = MAKEINTRESOURCEW(GET_WORD( p + 1 )); p += 2; TRACE(" MENU %04x\n", LOWORD(result->menuName) ); break; @@ -405,7 +405,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result ) p++; break; case 0xffff: - result->className = (LPCWSTR)(UINT)GET_WORD( p + 1 ); + result->className = MAKEINTRESOURCEW(GET_WORD( p + 1 )); p += 2; TRACE(" CLASS %04x\n", LOWORD(result->className) ); break; diff --git a/dlls/user/dialog16.c b/dlls/user/dialog16.c index 5588363ec7e..4cab0960ad7 100644 --- a/dlls/user/dialog16.c +++ b/dlls/user/dialog16.c @@ -108,7 +108,7 @@ static LPCSTR DIALOG_GetControl16( LPCSTR p, DLG_CONTROL_INFO *info ) if (int_id) { /* Integer id, not documented (?). Only works for SS_ICON controls */ - info->windowName = (LPCSTR)(UINT)GET_WORD(p+1); + info->windowName = MAKEINTRESOURCEA(GET_WORD(p+1)); p += 3; } else @@ -231,7 +231,7 @@ static LPCSTR DIALOG_ParseTemplate16( LPCSTR p, DLG_TEMPLATE * result ) p++; break; case 0xff: - result->menuName = (LPCSTR)(UINT)GET_WORD( p + 1 ); + result->menuName = MAKEINTRESOURCEA(GET_WORD( p + 1 )); p += 3; TRACE(" MENU %04x\n", LOWORD(result->menuName) ); break;