dsound: Use the 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-08-08 11:30:06 +02:00 committed by Alexandre Julliard
parent f26168e494
commit c4fdcf3eca
2 changed files with 4 additions and 4 deletions

View File

@ -85,7 +85,7 @@ static void _dump_DSCAPS(DWORD xmask) {
};
unsigned int i;
for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
for (i = 0; i < ARRAY_SIZE(flags); i++)
if ((flags[i].mask & xmask) == flags[i].mask)
TRACE("%s ",flags[i].name);
}
@ -113,7 +113,7 @@ static void _dump_DSBCAPS(DWORD xmask) {
};
unsigned int i;
for (i=0;i<sizeof(flags)/sizeof(flags[0]);i++)
for (i = 0; i < ARRAY_SIZE(flags); i++)
if ((flags[i].mask & xmask) == flags[i].mask)
TRACE("%s ",flags[i].name);
}

View File

@ -361,8 +361,8 @@ static void DSPROPERTY_descWto1(const DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1_DATA *data1)
{
data1->DeviceId = dataW->DeviceId;
lstrcpynW(data1->ModuleW, dataW->Module, sizeof(data1->ModuleW)/sizeof(*data1->ModuleW));
lstrcpynW(data1->DescriptionW, dataW->Description, sizeof(data1->DescriptionW)/sizeof(*data1->DescriptionW));
lstrcpynW(data1->ModuleW, dataW->Module, ARRAY_SIZE(data1->ModuleW));
lstrcpynW(data1->DescriptionW, dataW->Description, ARRAY_SIZE(data1->DescriptionW));
WideCharToMultiByte(CP_ACP, 0, data1->DescriptionW, -1, data1->DescriptionA, sizeof(data1->DescriptionA)-1, NULL, NULL);
WideCharToMultiByte(CP_ACP, 0, data1->ModuleW, -1, data1->ModuleA, sizeof(data1->ModuleA)-1, NULL, NULL);
data1->DescriptionA[sizeof(data1->DescriptionA)-1] = 0;