Michael Stefaniuc : atl: Use the ARRAY_SIZE() macro.
Alexandre Julliard
julliard at winehq.org
Wed Jul 11 15:53:51 CDT 2018
Module: wine
Branch: master
Commit: f55c5f3758ab346888e602d33f5b619ee87ff156
URL: https://source.winehq.org/git/wine.git/?a=commit;h=f55c5f3758ab346888e602d33f5b619ee87ff156
Author: Michael Stefaniuc <mstefani at winehq.org>
Date: Wed Jul 11 22:06:12 2018 +0200
atl: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/atl/atl30.c | 2 +-
dlls/atl/atl_ax.c | 2 +-
dlls/atl/registrar.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/atl/atl30.c b/dlls/atl/atl30.c
index d89cf06..61386b8 100644
--- a/dlls/atl/atl30.c
+++ b/dlls/atl/atl30.c
@@ -374,7 +374,7 @@ ATOM WINAPI AtlModuleRegisterWndClassInfoW(_ATL_MODULEW *pm, _ATL_WNDCLASSINFOW
if (!wci->m_wc.lpszClassName)
{
static const WCHAR szFormat[] = {'A','T','L','%','0','8','l','x',0};
- snprintfW(wci->m_szAutoName, sizeof(wci->m_szAutoName)/sizeof(WCHAR), szFormat, (UINT_PTR)wci);
+ snprintfW(wci->m_szAutoName, ARRAY_SIZE(wci->m_szAutoName), szFormat, (UINT_PTR)wci);
TRACE("auto-generated class name %s\n", debugstr_w(wci->m_szAutoName));
wci->m_wc.lpszClassName = wci->m_szAutoName;
}
diff --git a/dlls/atl/atl_ax.c b/dlls/atl/atl_ax.c
index aeda139..ff627cc 100644
--- a/dlls/atl/atl_ax.c
+++ b/dlls/atl/atl_ax.c
@@ -1268,7 +1268,7 @@ static LPDLGTEMPLATEW AX_ConvertDialogTemplate(LPCDLGTEMPLATEW src_tmpl)
if ( GET_WORD(tmp) == '{' ) /* all this mess created because of this line */
{
static const WCHAR AtlAxWin[] = {'A','t','l','A','x','W','i','n', 0};
- PUT_BLOCK(AtlAxWin, sizeof(AtlAxWin)/sizeof(WCHAR));
+ PUT_BLOCK(AtlAxWin, ARRAY_SIZE(AtlAxWin));
PUT_BLOCK(tmp, strlenW(tmp)+1);
} else
PUT_BLOCK(tmp, src-tmp);
diff --git a/dlls/atl/registrar.c b/dlls/atl/registrar.c
index 96fcb0e..b717afe 100644
--- a/dlls/atl/registrar.c
+++ b/dlls/atl/registrar.c
@@ -394,11 +394,11 @@ static HRESULT do_process_root_key(LPCOLESTR data, BOOL do_register)
hres = DISP_E_EXCEPTION;
break;
}
- for(i=0; i<sizeof(root_keys)/sizeof(root_keys[0]); i++) {
+ for(i=0; i<ARRAY_SIZE(root_keys); i++) {
if(!lstrcmpiW(buf.str, root_keys[i].name))
break;
}
- if(i == sizeof(root_keys)/sizeof(root_keys[0])) {
+ if(i == ARRAY_SIZE(root_keys)) {
WARN("Wrong root key name: %s\n", debugstr_w(buf.str));
hres = DISP_E_EXCEPTION;
break;
More information about the wine-cvs
mailing list