Commit 53c80a2b authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

quartz: Use the ARRAY_SIZE() macro.

parent d93954bd
......@@ -794,7 +794,7 @@ static HRESULT AVISplitter_ProcessStreamList(AVISplitterImpl * This, const BYTE
case ckidSTREAMNAME:
TRACE("processing stream name\n");
/* FIXME: this doesn't exactly match native version (we omit the "##)" prefix), but hey... */
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)(pChunk + 1), pChunk->cb, piOutput.achName, sizeof(piOutput.achName) / sizeof(piOutput.achName[0]));
MultiByteToWideChar(CP_ACP, 0, (LPCSTR)(pChunk + 1), pChunk->cb, piOutput.achName, ARRAY_SIZE(piOutput.achName));
break;
case ckidSTREAMHANDLERDATA:
FIXME("process stream handler data\n");
......
......@@ -282,7 +282,7 @@ HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName, GUID *
{
HKEY hkeyMajor;
WCHAR wszMajorKeyName[CHARS_IN_GUID];
DWORD dwKeyNameLength = sizeof(wszMajorKeyName) / sizeof(wszMajorKeyName[0]);
DWORD dwKeyNameLength = ARRAY_SIZE(wszMajorKeyName);
static const WCHAR wszExtensions[] = {'E','x','t','e','n','s','i','o','n','s',0};
if (RegEnumKeyExW(hkeyMediaType, indexMajor, wszMajorKeyName, &dwKeyNameLength, NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
......@@ -304,7 +304,7 @@ HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName, GUID *
{
HKEY hkeyMinor;
WCHAR wszMinorKeyName[CHARS_IN_GUID];
DWORD dwMinorKeyNameLen = sizeof(wszMinorKeyName) / sizeof(wszMinorKeyName[0]);
DWORD dwMinorKeyNameLen = ARRAY_SIZE(wszMinorKeyName);
WCHAR wszSourceFilterKeyName[CHARS_IN_GUID];
DWORD dwSourceFilterKeyNameLen = sizeof(wszSourceFilterKeyName);
DWORD maxValueLen;
......@@ -326,7 +326,7 @@ HRESULT GetClassMediaFile(IAsyncReader * pReader, LPCOLESTR pszFileName, GUID *
DWORD dwType;
WCHAR wszValueName[14]; /* longest name we should encounter will be "Source Filter" */
LPWSTR wszPatternString = HeapAlloc(GetProcessHeap(), 0, maxValueLen);
DWORD dwValueNameLen = sizeof(wszValueName) / sizeof(wszValueName[0]); /* remember this is in chars */
DWORD dwValueNameLen = ARRAY_SIZE(wszValueName);
DWORD dwDataLen = maxValueLen; /* remember this is in bytes */
if (RegEnumValueW(hkeyMinor, indexValue, wszValueName, &dwValueNameLen, NULL, &dwType, (LPBYTE)wszPatternString, &dwDataLen) != ERROR_SUCCESS)
......
......@@ -703,7 +703,7 @@ static HRESULT WINAPI FilterMapper3_RegisterFilter(
* the + 1 is for the separator ('\\'). The -1 is
* because CHARS_IN_GUID includes the null terminator
*/
nameLen = sizeof(wszDevice)/sizeof(wszDevice[0]) + CHARS_IN_GUID - 1 + 1;
nameLen = ARRAY_SIZE(wszDevice) + CHARS_IN_GUID - 1 + 1;
if (szInstance)
nameLen += strlenW(szInstance);
......
......@@ -185,7 +185,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
if (IsEqualGUID( &IID_IClassFactory, riid ) || IsEqualGUID( &IID_IUnknown, riid))
{
for (i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++)
for (i = 0; i < ARRAY_SIZE(object_creation); i++)
{
if (IsEqualGUID(object_creation[i].clsid, rclsid))
{
......@@ -313,7 +313,7 @@ DWORD WINAPI AMGetErrorTextA(HRESULT hr, LPSTR buffer, DWORD maxlen)
if (!buffer)
return 0;
res = AMGetErrorTextW(hr, errorW, sizeof(errorW)/sizeof(*errorW));
res = AMGetErrorTextW(hr, errorW, ARRAY_SIZE(errorW));
return WideCharToMultiByte(CP_ACP, 0, errorW, res, buffer, maxlen, 0, 0);
}
......
......@@ -109,7 +109,7 @@ HRESULT Parser_Create(ParserImpl* pParser, const IBaseFilterVtbl *Parser_Vtbl, c
/* construct input pin */
piInput.dir = PINDIR_INPUT;
piInput.pFilter = &pParser->filter.IBaseFilter_iface;
lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0]));
lstrcpynW(piInput.achName, wcsInputPinName, ARRAY_SIZE(piInput.achName));
if (!start)
start = Parser_ChangeStart;
......
......@@ -1322,7 +1322,7 @@ static BOOL CALLBACK get_available_monitors_proc(HMONITOR hmon, HDC hdc, LPRECT
info->hMon = hmon;
info->dwFlags = mi.dwFlags;
lstrcpynW(info->szDevice, mi.szDevice, sizeof(info->szDevice)/sizeof(WCHAR));
lstrcpynW(info->szDevice, mi.szDevice, ARRAY_SIZE(info->szDevice));
/* FIXME: how to get these values? */
info->szDescription[0] = 0;
......@@ -1339,7 +1339,7 @@ static BOOL CALLBACK get_available_monitors_proc(HMONITOR hmon, HDC hdc, LPRECT
info->hMon = hmon;
info->dwFlags = mi.dwFlags;
lstrcpynW(info->szDevice, mi.szDevice, sizeof(info->szDevice)/sizeof(WCHAR));
lstrcpynW(info->szDevice, mi.szDevice, ARRAY_SIZE(info->szDevice));
/* FIXME: how to get these values? */
info->szDescription[0] = 0;
......@@ -2958,7 +2958,7 @@ static HRESULT VMR9_SurfaceAllocator_UpdateDeviceReset(VMR9DefaultAllocatorPrese
width = This->info.dwWidth;
height = This->info.dwHeight;
for (i = 0; i < sizeof(t_vert) / sizeof(t_vert[0]); ++i)
for (i = 0; i < ARRAY_SIZE(t_vert); ++i)
{
if (i % 2)
{
......
......@@ -254,8 +254,8 @@ static HRESULT WAVEParser_InputPin_PreConnect(IPin * iface, IPin * pConnectPin,
piOutput.dir = PINDIR_OUTPUT;
piOutput.pFilter = &pWAVEParser->Parser.filter.IBaseFilter_iface;
lstrcpynW(piOutput.achName, wcsOutputPinName, sizeof(piOutput.achName) / sizeof(piOutput.achName[0]));
lstrcpynW(piOutput.achName, wcsOutputPinName, ARRAY_SIZE(piOutput.achName));
hr = IAsyncReader_SyncRead(This->pReader, pos, sizeof(list), (BYTE *)&list);
pos += sizeof(list);
......
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