Signed-off-by: Michael Stefaniuc mstefani@winehq.org --- dlls/dsound/dsound.c | 4 ++-- dlls/dsound/propset.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c index a8b20b1dd1..6a49d638e1 100644 --- a/dlls/dsound/dsound.c +++ b/dlls/dsound/dsound.c @@ -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); } diff --git a/dlls/dsound/propset.c b/dlls/dsound/propset.c index 9ef4ac9fbc..0272ac001f 100644 --- a/dlls/dsound/propset.c +++ b/dlls/dsound/propset.c @@ -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;
Signed-off-by: Andrew Eikum aeikum@codeweavers.com
On Wed, Aug 08, 2018 at 11:30:06AM +0200, Michael Stefaniuc wrote:
Signed-off-by: Michael Stefaniuc mstefani@winehq.org
dlls/dsound/dsound.c | 4 ++-- dlls/dsound/propset.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c index a8b20b1dd1..6a49d638e1 100644 --- a/dlls/dsound/dsound.c +++ b/dlls/dsound/dsound.c @@ -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);
} diff --git a/dlls/dsound/propset.c b/dlls/dsound/propset.c index 9ef4ac9fbc..0272ac001f 100644 --- a/dlls/dsound/propset.c +++ b/dlls/dsound/propset.c @@ -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;
-- 2.14.4