wineoss.drv: 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-09 20:59:33 +02:00 committed by Alexandre Julliard
parent 552f7f7c45
commit f00c5c2a37
2 changed files with 8 additions and 11 deletions

View File

@ -230,9 +230,8 @@ static LRESULT OSS_MidiInit(void)
MidiOutDev[i].caps.wTechnology = MOD_MIDIPORT;
MidiOutDev[i].bEnabled = FALSE;
} else {
MultiByteToWideChar( CP_UNIXCP, 0, sinfo.name, -1,
MidiOutDev[i].caps.szPname,
sizeof(MidiOutDev[i].caps.szPname)/sizeof(WCHAR) );
MultiByteToWideChar(CP_UNIXCP, 0, sinfo.name, -1, MidiOutDev[i].caps.szPname,
ARRAY_SIZE(MidiOutDev[i].caps.szPname));
MidiOutDev[i].caps.wTechnology = MIDI_UnixToWindowsDeviceType(sinfo.synth_type);
if (MOD_MIDIPORT != MidiOutDev[i].caps.wTechnology) {
@ -313,7 +312,7 @@ static LRESULT OSS_MidiInit(void)
} else {
MultiByteToWideChar(CP_UNIXCP, 0, minfo.name, -1,
MidiOutDev[numsynthdevs + i].caps.szPname,
sizeof(MidiOutDev[numsynthdevs + i].caps.szPname) / sizeof(WCHAR));
ARRAY_SIZE(MidiOutDev[numsynthdevs + i].caps.szPname));
MidiOutDev[numsynthdevs + i].bEnabled = TRUE;
}
MidiOutDev[numsynthdevs + i].caps.wTechnology = MOD_MIDIPORT;
@ -338,9 +337,8 @@ static LRESULT OSS_MidiInit(void)
wsprintfW(MidiInDev[i].caps.szPname, fmt, numsynthdevs + i);
MidiInDev[i].state = -1;
} else {
MultiByteToWideChar(CP_UNIXCP, 0, minfo.name, -1,
MidiInDev[i].caps.szPname,
sizeof(MidiInDev[i].caps.szPname) / sizeof(WCHAR));
MultiByteToWideChar(CP_UNIXCP, 0, minfo.name, -1, MidiInDev[i].caps.szPname,
ARRAY_SIZE(MidiInDev[i].caps.szPname));
MidiInDev[i].state = 0;
}
MidiInDev[i].caps.dwSupport = 0; /* mandatory with MIDIINCAPS */

View File

@ -349,8 +349,7 @@ static void get_device_guid(EDataFlow flow, const char *device, GUID *guid)
else
key_name[0] = '0';
key_name[1] = ',';
MultiByteToWideChar(CP_UNIXCP, 0, device, -1, key_name + 2,
(sizeof(key_name) / sizeof(*key_name)) - 2);
MultiByteToWideChar(CP_UNIXCP, 0, device, -1, key_name + 2, ARRAY_SIZE(key_name) - 2);
if(RegOpenKeyExW(HKEY_CURRENT_USER, drv_key_devicesW, 0, KEY_WRITE|KEY_READ, &key) == ERROR_SUCCESS){
if(RegOpenKeyExW(key, key_name, 0, KEY_READ, &dev_key) == ERROR_SUCCESS){
@ -543,11 +542,11 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, GUID **guids,
len = MultiByteToWideChar(CP_UNIXCP, 0, ai.name, -1, NULL, 0);
if(flow == eRender){
prefix = outW;
prefix_len = (sizeof(outW) / sizeof(*outW)) - 1;
prefix_len = ARRAY_SIZE(outW) - 1;
len += prefix_len;
}else{
prefix = inW;
prefix_len = (sizeof(inW) / sizeof(*inW)) - 1;
prefix_len = ARRAY_SIZE(inW) - 1;
len += prefix_len;
}
(*ids)[*num] = HeapAlloc(GetProcessHeap(), 0,