aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-04-15 12:22:54 -0700
committerChris Robinson <[email protected]>2016-04-15 12:22:54 -0700
commitf4ff5fc106f39ad30cdf72eade4bade649777a85 (patch)
tree2e52d33715b9c2e4a59acb96c04aa334b1bec380 /Alc
parentd5e624391ba712779e41f2719b47bbbaca588b50 (diff)
Shorten VECTOR_ITER_ macros to VECTOR_
Diffstat (limited to 'Alc')
-rw-r--r--Alc/backends/alsa.c19
-rw-r--r--Alc/backends/dsound.c6
-rw-r--r--Alc/backends/mmdevapi.c6
-rw-r--r--Alc/backends/pulseaudio.c12
-rw-r--r--Alc/backends/qsa.c4
-rw-r--r--Alc/backends/winmm.c12
-rw-r--r--Alc/helpers.c42
-rw-r--r--Alc/hrtf.c6
-rw-r--r--Alc/vector.h20
9 files changed, 62 insertions, 65 deletions
diff --git a/Alc/backends/alsa.c b/Alc/backends/alsa.c
index 3b37f3ca..7d23ecc3 100644
--- a/Alc/backends/alsa.c
+++ b/Alc/backends/alsa.c
@@ -237,16 +237,13 @@ static vector_DevMap CaptureDevices;
static void clear_devlist(vector_DevMap *devlist)
{
- DevMap *iter, *end;
-
- iter = VECTOR_ITER_BEGIN(*devlist);
- end = VECTOR_ITER_END(*devlist);
- for(;iter != end;iter++)
- {
- AL_STRING_DEINIT(iter->name);
- AL_STRING_DEINIT(iter->device_name);
- }
+#define FREE_DEV(i) do { \
+ AL_STRING_DEINIT((i)->name); \
+ AL_STRING_DEINIT((i)->device_name); \
+} while(0)
+ VECTOR_FOR_EACH(DevMap, *devlist, FREE_DEV);
VECTOR_RESIZE(*devlist, 0);
+#undef FREE_DEV
}
@@ -635,7 +632,7 @@ static ALCenum ALCplaybackAlsa_open(ALCplaybackAlsa *self, const ALCchar *name)
#define MATCH_NAME(i) (al_string_cmp_cstr((i)->name, name) == 0)
VECTOR_FIND_IF(iter, const DevMap, PlaybackDevices, MATCH_NAME);
#undef MATCH_NAME
- if(iter == VECTOR_ITER_END(PlaybackDevices))
+ if(iter == VECTOR_END(PlaybackDevices))
return ALC_INVALID_VALUE;
driver = al_string_get_cstr(iter->device_name);
}
@@ -969,7 +966,7 @@ static ALCenum ALCcaptureAlsa_open(ALCcaptureAlsa *self, const ALCchar *name)
#define MATCH_NAME(i) (al_string_cmp_cstr((i)->name, name) == 0)
VECTOR_FIND_IF(iter, const DevMap, CaptureDevices, MATCH_NAME);
#undef MATCH_NAME
- if(iter == VECTOR_ITER_END(CaptureDevices))
+ if(iter == VECTOR_END(CaptureDevices))
return ALC_INVALID_VALUE;
driver = al_string_get_cstr(iter->device_name);
}
diff --git a/Alc/backends/dsound.c b/Alc/backends/dsound.c
index 68ac08f1..454f7fa0 100644
--- a/Alc/backends/dsound.c
+++ b/Alc/backends/dsound.c
@@ -156,7 +156,7 @@ static BOOL CALLBACK DSoundEnumDevices(GUID *guid, const WCHAR *desc, const WCHA
#define MATCH_ENTRY(i) (al_string_cmp(entry.name, (i)->name) == 0)
VECTOR_FIND_IF(iter, const DevMap, *devices, MATCH_ENTRY);
- if(iter == VECTOR_ITER_END(*devices)) break;
+ if(iter == VECTOR_END(*devices)) break;
#undef MATCH_ENTRY
count++;
}
@@ -351,7 +351,7 @@ static ALCenum ALCdsoundPlayback_open(ALCdsoundPlayback *self, const ALCchar *de
#define MATCH_NAME(i) (al_string_cmp_cstr((i)->name, deviceName) == 0)
VECTOR_FIND_IF(iter, const DevMap, PlaybackDevices, MATCH_NAME);
#undef MATCH_NAME
- if(iter == VECTOR_ITER_END(PlaybackDevices))
+ if(iter == VECTOR_END(PlaybackDevices))
return ALC_INVALID_VALUE;
guid = &iter->guid;
}
@@ -712,7 +712,7 @@ static ALCenum ALCdsoundCapture_open(ALCdsoundCapture *self, const ALCchar *devi
#define MATCH_NAME(i) (al_string_cmp_cstr((i)->name, deviceName) == 0)
VECTOR_FIND_IF(iter, const DevMap, CaptureDevices, MATCH_NAME);
#undef MATCH_NAME
- if(iter == VECTOR_ITER_END(CaptureDevices))
+ if(iter == VECTOR_END(CaptureDevices))
return ALC_INVALID_VALUE;
guid = &iter->guid;
}
diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c
index c47ddee6..8851678b 100644
--- a/Alc/backends/mmdevapi.c
+++ b/Alc/backends/mmdevapi.c
@@ -211,7 +211,7 @@ static void add_device(IMMDevice *device, LPCWSTR devid, vector_DevMap *list)
#define MATCH_ENTRY(i) (al_string_cmp(entry.name, (i)->name) == 0)
VECTOR_FIND_IF(iter, const DevMap, *list, MATCH_ENTRY);
- if(iter == VECTOR_ITER_END(*list)) break;
+ if(iter == VECTOR_END(*list)) break;
#undef MATCH_ENTRY
count++;
}
@@ -696,7 +696,7 @@ static ALCenum ALCmmdevPlayback_open(ALCmmdevPlayback *self, const ALCchar *devi
hr = E_FAIL;
#define MATCH_NAME(i) (al_string_cmp_cstr((i)->name, deviceName) == 0)
VECTOR_FIND_IF(iter, const DevMap, PlaybackDevices, MATCH_NAME);
- if(iter == VECTOR_ITER_END(PlaybackDevices))
+ if(iter == VECTOR_END(PlaybackDevices))
WARN("Failed to find device name matching \"%s\"\n", deviceName);
else
{
@@ -1332,7 +1332,7 @@ static ALCenum ALCmmdevCapture_open(ALCmmdevCapture *self, const ALCchar *device
hr = E_FAIL;
#define MATCH_NAME(i) (al_string_cmp_cstr((i)->name, deviceName) == 0)
VECTOR_FIND_IF(iter, const DevMap, CaptureDevices, MATCH_NAME);
- if(iter == VECTOR_ITER_END(CaptureDevices))
+ if(iter == VECTOR_END(CaptureDevices))
WARN("Failed to find device name matching \"%s\"\n", deviceName);
else
{
diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c
index ca8441aa..ccce2e00 100644
--- a/Alc/backends/pulseaudio.c
+++ b/Alc/backends/pulseaudio.c
@@ -527,7 +527,7 @@ static void ALCpulsePlayback_deviceCallback(pa_context *UNUSED(context), const p
#define MATCH_INFO_NAME(iter) (al_string_cmp_cstr((iter)->device_name, info->name) == 0)
VECTOR_FIND_IF(iter, const DevMap, PlaybackDevices, MATCH_INFO_NAME);
- if(iter != VECTOR_ITER_END(PlaybackDevices)) return;
+ if(iter != VECTOR_END(PlaybackDevices)) return;
#undef MATCH_INFO_NAME
AL_STRING_INIT(entry.name);
@@ -548,7 +548,7 @@ static void ALCpulsePlayback_deviceCallback(pa_context *UNUSED(context), const p
#define MATCH_ENTRY(i) (al_string_cmp(entry.name, (i)->name) == 0)
VECTOR_FIND_IF(iter, const DevMap, PlaybackDevices, MATCH_ENTRY);
- if(iter == VECTOR_ITER_END(PlaybackDevices)) break;
+ if(iter == VECTOR_END(PlaybackDevices)) break;
#undef MATCH_ENTRY
count++;
}
@@ -861,7 +861,7 @@ static ALCenum ALCpulsePlayback_open(ALCpulsePlayback *self, const ALCchar *name
#define MATCH_NAME(iter) (al_string_cmp_cstr((iter)->name, name) == 0)
VECTOR_FIND_IF(iter, const DevMap, PlaybackDevices, MATCH_NAME);
#undef MATCH_NAME
- if(iter == VECTOR_ITER_END(PlaybackDevices))
+ if(iter == VECTOR_END(PlaybackDevices))
return ALC_INVALID_VALUE;
pulse_name = al_string_get_cstr(iter->device_name);
dev_name = iter->name;
@@ -1247,7 +1247,7 @@ static void ALCpulseCapture_deviceCallback(pa_context *UNUSED(context), const pa
#define MATCH_INFO_NAME(iter) (al_string_cmp_cstr((iter)->device_name, info->name) == 0)
VECTOR_FIND_IF(iter, const DevMap, CaptureDevices, MATCH_INFO_NAME);
- if(iter != VECTOR_ITER_END(CaptureDevices)) return;
+ if(iter != VECTOR_END(CaptureDevices)) return;
#undef MATCH_INFO_NAME
AL_STRING_INIT(entry.name);
@@ -1268,7 +1268,7 @@ static void ALCpulseCapture_deviceCallback(pa_context *UNUSED(context), const pa
#define MATCH_ENTRY(i) (al_string_cmp(entry.name, (i)->name) == 0)
VECTOR_FIND_IF(iter, const DevMap, CaptureDevices, MATCH_ENTRY);
- if(iter == VECTOR_ITER_END(CaptureDevices)) break;
+ if(iter == VECTOR_END(CaptureDevices)) break;
#undef MATCH_ENTRY
count++;
}
@@ -1439,7 +1439,7 @@ static ALCenum ALCpulseCapture_open(ALCpulseCapture *self, const ALCchar *name)
#define MATCH_NAME(iter) (al_string_cmp_cstr((iter)->name, name) == 0)
VECTOR_FIND_IF(iter, const DevMap, CaptureDevices, MATCH_NAME);
#undef MATCH_NAME
- if(iter == VECTOR_ITER_END(CaptureDevices))
+ if(iter == VECTOR_END(CaptureDevices))
return ALC_INVALID_VALUE;
pulse_name = al_string_get_cstr(iter->device_name);
al_string_copy(&device->DeviceName, iter->name);
diff --git a/Alc/backends/qsa.c b/Alc/backends/qsa.c
index 291e49fc..a1fbce63 100644
--- a/Alc/backends/qsa.c
+++ b/Alc/backends/qsa.c
@@ -277,7 +277,7 @@ static ALCenum qsa_open_playback(ALCdevice* device, const ALCchar* deviceName)
#define MATCH_DEVNAME(iter) ((iter)->name && strcmp(deviceName, (iter)->name)==0)
VECTOR_FIND_IF(iter, const DevMap, DeviceNameMap, MATCH_DEVNAME);
#undef MATCH_DEVNAME
- if(iter == VECTOR_ITER_END(DeviceNameMap))
+ if(iter == VECTOR_END(DeviceNameMap))
{
free(data);
return ALC_INVALID_DEVICE;
@@ -624,7 +624,7 @@ static ALCenum qsa_open_capture(ALCdevice* device, const ALCchar* deviceName)
#define MATCH_DEVNAME(iter) ((iter)->name && strcmp(deviceName, (iter)->name)==0)
VECTOR_FIND_IF(iter, const DevMap, CaptureNameMap, MATCH_DEVNAME);
#undef MATCH_DEVNAME
- if(iter == VECTOR_ITER_END(CaptureNameMap))
+ if(iter == VECTOR_END(CaptureNameMap))
{
free(data);
return ALC_INVALID_DEVICE;
diff --git a/Alc/backends/winmm.c b/Alc/backends/winmm.c
index 0085251d..664b3dfe 100644
--- a/Alc/backends/winmm.c
+++ b/Alc/backends/winmm.c
@@ -83,7 +83,7 @@ static void ProbePlaybackDevices(void)
#define MATCH_ENTRY(i) (al_string_cmp(dname, *(i)) == 0)
VECTOR_FIND_IF(iter, const al_string, PlaybackDevices, MATCH_ENTRY);
- if(iter == VECTOR_ITER_END(PlaybackDevices)) break;
+ if(iter == VECTOR_END(PlaybackDevices)) break;
#undef MATCH_ENTRY
}
@@ -126,7 +126,7 @@ static void ProbeCaptureDevices(void)
#define MATCH_ENTRY(i) (al_string_cmp(dname, *(i)) == 0)
VECTOR_FIND_IF(iter, const al_string, CaptureDevices, MATCH_ENTRY);
- if(iter == VECTOR_ITER_END(CaptureDevices)) break;
+ if(iter == VECTOR_END(CaptureDevices)) break;
#undef MATCH_ENTRY
}
@@ -258,11 +258,11 @@ static ALCenum ALCwinmmPlayback_open(ALCwinmmPlayback *self, const ALCchar *devi
#define MATCH_DEVNAME(iter) (!al_string_empty(*(iter)) && \
(!deviceName || al_string_cmp_cstr(*(iter), deviceName) == 0))
VECTOR_FIND_IF(iter, const al_string, PlaybackDevices, MATCH_DEVNAME);
- if(iter == VECTOR_ITER_END(PlaybackDevices))
+ if(iter == VECTOR_END(PlaybackDevices))
return ALC_INVALID_VALUE;
#undef MATCH_DEVNAME
- DeviceID = (UINT)(iter - VECTOR_ITER_BEGIN(PlaybackDevices));
+ DeviceID = (UINT)(iter - VECTOR_BEGIN(PlaybackDevices));
retry_open:
memset(&self->Format, 0, sizeof(WAVEFORMATEX));
@@ -544,11 +544,11 @@ static ALCenum ALCwinmmCapture_open(ALCwinmmCapture *self, const ALCchar *name)
// Find the Device ID matching the deviceName if valid
#define MATCH_DEVNAME(iter) (!al_string_empty(*(iter)) && (!name || al_string_cmp_cstr(*iter, name) == 0))
VECTOR_FIND_IF(iter, const al_string, CaptureDevices, MATCH_DEVNAME);
- if(iter == VECTOR_ITER_END(CaptureDevices))
+ if(iter == VECTOR_END(CaptureDevices))
return ALC_INVALID_VALUE;
#undef MATCH_DEVNAME
- DeviceID = (UINT)(iter - VECTOR_ITER_BEGIN(CaptureDevices));
+ DeviceID = (UINT)(iter - VECTOR_BEGIN(CaptureDevices));
switch(device->FmtChans)
{
diff --git a/Alc/helpers.c b/Alc/helpers.c
index 47851cf9..950a67bf 100644
--- a/Alc/helpers.c
+++ b/Alc/helpers.c
@@ -456,7 +456,7 @@ static void DirectorySearch(const char *path, const char *ext, vector_al_string
FindClose(hdl);
if(VECTOR_SIZE(*results) > base)
- qsort(VECTOR_ITER_BEGIN(*results)+base, VECTOR_SIZE(*results)-base,
+ qsort(VECTOR_BEGIN(*results)+base, VECTOR_SIZE(*results)-base,
sizeof(VECTOR_FRONT(*results)), StringSortCompare);
}
@@ -501,7 +501,7 @@ vector_al_string SearchDataFiles(const char *ext, const char *subdir)
if(is_slash(VECTOR_BACK(path)))
{
VECTOR_POP_BACK(path);
- *VECTOR_ITER_END(path) = 0;
+ *VECTOR_END(path) = 0;
}
}
else if(!(cwdbuf=_wgetcwd(NULL, 0)))
@@ -512,7 +512,7 @@ vector_al_string SearchDataFiles(const char *ext, const char *subdir)
if(is_slash(VECTOR_BACK(path)))
{
VECTOR_POP_BACK(path);
- *VECTOR_ITER_END(path) = 0;
+ *VECTOR_END(path) = 0;
}
free(cwdbuf);
}
@@ -629,8 +629,8 @@ static void DirectorySearch(const char *path, const char *ext, vector_al_string
closedir(dir);
if(VECTOR_SIZE(*results) > base)
- qsort(VECTOR_ITER_BEGIN(*results)+base, VECTOR_SIZE(*results)-base,
- sizeof(VECTOR_FRONT(*results)), StringSortCompare);
+ qsort(VECTOR_BEGIN(*results)+base, VECTOR_SIZE(*results)-base,
+ sizeof(VECTOR_FRONT(*results)), StringSortCompare);
}
}
@@ -673,7 +673,7 @@ vector_al_string SearchDataFiles(const char *ext, const char *subdir)
if(VECTOR_BACK(path) == '/')
{
VECTOR_POP_BACK(path);
- *VECTOR_ITER_END(path) = 0;
+ *VECTOR_END(path) = 0;
}
al_string_append_cstr(&path, "/.local/share/");
al_string_append_cstr(&path, subdir);
@@ -826,7 +826,7 @@ void al_string_clear(al_string *str)
*/
VECTOR_RESERVE(*str, 1);
VECTOR_RESIZE(*str, 0);
- *VECTOR_ITER_END(*str) = 0;
+ *VECTOR_END(*str) = 0;
}
}
@@ -858,8 +858,8 @@ void al_string_copy(al_string *str, const_al_string from)
size_t len = al_string_length(from);
VECTOR_RESERVE(*str, len+1);
VECTOR_RESIZE(*str, 0);
- VECTOR_INSERT(*str, VECTOR_ITER_END(*str), VECTOR_ITER_BEGIN(from), VECTOR_ITER_BEGIN(from)+len);
- *VECTOR_ITER_END(*str) = 0;
+ VECTOR_INSERT(*str, VECTOR_END(*str), VECTOR_BEGIN(from), VECTOR_BEGIN(from)+len);
+ *VECTOR_END(*str) = 0;
}
void al_string_copy_cstr(al_string *str, const al_string_char_type *from)
@@ -867,8 +867,8 @@ void al_string_copy_cstr(al_string *str, const al_string_char_type *from)
size_t len = strlen(from);
VECTOR_RESERVE(*str, len+1);
VECTOR_RESIZE(*str, 0);
- VECTOR_INSERT(*str, VECTOR_ITER_END(*str), from, from+len);
- *VECTOR_ITER_END(*str) = 0;
+ VECTOR_INSERT(*str, VECTOR_END(*str), from, from+len);
+ *VECTOR_END(*str) = 0;
}
void al_string_copy_range(al_string *str, const al_string_char_type *from, const al_string_char_type *to)
@@ -876,15 +876,15 @@ void al_string_copy_range(al_string *str, const al_string_char_type *from, const
size_t len = to - from;
VECTOR_RESERVE(*str, len+1);
VECTOR_RESIZE(*str, 0);
- VECTOR_INSERT(*str, VECTOR_ITER_END(*str), from, to);
- *VECTOR_ITER_END(*str) = 0;
+ VECTOR_INSERT(*str, VECTOR_END(*str), from, to);
+ *VECTOR_END(*str) = 0;
}
void al_string_append_char(al_string *str, const al_string_char_type c)
{
VECTOR_RESERVE(*str, al_string_length(*str)+2);
VECTOR_PUSH_BACK(*str, c);
- *VECTOR_ITER_END(*str) = 0;
+ *VECTOR_END(*str) = 0;
}
void al_string_append_cstr(al_string *str, const al_string_char_type *from)
@@ -893,8 +893,8 @@ void al_string_append_cstr(al_string *str, const al_string_char_type *from)
if(len != 0)
{
VECTOR_RESERVE(*str, al_string_length(*str)+len+1);
- VECTOR_INSERT(*str, VECTOR_ITER_END(*str), from, from+len);
- *VECTOR_ITER_END(*str) = 0;
+ VECTOR_INSERT(*str, VECTOR_END(*str), from, from+len);
+ *VECTOR_END(*str) = 0;
}
}
@@ -903,8 +903,8 @@ void al_string_append_range(al_string *str, const al_string_char_type *from, con
if(to != from)
{
VECTOR_RESERVE(*str, al_string_length(*str)+(to-from)+1);
- VECTOR_INSERT(*str, VECTOR_ITER_END(*str), from, to);
- *VECTOR_ITER_END(*str) = 0;
+ VECTOR_INSERT(*str, VECTOR_END(*str), from, to);
+ *VECTOR_END(*str) = 0;
}
}
@@ -917,7 +917,7 @@ void al_string_copy_wcstr(al_string *str, const wchar_t *from)
VECTOR_RESERVE(*str, len);
VECTOR_RESIZE(*str, len-1);
WideCharToMultiByte(CP_UTF8, 0, from, -1, &VECTOR_FRONT(*str), len, NULL, NULL);
- *VECTOR_ITER_END(*str) = 0;
+ *VECTOR_END(*str) = 0;
}
}
@@ -930,7 +930,7 @@ void al_string_append_wcstr(al_string *str, const wchar_t *from)
VECTOR_RESERVE(*str, strlen+len);
VECTOR_RESIZE(*str, strlen+len-1);
WideCharToMultiByte(CP_UTF8, 0, from, -1, &VECTOR_FRONT(*str) + strlen, len, NULL, NULL);
- *VECTOR_ITER_END(*str) = 0;
+ *VECTOR_END(*str) = 0;
}
}
@@ -943,7 +943,7 @@ void al_string_append_wrange(al_string *str, const wchar_t *from, const wchar_t
VECTOR_RESERVE(*str, strlen+len+1);
VECTOR_RESIZE(*str, strlen+len);
WideCharToMultiByte(CP_UTF8, 0, from, (int)(to-from), &VECTOR_FRONT(*str) + strlen, len+1, NULL, NULL);
- *VECTOR_ITER_END(*str) = 0;
+ *VECTOR_END(*str) = 0;
}
}
#endif
diff --git a/Alc/hrtf.c b/Alc/hrtf.c
index 49c9793b..9549c010 100644
--- a/Alc/hrtf.c
+++ b/Alc/hrtf.c
@@ -595,7 +595,7 @@ static void AddFileEntry(vector_HrtfEntry *list, al_string *filename)
#define MATCH_NAME(i) (al_string_cmp(entry.name, (i)->name) == 0)
VECTOR_FIND_IF(iter, const HrtfEntry, *list, MATCH_NAME);
#undef MATCH_NAME
- } while(iter != VECTOR_ITER_END(*list));
+ } while(iter != VECTOR_END(*list));
TRACE("Adding entry \"%s\" from file \"%s\"\n", al_string_get_cstr(entry.name),
al_string_get_cstr(*filename));
@@ -667,11 +667,11 @@ vector_HrtfEntry EnumerateHrtf(const_al_string devname)
/* Find the preferred HRTF and move it to the front of the list. */
#define FIND_ENTRY(i) (al_string_cmp_cstr((i)->name, defaulthrtf) == 0)
VECTOR_FIND_IF(iter, const HrtfEntry, list, FIND_ENTRY);
- if(iter != VECTOR_ITER_END(list) && iter != VECTOR_ITER_BEGIN(list))
+ if(iter != VECTOR_END(list) && iter != VECTOR_BEGIN(list))
{
HrtfEntry entry = *iter;
memmove(&VECTOR_ELEM(list,1), &VECTOR_ELEM(list,0),
- (iter-VECTOR_ITER_BEGIN(list))*sizeof(HrtfEntry));
+ (iter-VECTOR_BEGIN(list))*sizeof(HrtfEntry));
VECTOR_ELEM(list,0) = entry;
}
else
diff --git a/Alc/vector.h b/Alc/vector.h
index c1fc925d..cb64b5a9 100644
--- a/Alc/vector.h
+++ b/Alc/vector.h
@@ -39,8 +39,8 @@ ALboolean vector_resize(char *ptr, size_t base_size, size_t obj_size, size_t obj
#define VECTOR_CAPACITY(_x) ((_x) ? (_x)->Capacity : 0)
#define VECTOR_SIZE(_x) ((_x) ? (_x)->Size : 0)
-#define VECTOR_ITER_BEGIN(_x) ((_x) ? (_x)->Data + 0 : NULL)
-#define VECTOR_ITER_END(_x) ((_x) ? (_x)->Data + (_x)->Size : NULL)
+#define VECTOR_BEGIN(_x) ((_x) ? (_x)->Data + 0 : NULL)
+#define VECTOR_END(_x) ((_x) ? (_x)->Data + (_x)->Size : NULL)
ALboolean vector_insert(char *ptr, size_t base_size, size_t obj_size, void *ins_pos, const void *datstart, const void *datend);
#ifdef __GNUC__
@@ -67,22 +67,22 @@ ALboolean vector_insert(char *ptr, size_t base_size, size_t obj_size, void *ins_
#define VECTOR_ELEM(_x, _o) ((_x)->Data[(_o)])
#define VECTOR_FOR_EACH(_t, _x, _f) do { \
- _t *_iter = VECTOR_ITER_BEGIN((_x)); \
- _t *_end = VECTOR_ITER_END((_x)); \
+ _t *_iter = VECTOR_BEGIN((_x)); \
+ _t *_end = VECTOR_END((_x)); \
for(;_iter != _end;++_iter) \
_f(_iter); \
} while(0)
#define VECTOR_FOR_EACH_PARAMS(_t, _x, _f, ...) do { \
- _t *_iter = VECTOR_ITER_BEGIN((_x)); \
- _t *_end = VECTOR_ITER_END((_x)); \
+ _t *_iter = VECTOR_BEGIN((_x)); \
+ _t *_end = VECTOR_END((_x)); \
for(;_iter != _end;++_iter) \
_f(__VA_ARGS__, _iter); \
} while(0)
#define VECTOR_FIND_IF(_i, _t, _x, _f) do { \
- _t *_iter = VECTOR_ITER_BEGIN((_x)); \
- _t *_end = VECTOR_ITER_END((_x)); \
+ _t *_iter = VECTOR_BEGIN((_x)); \
+ _t *_end = VECTOR_END((_x)); \
for(;_iter != _end;++_iter) \
{ \
if(_f(_iter)) \
@@ -92,8 +92,8 @@ ALboolean vector_insert(char *ptr, size_t base_size, size_t obj_size, void *ins_
} while(0)
#define VECTOR_FIND_IF_PARMS(_i, _t, _x, _f, ...) do { \
- _t *_iter = VECTOR_ITER_BEGIN((_x)); \
- _t *_end = VECTOR_ITER_END((_x)); \
+ _t *_iter = VECTOR_BEGIN((_x)); \
+ _t *_end = VECTOR_END((_x)); \
for(;_iter != _end;++_iter) \
{ \
if(_f(__VA_ARGS__, _iter)) \