aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/winmm.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-04-30 12:30:02 -0700
committerChris Robinson <[email protected]>2014-04-30 12:30:02 -0700
commitf15067687326baa4ffe479e13411dbe588242e70 (patch)
tree5c5fc7a335ff1a452dfaaca12945578b9afd705c /Alc/backends/winmm.c
parentf9d70aa9ef617e5eac6715f9a55aef1fbad62dcb (diff)
Add a helper VECTOR_FOR_EACH macro
Diffstat (limited to 'Alc/backends/winmm.c')
-rw-r--r--Alc/backends/winmm.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/Alc/backends/winmm.c b/Alc/backends/winmm.c
index d274a81c..2f01ffdf 100644
--- a/Alc/backends/winmm.c
+++ b/Alc/backends/winmm.c
@@ -659,6 +659,17 @@ static ALCuint WinMMAvailableSamples(ALCdevice *Device)
}
+static inline void AppendAllDevicesList2(const al_string *name)
+{
+ if(!al_string_empty(*name))
+ AppendAllDevicesList(al_string_get_cstr(*name));
+}
+static inline void AppendCaptureDeviceList2(const al_string *name)
+{
+ if(!al_string_empty(*name))
+ AppendCaptureDeviceList(al_string_get_cstr(*name));
+}
+
static const BackendFuncs WinMMFuncs = {
WinMMOpenPlayback,
WinMMClosePlayback,
@@ -694,30 +705,16 @@ void alcWinMMDeinit()
void alcWinMMProbe(enum DevProbe type)
{
- const al_string *iter, *end;
-
switch(type)
{
case ALL_DEVICE_PROBE:
ProbePlaybackDevices();
- iter = VECTOR_ITER_BEGIN(PlaybackDevices);
- end = VECTOR_ITER_END(PlaybackDevices);
- for(;iter != end;iter++)
- {
- if(!al_string_empty(*iter))
- AppendAllDevicesList(al_string_get_cstr(*iter));
- }
+ VECTOR_FOR_EACH(const al_string, PlaybackDevices, AppendAllDevicesList2);
break;
case CAPTURE_DEVICE_PROBE:
ProbeCaptureDevices();
- iter = VECTOR_ITER_BEGIN(CaptureDevices);
- end = VECTOR_ITER_END(CaptureDevices);
- for(;iter != end;iter++)
- {
- if(!al_string_empty(*iter))
- AppendCaptureDeviceList(al_string_get_cstr(*iter));
- }
+ VECTOR_FOR_EACH(const al_string, CaptureDevices, AppendCaptureDeviceList2);
break;
}
}