diff options
author | Chris Robinson <[email protected]> | 2016-07-26 11:45:20 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-07-26 12:02:03 -0700 |
commit | 5e11a738c6b18a367070450ec46dfb714fe433d7 (patch) | |
tree | bb298e6d200b486067c34c7496f6c638169f2a8e /Alc/backends/qsa.c | |
parent | d2eb866abeb699394a35610b4764c8e42acc71b5 (diff) |
Combine VECTOR_RESIZE and VECTOR_RESERVE
Diffstat (limited to 'Alc/backends/qsa.c')
-rw-r--r-- | Alc/backends/qsa.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Alc/backends/qsa.c b/Alc/backends/qsa.c index a1fbce63..b7923517 100644 --- a/Alc/backends/qsa.c +++ b/Alc/backends/qsa.c @@ -117,8 +117,7 @@ static void deviceList(int type, vector_DevMap *devmap) if(max_cards < 0) return; - VECTOR_RESERVE(*devmap, max_cards+1); - VECTOR_RESIZE(*devmap, 0); + VECTOR_RESIZE(*devmap, 0, max_cards+1); entry.name = strdup(qsaDevice); entry.card = 0; @@ -893,8 +892,8 @@ void alc_qsa_probe(enum DevProbe type) case ALL_DEVICE_PROBE: #define FREE_NAME(iter) free((iter)->name) VECTOR_FOR_EACH(DevMap, DeviceNameMap, FREE_NAME); + VECTOR_RESIZE(DeviceNameMap, 0, 0); #undef FREE_NAME - VECTOR_RESIZE(DeviceNameMap, 0); deviceList(SND_PCM_CHANNEL_PLAYBACK, &DeviceNameMap); #define APPEND_DEVICE(iter) AppendAllDevicesList((iter)->name) @@ -905,8 +904,8 @@ void alc_qsa_probe(enum DevProbe type) case CAPTURE_DEVICE_PROBE: #define FREE_NAME(iter) free((iter)->name) VECTOR_FOR_EACH(DevMap, CaptureNameMap, FREE_NAME); + VECTOR_RESIZE(CaptureNameMap, 0, 0); #undef FREE_NAME - VECTOR_RESIZE(CaptureNameMap, 0); deviceList(SND_PCM_CHANNEL_CAPTURE, &CaptureNameMap); #define APPEND_DEVICE(iter) AppendCaptureDeviceList((iter)->name) |