Commit f00c5c2a authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

wineoss.drv: Use the ARRAY_SIZE() macro.

parent 552f7f7c
...@@ -230,9 +230,8 @@ static LRESULT OSS_MidiInit(void) ...@@ -230,9 +230,8 @@ static LRESULT OSS_MidiInit(void)
MidiOutDev[i].caps.wTechnology = MOD_MIDIPORT; MidiOutDev[i].caps.wTechnology = MOD_MIDIPORT;
MidiOutDev[i].bEnabled = FALSE; MidiOutDev[i].bEnabled = FALSE;
} else { } else {
MultiByteToWideChar( CP_UNIXCP, 0, sinfo.name, -1, MultiByteToWideChar(CP_UNIXCP, 0, sinfo.name, -1, MidiOutDev[i].caps.szPname,
MidiOutDev[i].caps.szPname, ARRAY_SIZE(MidiOutDev[i].caps.szPname));
sizeof(MidiOutDev[i].caps.szPname)/sizeof(WCHAR) );
MidiOutDev[i].caps.wTechnology = MIDI_UnixToWindowsDeviceType(sinfo.synth_type); MidiOutDev[i].caps.wTechnology = MIDI_UnixToWindowsDeviceType(sinfo.synth_type);
if (MOD_MIDIPORT != MidiOutDev[i].caps.wTechnology) { if (MOD_MIDIPORT != MidiOutDev[i].caps.wTechnology) {
...@@ -313,7 +312,7 @@ static LRESULT OSS_MidiInit(void) ...@@ -313,7 +312,7 @@ static LRESULT OSS_MidiInit(void)
} else { } else {
MultiByteToWideChar(CP_UNIXCP, 0, minfo.name, -1, MultiByteToWideChar(CP_UNIXCP, 0, minfo.name, -1,
MidiOutDev[numsynthdevs + i].caps.szPname, 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].bEnabled = TRUE;
} }
MidiOutDev[numsynthdevs + i].caps.wTechnology = MOD_MIDIPORT; MidiOutDev[numsynthdevs + i].caps.wTechnology = MOD_MIDIPORT;
...@@ -338,9 +337,8 @@ static LRESULT OSS_MidiInit(void) ...@@ -338,9 +337,8 @@ static LRESULT OSS_MidiInit(void)
wsprintfW(MidiInDev[i].caps.szPname, fmt, numsynthdevs + i); wsprintfW(MidiInDev[i].caps.szPname, fmt, numsynthdevs + i);
MidiInDev[i].state = -1; MidiInDev[i].state = -1;
} else { } else {
MultiByteToWideChar(CP_UNIXCP, 0, minfo.name, -1, MultiByteToWideChar(CP_UNIXCP, 0, minfo.name, -1, MidiInDev[i].caps.szPname,
MidiInDev[i].caps.szPname, ARRAY_SIZE(MidiInDev[i].caps.szPname));
sizeof(MidiInDev[i].caps.szPname) / sizeof(WCHAR));
MidiInDev[i].state = 0; MidiInDev[i].state = 0;
} }
MidiInDev[i].caps.dwSupport = 0; /* mandatory with MIDIINCAPS */ MidiInDev[i].caps.dwSupport = 0; /* mandatory with MIDIINCAPS */
......
...@@ -349,8 +349,7 @@ static void get_device_guid(EDataFlow flow, const char *device, GUID *guid) ...@@ -349,8 +349,7 @@ static void get_device_guid(EDataFlow flow, const char *device, GUID *guid)
else else
key_name[0] = '0'; key_name[0] = '0';
key_name[1] = ','; key_name[1] = ',';
MultiByteToWideChar(CP_UNIXCP, 0, device, -1, key_name + 2, MultiByteToWideChar(CP_UNIXCP, 0, device, -1, key_name + 2, ARRAY_SIZE(key_name) - 2);
(sizeof(key_name) / sizeof(*key_name)) - 2);
if(RegOpenKeyExW(HKEY_CURRENT_USER, drv_key_devicesW, 0, KEY_WRITE|KEY_READ, &key) == ERROR_SUCCESS){ 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){ 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, ...@@ -543,11 +542,11 @@ HRESULT WINAPI AUDDRV_GetEndpointIDs(EDataFlow flow, WCHAR ***ids, GUID **guids,
len = MultiByteToWideChar(CP_UNIXCP, 0, ai.name, -1, NULL, 0); len = MultiByteToWideChar(CP_UNIXCP, 0, ai.name, -1, NULL, 0);
if(flow == eRender){ if(flow == eRender){
prefix = outW; prefix = outW;
prefix_len = (sizeof(outW) / sizeof(*outW)) - 1; prefix_len = ARRAY_SIZE(outW) - 1;
len += prefix_len; len += prefix_len;
}else{ }else{
prefix = inW; prefix = inW;
prefix_len = (sizeof(inW) / sizeof(*inW)) - 1; prefix_len = ARRAY_SIZE(inW) - 1;
len += prefix_len; len += prefix_len;
} }
(*ids)[*num] = HeapAlloc(GetProcessHeap(), 0, (*ids)[*num] = HeapAlloc(GetProcessHeap(), 0,
......
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