ObjFW  Check-in [11f24addd7]

Overview
Comment:Fix warnings introduced by OFComparing change

Since OFComparing no longer conforms to OFObject, OFObject needed to be
added at a few places.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 11f24addd7edf1223bc082c56a61538a2d5cfd61ebb49ddb2949d07cc278b3bd
User & Date: js on 2017-11-19 12:05:42
Other Links: manifest | tags
Context
2017-11-19
12:56
Fix compilation with GCC check-in: 615a9f2eba user: js tags: trunk
12:05
Fix warnings introduced by OFComparing change check-in: 11f24addd7 user: js tags: trunk
11:04
Do not conform to OFReadyFor*Observing by default check-in: 69749b6a5b user: js tags: trunk
Changes

Modified src/OFData.m from [995d1dfd33] to [7aeee7380b].

432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
		return false;
	if (memcmp([data items], _items, _count * _itemSize) != 0)
		return false;

	return true;
}

- (of_comparison_result_t)compare: (id <OFComparing>)object
{
	OFData *data;
	int comparison;
	size_t count, minCount;

	if (![object isKindOfClass: [OFData class]])
		@throw [OFInvalidArgumentException exception];







|







432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
		return false;
	if (memcmp([data items], _items, _count * _itemSize) != 0)
		return false;

	return true;
}

- (of_comparison_result_t)compare: (id <OFObject, OFComparing>)object
{
	OFData *data;
	int comparison;
	size_t count, minCount;

	if (![object isKindOfClass: [OFData class]])
		@throw [OFInvalidArgumentException exception];

Modified src/OFDate.m from [ed9a79856e] to [da50e80816].

393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
}

- (id)copy
{
	return [self retain];
}

- (of_comparison_result_t)compare: (id <OFComparing>)object
{
	OFDate *otherDate;

	if (![object isKindOfClass: [OFDate class]])
		@throw [OFInvalidArgumentException exception];

	otherDate = (OFDate *)object;







|







393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
}

- (id)copy
{
	return [self retain];
}

- (of_comparison_result_t)compare: (id <OFObject, OFComparing>)object
{
	OFDate *otherDate;

	if (![object isKindOfClass: [OFDate class]])
		@throw [OFInvalidArgumentException exception];

	otherDate = (OFDate *)object;

Modified src/OFNumber.m from [12ab796c0f] to [64757a4f33].

759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
	if (_type & OF_NUMBER_TYPE_SIGNED ||
	    number->_type & OF_NUMBER_TYPE_SIGNED)
		return ([number intMaxValue] == [self intMaxValue]);

	return ([number uIntMaxValue] == [self uIntMaxValue]);
}

- (of_comparison_result_t)compare: (id <OFComparing>)object
{
	OFNumber *number;

	if (![object isKindOfClass: [OFNumber class]])
		@throw [OFInvalidArgumentException exception];

	number = (OFNumber *)object;







|







759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
	if (_type & OF_NUMBER_TYPE_SIGNED ||
	    number->_type & OF_NUMBER_TYPE_SIGNED)
		return ([number intMaxValue] == [self intMaxValue]);

	return ([number uIntMaxValue] == [self uIntMaxValue]);
}

