Commit c0ba6509 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

wshom: Use ARRAY_SIZE() macro.

parent db2a3b70
......@@ -859,7 +859,7 @@ static HRESULT WINAPI WshShortcut_get_Arguments(IWshShortcut *iface, BSTR *Argum
*Arguments = NULL;
hr = IShellLinkW_GetArguments(This->link, buffW, sizeof(buffW)/sizeof(WCHAR));
hr = IShellLinkW_GetArguments(This->link, buffW, ARRAY_SIZE(buffW));
if (FAILED(hr))
return hr;
......@@ -917,7 +917,7 @@ static HRESULT WINAPI WshShortcut_get_IconLocation(IWshShortcut *iface, BSTR *Ic
if (!IconPath)
return E_POINTER;
hr = IShellLinkW_GetIconLocation(This->link, buffW, sizeof(buffW)/sizeof(WCHAR), &icon);
hr = IShellLinkW_GetIconLocation(This->link, buffW, ARRAY_SIZE(buffW), &icon);
if (FAILED(hr)) return hr;
sprintfW(pathW, fmtW, buffW, icon);
......@@ -1006,7 +1006,7 @@ static HRESULT WINAPI WshShortcut_get_WorkingDirectory(IWshShortcut *iface, BSTR
return E_POINTER;
*WorkingDirectory = NULL;
hr = IShellLinkW_GetWorkingDirectory(This->link, buffW, sizeof(buffW)/sizeof(WCHAR));
hr = IShellLinkW_GetWorkingDirectory(This->link, buffW, ARRAY_SIZE(buffW));
if (FAILED(hr)) return hr;
*WorkingDirectory = SysAllocString(buffW);
......@@ -1395,7 +1395,7 @@ static HKEY get_root_key(const WCHAR *path)
};
int i;
for (i = 0; i < sizeof(rootkeys)/sizeof(rootkeys[0]); i++) {
for (i = 0; i < ARRAY_SIZE(rootkeys); i++) {
if (!strncmpW(path, rootkeys[i].full, strlenW(rootkeys[i].full)))
return rootkeys[i].hkey;
if (rootkeys[i].abbrev[0] && !strncmpW(path, rootkeys[i].abbrev, strlenW(rootkeys[i].abbrev)))
......
......@@ -107,7 +107,7 @@ 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]);
......
......@@ -25,6 +25,8 @@
#include "ole2.h"
#include "olectl.h"
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
/* typelibs */
typedef enum tid_t {
NULL_tid,
......
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