1
2
3
4
5
6
7
8
9
|
/*
* Copyright (c) 2008-2023 Jonathan Schleifer <js@nil.im>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
|
|
1
2
3
4
5
6
7
8
9
|
/*
* Copyright (c) 2008-2024 Jonathan Schleifer <js@nil.im>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
315
316
317
318
319
320
321
322
323
324
325
326
327
328
|
if (count % 2 != 0)
@throw [OFInvalidArgumentException exception];
count /= 2;
objects = OFAllocMemory(count, sizeof(id));
keys = OFAllocMemory(count, sizeof(id));
while ((key = va_arg(arguments, id)) != nil &&
(object = va_arg(arguments, id)) != nil) {
OFEnsure(i < count);
objects[i] = object;
keys[i] = key;
|
>
>
>
>
>
>
>
>
|
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
|
if (count % 2 != 0)
@throw [OFInvalidArgumentException exception];
count /= 2;
objects = OFAllocMemory(count, sizeof(id));
keys = OFAllocMemory(count, sizeof(id));
keys[i] = firstKey;
objects[i] = va_arg(arguments, id);
if (objects[i] == nil)
@throw [OFInvalidArgumentException exception];
i++;
while ((key = va_arg(arguments, id)) != nil &&
(object = va_arg(arguments, id)) != nil) {
OFEnsure(i < count);
objects[i] = object;
keys[i] = key;
|