- (of_comparison_result_t)compare: (id <OFObject, OFComparing>)object
{
	OFNumber *number;

	if (![object isKindOfClass: [OFNumber class]])
		@throw [OFInvalidArgumentException exception];

	number = (OFNumber *)object;

Modified src/OFRunLoop.h from [740edb7b33] to [33f76261cf].

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 * @brief A class providing a run loop for the application and its processes.
 */
@interface OFRunLoop: OFObject
#ifdef OF_HAVE_SOCKETS
    <OFKernelEventObserverDelegate>
#endif
{
	OFSortedList *_timersQueue;
#ifdef OF_HAVE_THREADS
	OFMutex *_timersQueueLock;
#endif
#if defined(OF_HAVE_SOCKETS)
	OFKernelEventObserver *_kernelEventObserver;
	OFMutableDictionary *_readQueues, *_writeQueues;
#elif defined(OF_HAVE_THREADS)







|







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 * @brief A class providing a run loop for the application and its processes.
 */
@interface OFRunLoop: OFObject
#ifdef OF_HAVE_SOCKETS
    <OFKernelEventObserverDelegate>
#endif
{
	OFSortedList OF_GENERIC(OFTimer *) *_timersQueue;
#ifdef OF_HAVE_THREADS
	OFMutex *_timersQueueLock;
#endif
#if defined(OF_HAVE_SOCKETS)
	OFKernelEventObserver *_kernelEventObserver;
	OFMutableDictionary *_readQueues, *_writeQueues;
#elif defined(OF_HAVE_THREADS)

Modified src/OFSortedList.h from [a54bf9785c] to [f7282c99bb].

26
27
28
29
30
31
32









33
34
35
36
37
38
39
40
41
42
43
44
45
 * @warning Because the list is sorted, all methods inserting an object at a
 *	    specific place are unavailable, even though they exist in OFList!
 */
@interface OFSortedList OF_GENERIC(ObjectType): OFList OF_GENERIC(ObjectType)
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# define ObjectType id
#endif









/*!
 * @brief Inserts the object to the list while keeping the list sorted.
 *
 * @param object The object to insert
 * @return The list object for the object just added
 */
- (of_list_object_t *)insertObject: (ObjectType <OFComparing>)object;
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif
@end

OF_ASSUME_NONNULL_END







>
>
>
>
>
>
>
>
>













26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
 * @warning Because the list is sorted, all methods inserting an object at a
 *	    specific place are unavailable, even though they exist in OFList!
 */
@interface OFSortedList OF_GENERIC(ObjectType): OFList OF_GENERIC(ObjectType)
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# define ObjectType id
#endif
- (of_list_object_t *)appendObject: (ObjectType)object OF_UNAVAILABLE;
- (of_list_object_t *)prependObject: (ObjectType)object OF_UNAVAILABLE;
- (of_list_object_t *)insertObject: (ObjectType)object
		  beforeListObject: (of_list_object_t *)listObject
    OF_UNAVAILABLE;
- (of_list_object_t *)insertObject: (ObjectType)object
		   afterListObject: (of_list_object_t *)listObject
    OF_UNAVAILABLE;

/*!
 * @brief Inserts the object to the list while keeping the list sorted.
 *
 * @param object The object to insert
 * @return The list object for the object just added
 */
- (of_list_object_t *)insertObject: (ObjectType <OFComparing>)object;
#if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN)
# undef ObjectType
#endif
@end

OF_ASSUME_NONNULL_END

Modified src/OFString.m from [2722cbc855] to [27fbf1ebf8].

1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
}

- (id)mutableCopy
{
	return [[OFMutableString alloc] initWithString: self];
}

- (of_comparison_result_t)compare: (id <OFComparing>)object
{
	void *pool;
	OFString *otherString;
	const of_unichar_t *characters, *otherCharacters;
	size_t minimumLength;

	if (object == self)







|







1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
}

- (id)mutableCopy
{
	return [[OFMutableString alloc] initWithString: self];
}

- (of_comparison_result_t)compare: (id <OFObject, OFComparing>)object
{
	void *pool;
	OFString *otherString;
	const of_unichar_t *characters, *otherCharacters;
	size_t minimumLength;

	if (object == self)

Modified src/OFString_UTF8.m from [6dc5021b73] to [879030fae2].

804
805
806
807
808
809
810
811
812
813
814
815
816
817
818

	if (strcmp(_s->cString, [otherString UTF8String]) != 0)
		return false;

	return true;
}

- (of_comparison_result_t)compare: (id <OFComparing>)object
{
	OFString *otherString;
	size_t otherCStringLength, minimumCStringLength;
	int compare;

	if (object == self)
		return OF_ORDERED_SAME;







|







804
805
806
807
808
809
810
811
812
813
814
815
816
817
818

	if (strcmp(_s->cString, [otherString UTF8String]) != 0)
		return false;

	return true;
}

- (of_comparison_result_t)compare: (id <OFObject, OFComparing>)object
{
	OFString *otherString;
	size_t otherCStringLength, minimumCStringLength;
	int compare;

	if (object == self)
		return OF_ORDERED_SAME;

Modified src/OFTimer.m from [d55afecf6c] to [7c5e87e7c3].

502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
#ifdef OF_HAVE_THREADS
	[_condition release];
#endif

	[super dealloc];
}

- (of_comparison_result_t)compare: (id <OFComparing>)object
{
	OFTimer *timer;

	if (![object isKindOfClass: [OFTimer class]])
		@throw [OFInvalidArgumentException exception];

	timer = (OFTimer *)object;







|







502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
#ifdef OF_HAVE_THREADS
	[_condition release];
#endif

	[super dealloc];
}

- (of_comparison_result_t)compare: (id <OFObject, OFComparing>)object
{
	OFTimer *timer;

	if (![object isKindOfClass: [OFTimer class]])
		@throw [OFInvalidArgumentException exception];

	timer = (OFTimer *)object;