Commit a486cd78 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

mmdevapi: Use the ARRAY_SIZE() macro.

parent 169c033b
...@@ -338,7 +338,7 @@ static MMDevice *MMDevice_Create(WCHAR *name, GUID *id, EDataFlow flow, DWORD st ...@@ -338,7 +338,7 @@ static MMDevice *MMDevice_Create(WCHAR *name, GUID *id, EDataFlow flow, DWORD st
cur->state = state; cur->state = state;
cur->devguid = *id; cur->devguid = *id;
StringFromGUID2(&cur->devguid, guidstr, sizeof(guidstr)/sizeof(*guidstr)); StringFromGUID2(&cur->devguid, guidstr, ARRAY_SIZE(guidstr));
if (flow == eRender) if (flow == eRender)
root = key_render; root = key_render;
...@@ -429,7 +429,7 @@ static HRESULT load_devices_from_reg(void) ...@@ -429,7 +429,7 @@ static HRESULT load_devices_from_reg(void)
DWORD len; DWORD len;
PROPVARIANT pv = { VT_EMPTY }; PROPVARIANT pv = { VT_EMPTY };
len = sizeof(guidvalue)/sizeof(guidvalue[0]); len = ARRAY_SIZE(guidvalue);
ret = RegEnumKeyExW(cur, i++, guidvalue, &len, NULL, NULL, NULL, NULL); ret = RegEnumKeyExW(cur, i++, guidvalue, &len, NULL, NULL, NULL, NULL);
if (ret == ERROR_NO_MORE_ITEMS) if (ret == ERROR_NO_MORE_ITEMS)
{ {
...@@ -1395,7 +1395,7 @@ static HRESULT WINAPI MMDevPropStore_GetCount(IPropertyStore *iface, DWORD *npro ...@@ -1395,7 +1395,7 @@ static HRESULT WINAPI MMDevPropStore_GetCount(IPropertyStore *iface, DWORD *npro
return hr; return hr;
*nprops = 0; *nprops = 0;
do { do {
DWORD len = sizeof(buffer)/sizeof(*buffer); DWORD len = ARRAY_SIZE(buffer);
if (RegEnumValueW(propkey, i, buffer, &len, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) if (RegEnumValueW(propkey, i, buffer, &len, NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
break; break;
i++; i++;
...@@ -1410,7 +1410,7 @@ static HRESULT WINAPI MMDevPropStore_GetAt(IPropertyStore *iface, DWORD prop, PR ...@@ -1410,7 +1410,7 @@ static HRESULT WINAPI MMDevPropStore_GetAt(IPropertyStore *iface, DWORD prop, PR
{ {
MMDevPropStore *This = impl_from_IPropertyStore(iface); MMDevPropStore *This = impl_from_IPropertyStore(iface);
WCHAR buffer[50]; WCHAR buffer[50];
DWORD len = sizeof(buffer)/sizeof(*buffer); DWORD len = ARRAY_SIZE(buffer);
HRESULT hr; HRESULT hr;
HKEY propkey; HKEY propkey;
...@@ -1530,7 +1530,7 @@ static HRESULT WINAPI PB_Read(IPropertyBag *iface, LPCOLESTR name, VARIANT *var, ...@@ -1530,7 +1530,7 @@ static HRESULT WINAPI PB_Read(IPropertyBag *iface, LPCOLESTR name, VARIANT *var,
if (!lstrcmpW(name, dsguid)) if (!lstrcmpW(name, dsguid))
{ {
WCHAR guidstr[39]; WCHAR guidstr[39];
StringFromGUID2(&This->devguid, guidstr,sizeof(guidstr)/sizeof(*guidstr)); StringFromGUID2(&This->devguid, guidstr,ARRAY_SIZE(guidstr));
var->n1.n2.vt = VT_BSTR; var->n1.n2.vt = VT_BSTR;
var->n1.n2.n3.bstrVal = SysAllocString(guidstr); var->n1.n2.n3.bstrVal = SysAllocString(guidstr);
return S_OK; return S_OK;
......
...@@ -295,7 +295,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) ...@@ -295,7 +295,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
return E_NOINTERFACE; return E_NOINTERFACE;
} }
for (i = 0; i < sizeof(MMDEVAPI_CF)/sizeof(MMDEVAPI_CF[0]); ++i) for (i = 0; i < ARRAY_SIZE(MMDEVAPI_CF); ++i)
{ {
if (IsEqualGUID(rclsid, MMDEVAPI_CF[i].rclsid)) { if (IsEqualGUID(rclsid, MMDEVAPI_CF[i].rclsid)) {
IClassFactory_AddRef(&MMDEVAPI_CF[i].IClassFactory_iface); IClassFactory_AddRef(&MMDEVAPI_CF[i].IClassFactory_iface);
......
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