ObjFW  Diff

Differences From Artifact [00a9d26e5f]:

To Artifact [30b2100737]:

  • File src/OFEnumerator.h — part of check-in [b7097a67b6] at 2015-06-14 10:45:10 on branch trunk — Add OF_NONNULL / OF_NULLABLE and use that instead

    Using __nonnull directly doesn't work on systems using glibc, as glibc
    defines __nonnull as a parameterized define. While this does not fix the
    problem of Clang introducing __nonnull even though it conflicts with
    glibc, this at least means it's possible again to compile things with
    versions of Clang that don't support __nonnull on systems with glibc. (user: js, size: 3655) [annotate] [blame] [check-ins using]


88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
 */
#define of_fast_enumeration_state_t NSFastEnumerationState
#ifndef NSINTEGER_DEFINED
typedef struct {
	/// Arbitrary state information for the enumeration
	unsigned long state;
	/// Pointer to a C array of objects to return
	__unsafe_unretained __nullable id *__nullable itemsPtr;
	/// Arbitrary state information to detect mutations
	__nullable unsigned long *mutationsPtr;
	/// Additional arbitrary state information
	unsigned long extra[5];
} of_fast_enumeration_state_t;
#endif

/*!
 * @protocol OFFastEnumeration OFEnumerator.h ObjFW/OFEnumerator.h







|

|







88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
 */
#define of_fast_enumeration_state_t NSFastEnumerationState
#ifndef NSINTEGER_DEFINED
typedef struct {
	/// Arbitrary state information for the enumeration
	unsigned long state;
	/// Pointer to a C array of objects to return
	id __unsafe_unretained OF_NULLABLE *OF_NULLABLE itemsPtr;
	/// Arbitrary state information to detect mutations
	unsigned long *OF_NULLABLE mutationsPtr;
	/// Additional arbitrary state information
	unsigned long extra[5];
} of_fast_enumeration_state_t;
#endif

/*!
 * @protocol OFFastEnumeration OFEnumerator.h ObjFW/OFEnumerator.h
116
117
118
119
120
121
122
123
124
125
126
127
128
 * @param state Context information for the enumeration
 * @param objects A pointer to an array where to put the objects
 * @param count The number of objects that can be stored at objects
 * @return The number of objects returned in objects or 0 when the enumeration
 *	   finished.
 */
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
			   objects: (__unsafe_unretained __nonnull id
					*__nonnull)objects
			     count: (int)count;
@end

OF_ASSUME_NONNULL_END







|
|




116
117
118
119
120
121
122
123
124
125
126
127
128
 * @param state Context information for the enumeration
 * @param objects A pointer to an array where to put the objects
 * @param count The number of objects that can be stored at objects
 * @return The number of objects returned in objects or 0 when the enumeration
 *	   finished.
 */
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
			   objects: (id __unsafe_unretained OF_NONNULL
					*OF_NONNULL)objects
			     count: (int)count;
@end

OF_ASSUME_NONNULL_END