Commit 5e96cd72 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

ieframe: Use the ARRAY_SIZE() macro.

parent 4e18649c
......@@ -428,7 +428,7 @@ static void update_travellog(DocHost *This)
static const WCHAR about_schemeW[] = {'a','b','o','u','t',':'};
if(This->url && !strncmpiW(This->url, about_schemeW, sizeof(about_schemeW)/sizeof(*about_schemeW))) {
if(This->url && !strncmpiW(This->url, about_schemeW, ARRAY_SIZE(about_schemeW))) {
TRACE("Skipping about URL\n");
return;
}
......
......@@ -91,7 +91,7 @@ static void release_typelib(void)
if(!typelib)
return;
for(i=0; i < sizeof(typeinfos)/sizeof(*typeinfos); i++) {
for(i=0; i < ARRAY_SIZE(typeinfos); i++) {
if(typeinfos[i])
ITypeInfo_Release(typeinfos[i]);
}
......
......@@ -263,7 +263,7 @@ static void add_tbs_to_menu(HMENU menu)
WCHAR classes_key[] = {'S','o','f','t','w','a','r','e','\\',
'C','l','a','s','s','e','s','\\','C','L','S','I','D',0};
WCHAR guid[39];
DWORD value_len = sizeof(guid)/sizeof(guid[0]);
DWORD value_len = ARRAY_SIZE(guid);
int i;
if(SHRegOpenUSKeyW(classes_key, KEY_READ, NULL, &classes_handle, TRUE) != ERROR_SUCCESS)
......@@ -276,11 +276,11 @@ static void add_tbs_to_menu(HMENU menu)
for(i = 0; SHRegEnumUSValueW(toolbar_handle, i, guid, &value_len, NULL, NULL, NULL, SHREGENUM_HKLM) == ERROR_SUCCESS; i++)
{
WCHAR tb_name[100];
DWORD tb_name_len = sizeof(tb_name)/sizeof(tb_name[0]);
DWORD tb_name_len = ARRAY_SIZE(tb_name);
HUSKEY tb_class_handle;
MENUITEMINFOW item;
LSTATUS ret;
value_len = sizeof(guid)/sizeof(guid[0]);
value_len = ARRAY_SIZE(guid);
if(lstrlenW(guid) != 38)
{
......@@ -418,7 +418,7 @@ static void add_tb_button(InternetExplorer *ie, int bmp, int cmd, int strId)
TBBUTTON btn;
WCHAR buf[30];
LoadStringW(ieframe_instance, strId, buf, sizeof(buf)/sizeof(buf[0]));
LoadStringW(ieframe_instance, strId, buf, ARRAY_SIZE(buf));
btn.iBitmap = bmp;
btn.idCommand = cmd;
......@@ -445,7 +445,7 @@ static void create_rebar(InternetExplorer *ie)
HIMAGELIST imagelist;
SIZE toolbar_size;
LoadStringW(ieframe_instance, IDS_ADDRESS, addr, sizeof(addr)/sizeof(addr[0]));
LoadStringW(ieframe_instance, IDS_ADDRESS, addr, ARRAY_SIZE(addr));
hwndRebar = CreateWindowExW(WS_EX_TOOLWINDOW, REBARCLASSNAMEW, NULL,
WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|RBS_VARHEIGHT|CCS_TOP|CCS_NODIVIDER, 0, 0, 0, 0,
......
......@@ -93,7 +93,7 @@ static BOOL run_winemenubuilder( const WCHAR *args )
WCHAR app[MAX_PATH];
void *redir;
GetSystemDirectoryW( app, MAX_PATH - sizeof(menubuilder)/sizeof(WCHAR) );
GetSystemDirectoryW( app, MAX_PATH - ARRAY_SIZE( menubuilder ));
strcatW( app, menubuilder );
len = (strlenW( app ) + strlenW( args ) + 1) * sizeof(WCHAR);
......@@ -278,7 +278,7 @@ static HRESULT WINAPI UniformResourceLocatorW_InvokeCommand(IUniformResourceLoca
return E_NOTIMPL;
}
hres = CoInternetParseUrl(This->url, PARSE_SCHEMA, 0, app, sizeof(app)/sizeof(WCHAR), NULL, 0);
hres = CoInternetParseUrl(This->url, PARSE_SCHEMA, 0, app, ARRAY_SIZE(app), NULL, 0);
if(FAILED(hres))
return E_FAIL;
......
......@@ -111,7 +111,7 @@ static void set_status_text(BindStatusCallback *This, ULONG statuscode, LPCWSTR
fmt[0] = 0;
/* the format string must have one "%s" for the str */
LoadStringW(ieframe_instance, IDS_STATUSFMT_FIRST + statuscode, fmt, IDS_STATUSFMT_MAXLEN);
snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), fmt, str);
snprintfW(buffer, ARRAY_SIZE(buffer), fmt, str);
}
V_VT(&arg) = VT_BSTR;
......@@ -576,7 +576,7 @@ static void on_before_navigate2(DocHost *This, LPCWSTR url, SAFEARRAY *post_data
DISPPARAMS dispparams;
VARIANTARG params[7];
WCHAR file_path[MAX_PATH];
DWORD file_path_len = sizeof(file_path) / sizeof(*file_path);
DWORD file_path_len = ARRAY_SIZE(file_path);
dispparams.cArgs = 7;
dispparams.cNamedArgs = 0;
......@@ -642,7 +642,7 @@ static BOOL try_application_url(LPCWSTR url)
static const WCHAR wszURLProtocol[] = {'U','R','L',' ','P','r','o','t','o','c','o','l',0};
hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, app, sizeof(app)/sizeof(WCHAR), NULL, 0);
hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, app, ARRAY_SIZE(app), NULL, 0);
if(FAILED(hres))
return FALSE;
......@@ -674,7 +674,7 @@ static HRESULT create_moniker(LPCWSTR url, IMoniker **mon)
if(PathIsURLW(url))
return CreateURLMoniker(NULL, url, mon);
size = sizeof(new_url)/sizeof(WCHAR);
size = ARRAY_SIZE(new_url);
hres = UrlApplySchemeW(url, new_url, &size, URL_APPLY_GUESSSCHEME | URL_APPLY_GUESSFILE | URL_APPLY_DEFAULT);
TRACE("was %s got %s\n", debugstr_w(url), debugstr_w(new_url));
if(FAILED(hres)) {
......@@ -978,7 +978,7 @@ HRESULT navigate_url(DocHost *This, LPCWSTR url, const VARIANT *Flags,
}else {
DWORD size;
size = sizeof(new_url)/sizeof(WCHAR);
size = ARRAY_SIZE(new_url);
hres = UrlApplySchemeW(url, new_url, &size,
URL_APPLY_GUESSSCHEME | URL_APPLY_GUESSFILE | URL_APPLY_DEFAULT);
if(FAILED(hres)) {
......
......@@ -385,7 +385,7 @@ static HRESULT WINAPI EnumOLEVERB_Next(IEnumOLEVERB *iface, ULONG celt, OLEVERB
if(pceltFetched)
*pceltFetched = 0;
if(This->iter == sizeof(verbs)/sizeof(*verbs))
if(This->iter == ARRAY_SIZE(verbs))
return S_FALSE;
if(celt)
......
......@@ -658,7 +658,7 @@ static HRESULT WINAPI DocObjectService_FireBeforeNavigate2(
VARIANT_BOOL cancel = VARIANT_FALSE;
SAFEARRAY *post_data;
WCHAR file_path[MAX_PATH];
DWORD file_path_len = sizeof(file_path) / sizeof(*file_path);
DWORD file_path_len = ARRAY_SIZE(file_path);
TRACE("%p %p %s %x %s %p %d %s %d %p\n", This, pDispatch, debugstr_w(lpszUrl),
dwFlags, debugstr_w(lpszFrameName), pPostData, cbPostData,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment