clang-format: Apply formatting

Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
This commit is contained in:
jp9000 committed 2019-06-23 23:49:10 -07:00
1 parent 53615ee10f
commit f53df7da64
567 files changed
+34068 -32903

No files matched your search

+15 -13
View File
@@ -24,11 +24,12 @@ string GetDeviceName(IMMDevice *device)
size_t len = wcslen(nameVar.pwszVal);
size_t size;
size = os_wcs_to_utf8(nameVar.pwszVal, len,
nullptr, 0) + 1;
size = os_wcs_to_utf8(nameVar.pwszVal, len, nullptr,
0) +
1;
device_name.resize(size);
os_wcs_to_utf8(nameVar.pwszVal, len,
&device_name[0], size);
os_wcs_to_utf8(nameVar.pwszVal, len, &device_name[0],
size);
}
}
@@ -43,13 +44,14 @@ void GetWASAPIAudioDevices_(vector<AudioDeviceInfo> &devices, bool input)
HRESULT res;
res = CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL, CLSCTX_ALL,
__uuidof(IMMDeviceEnumerator),
(void**)enumerator.Assign());
__uuidof(IMMDeviceEnumerator),
(void **)enumerator.Assign());
if (FAILED(res))
throw HRError("Failed to create enumerator", res);
res = enumerator->EnumAudioEndpoints(input ? eCapture : eRender,
DEVICE_STATE_ACTIVE, collection.Assign());
DEVICE_STATE_ACTIVE,
collection.Assign());
if (FAILED(res))
throw HRError("Failed to enumerate devices", res);
@@ -58,10 +60,10 @@ void GetWASAPIAudioDevices_(vector<AudioDeviceInfo> &devices, bool input)
throw HRError("Failed to get device count", res);
for (UINT i = 0; i < count; i++) {
ComPtr<IMMDevice> device;
ComPtr<IMMDevice> device;
CoTaskMemPtr<WCHAR> w_id;
AudioDeviceInfo info;
size_t len, size;
AudioDeviceInfo info;
size_t len, size;
res = collection->Item(i, device.Assign());
if (FAILED(res))
@@ -73,7 +75,7 @@ void GetWASAPIAudioDevices_(vector<AudioDeviceInfo> &devices, bool input)
info.name = GetDeviceName(device);
len = wcslen(w_id);
len = wcslen(w_id);
size = os_wcs_to_utf8(w_id, len, nullptr, 0) + 1;
info.id.resize(size);
os_wcs_to_utf8(w_id, len, &info.id[0], size);
@@ -90,7 +92,7 @@ void GetWASAPIAudioDevices(vector<AudioDeviceInfo> &devices, bool input)
GetWASAPIAudioDevices_(devices, input);
} catch (HRError error) {
blog(LOG_WARNING, "[GetWASAPIAudioDevices] %s: %lX",
error.str, error.hr);
blog(LOG_WARNING, "[GetWASAPIAudioDevices] %s: %lX", error.str,
error.hr);
}
}