winmm/tests: Use the available ARRAY_SIZE() macro.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2018-06-13 20:30:27 +02:00 committed by Alexandre Julliard
parent b400d4326d
commit 3f4906d19d
3 changed files with 4 additions and 4 deletions

View File

@ -139,7 +139,7 @@ static void test_api(void)
/* Try some unusual period values for joySetCapture and unusual threshold values for joySetThreshold.
* Windows XP allows almost all test values, Windows 8 will return error on most test values, Windows
* 98 allows anything but cuts the values to their maximum supported values internally. */
for (i = 0; i < sizeof(period) / sizeof(period[0]); i++)
for (i = 0; i < ARRAY_SIZE(period); i++)
{
ret = joySetCapture(window, joyid, period[i], FALSE);
if (win8 && ((1 << i) & period_win8_error))
@ -190,7 +190,7 @@ static void test_api(void)
ok(ret == JOYERR_NOERROR, "Expected %d, got %d\n", JOYERR_NOERROR, ret);
infoex.ex.dwSize = sizeof(infoex.ex);
for (i = 0; i < sizeof(flags) / sizeof(flags[0]); i++)
for (i = 0; i < ARRAY_SIZE(flags); i++)
{
infoex.ex.dwFlags = flags[i];
ret = joyGetPosEx(joyid, &infoex.ex);

View File

@ -549,7 +549,7 @@ static void CALLBACK time_stamp_callback(HMIDIOUT hmo, UINT msg, DWORD_PTR insta
struct time_stamp_records *records = (struct time_stamp_records *)instance;
switch (msg) {
case MM_MOM_POSITIONCB:
if (records->count < sizeof(records->time_stamp)/sizeof(records->time_stamp[0]))
if (records->count < ARRAY_SIZE(records->time_stamp))
records->time_stamp[records->count] = GetTickCount();
records->count++;
break;

View File

@ -606,7 +606,7 @@ static LRESULT CALLBACK mmio_test_IOProc(LPSTR lpMMIOInfo, UINT uMessage, LPARAM
case MMIOM_OPEN:
if (lpInfo->fccIOProc == FOURCC_DOS)
lpInfo->fccIOProc = mmioFOURCC('F', 'A', 'I', 'L');
for (i = 0; i < sizeof(lpInfo->adwInfo) / sizeof(*lpInfo->adwInfo); i++)
for (i = 0; i < ARRAY_SIZE(lpInfo->adwInfo); i++)
ok(lpInfo->adwInfo[i] == 0, "[%d] Expected 0, got %u\n", i, lpInfo->adwInfo[i]);
return MMSYSERR_NOERROR;
case MMIOM_CLOSE: