@@ -16,10 +16,12 @@ #import "OFObject.h" #import "OFCollection.h" #import "OFEnumerator.h" #import "OFSerialization.h" + +OF_ASSUME_NONNULL_BEGIN typedef struct of_list_object_t of_list_object_t; /*! * @struct of_list_object_t OFList.h ObjFW/OFList.h * @@ -57,12 +59,12 @@ size_t _count; unsigned long _mutations; } #ifdef OF_HAVE_PROPERTIES -@property (readonly) of_list_object_t *firstListObject; -@property (readonly) of_list_object_t *lastListObject; +@property (readonly, nullable) of_list_object_t *firstListObject; +@property (readonly, nullable) of_list_object_t *lastListObject; #endif /*! * @brief Creates a new OFList. * @@ -73,18 +75,18 @@ /*! * @brief Returns the first list object of the list. * * @return The first list object of the list */ -- (of_list_object_t*)firstListObject; +- (nullable of_list_object_t*)firstListObject; /*! * @brief Returns the last list object of the list. * * @return The last list object of the list */ -- (of_list_object_t*)lastListObject; +- (nullable of_list_object_t*)lastListObject; /*! * @brief Appends an object to the list. * * @param object The object to append @@ -142,20 +144,20 @@ * object. * * @param object The object which is checked for being in the list * @return A boolean whether the list contains the specified object */ -- (bool)containsObject: (ObjectType)object; +- (bool)containsObject: (nullable ObjectType)object; /*! * @brief Checks whether the list contains an object with the specified address. * * @param object The object which is checked for being in the list * @return A boolean whether the list contains an object with the specified * address */ -- (bool)containsObjectIdenticalTo: (ObjectType)object; +- (bool)containsObjectIdenticalTo: (nullable ObjectType)object; /*! * @brief Returns an OFEnumerator to enumerate through all objects of the list. * * @returns An OFEnumerator to enumerate through all objects of the list @@ -168,21 +170,21 @@ * @warning The returned object is *not* retained and autoreleased for * performance reasons! * * @return The first object of the list or nil */ -- (ObjectType)firstObject; +- (nullable ObjectType)firstObject; /*! * @brief Returns the last object of the list or nil. * * @warning The returned object is *not* retained and autoreleased for * performance reasons! * * @return The last object of the list or nil */ -- (ObjectType)lastObject; +- (nullable ObjectType)lastObject; /*! * @brief Removes all objects from the list. */ - (void)removeAllObjects; @@ -200,5 +202,7 @@ } - initWithList: (OFList*)list mutationsPointer: (unsigned long*)mutationsPtr; @end + +OF_ASSUME_NONNULL_END