mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
(GS_USEIDLIST): Make implementation match actual use in NSArray and NSSet. Clarify documentation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16382 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0f05f2246c
commit
71aa6ee47c
2 changed files with 14 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
2003-04-06 23:30 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* Headers/gnustep/base/GSCategories.h (GS_USEIDLIST): Make the
|
||||
implementation match the actual use in NSArray and NSSet. Clarify
|
||||
documentation.
|
||||
|
||||
2003-04-06 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSThread.m: (GSPerformHolder) execute perform operations
|
||||
|
|
|
@ -233,7 +233,8 @@
|
|||
* make use of the objects stored in the 'C' array.<br />
|
||||
* When this code is called the unsigned integer '__count' will contain the
|
||||
* number of objects unpacked, and the pointer '__objects' will point to
|
||||
* the unpacked objects.
|
||||
* the unpacked objects, ie. firstObject followed by the vararg arguments
|
||||
* up to (but not including) the first nil.
|
||||
* </p>
|
||||
*/
|
||||
#define GS_USEIDLIST(firstObject, code...) ({\
|
||||
|
@ -245,7 +246,10 @@
|
|||
va_start(__ap, firstObject); \
|
||||
while (__count < __max) \
|
||||
{ \
|
||||
__objects[__count] = va_arg(__ap, id); \
|
||||
if (__count) \
|
||||
__objects[__count] = va_arg(__ap, id); \
|
||||
else \
|
||||
__objects[__count] = firstObject; \
|
||||
if (__objects[__count] == nil) \
|
||||
{ \
|
||||
break; \
|
||||
|
@ -266,7 +270,8 @@
|
|||
unsigned int __tmp; \
|
||||
__objects = (id*)objc_malloc(__count*sizeof(id)); \
|
||||
va_start(__ap, firstObject); \
|
||||
for (__tmp = 0; __tmp < __count; __tmp++) \
|
||||
__objects[0] = firstObject; \
|
||||
for (__tmp = 1; __tmp < __count; __tmp++) \
|
||||
{ \
|
||||
__objects[__tmp] = va_arg(__ap, id); \
|
||||
} \
|
||||
|
|
Loading…
Reference in a new issue