diff options
author | Chris Robinson <[email protected]> | 2014-12-21 10:45:10 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-12-21 10:45:10 -0800 |
commit | 13092d94b74da1f42abf5f35e211b33ebf37207a (patch) | |
tree | 92214c7d1edf5df1cfdbeade0d6f11014856ce99 /Alc | |
parent | 28a9f0826c8ab7a645d1cd60151d6590ec490c1b (diff) |
Use VECTOR_FOR_EACH instead of a manual loop
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/backends/mmdevapi.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c index c5e5f87e..17f94c23 100644 --- a/Alc/backends/mmdevapi.c +++ b/Alc/backends/mmdevapi.c @@ -70,16 +70,14 @@ TYPEDEF_VECTOR(DevMap, vector_DevMap) static void clear_devlist(vector_DevMap *list) { - DevMap *iter, *end; - - iter = VECTOR_ITER_BEGIN(*list); - end = VECTOR_ITER_END(*list); - for(;iter != end;iter++) - { - AL_STRING_DEINIT(iter->name); - free(iter->devid); - } +#define CLEAR_DEVMAP(i) do { \ + AL_STRING_DEINIT((i)->name); \ + free((i)->devid); \ + (i)->devid = NULL; \ +} while(0) + VECTOR_FOR_EACH(DevMap, *list, CLEAR_DEVMAP); VECTOR_RESIZE(*list, 0); +#undef CLEAR_DEVMAP } static vector_DevMap PlaybackDevices; |