Index: src/OFList.h ================================================================== --- src/OFList.h +++ src/OFList.h @@ -29,15 +29,15 @@ * * A struct that contains a pointer to the next list object, the previous list * object and the object. */ struct of_list_object_t { - /// A pointer to the next list object in the list - of_list_object_t *next; - /// A pointer to the previous list object in the list - of_list_object_t *previous; - /// The object for the list object + /*! A pointer to the next list object in the list */ + of_list_object_t *_Nullable next; + /*! A pointer to the previous list object in the list */ + of_list_object_t *_Nullable previous; + /*! The object for the list object */ id __unsafe_unretained object; }; /*! * @class OFList OFList.h ObjFW/OFList.h Index: src/OFMapTable.h ================================================================== --- src/OFMapTable.h +++ src/OFMapTable.h @@ -249,15 +249,15 @@ /*! * @brief Returns the next object. * * @return The next object */ -- (void *)nextObject; +- (nullable void *)nextObject; /*! * @brief Resets the enumerator, so the next call to @ref nextKey returns the * first key again. */ - (void)reset; @end OF_ASSUME_NONNULL_END Index: src/OFObject.h ================================================================== --- src/OFObject.h +++ src/OFObject.h @@ -646,26 +646,28 @@ * @brief Allocates memory and stores it in the object's memory pool. * * It will be freed automatically when the object is deallocated. * * @param size The size of the memory to allocate - * @return A pointer to the allocated memory + * @return A pointer to the allocated memory. May return NULL if the specified + * size is 0. */ -- (void *)allocMemoryWithSize: (size_t)size; +- (nullable void *)allocMemoryWithSize: (size_t)size; /*! * @brief Allocates memory for the specified number of items and stores it in * the object's memory pool. * * It will be freed automatically when the object is deallocated. * * @param size The size of each item to allocate * @param count The number of items to allocate - * @return A pointer to the allocated memory + * @return A pointer to the allocated memory. May return NULL if the specified + * size or count is 0. */ -- (void *)allocMemoryWithSize: (size_t)size - count: (size_t)count; +- (nullable void *)allocMemoryWithSize: (size_t)size + count: (size_t)count; /*! * @brief Resizes memory in the object's memory pool to the specified size. * * If the pointer is NULL, this is equivalent to allocating memory. Index: src/OFString+XMLUnescaping.h ================================================================== --- src/OFString+XMLUnescaping.h +++ src/OFString+XMLUnescaping.h @@ -58,12 +58,12 @@ * * @param string The string which contains the unknown entity * @param entity The name of the entity that is unknown * @return A substitution for the entity or `nil` */ -- (OFString *)string: (OFString *)string - containsUnknownEntityNamed: (OFString *)entity; +- (nullable OFString *)string: (OFString *)string + containsUnknownEntityNamed: (OFString *)entity; @end @interface OFString (XMLUnescaping) /*! * @brief Unescapes XML in the string. Index: src/OFTarArchive.h ================================================================== --- src/OFTarArchive.h +++ src/OFTarArchive.h @@ -84,9 +84,9 @@ * @ref OFReadFailedException! * * @return The next entry from the tar archive or `nil` if all entries have * been read */ -- (OFTarArchiveEntry *)nextEntry; +- (nullable OFTarArchiveEntry *)nextEntry; @end OF_ASSUME_NONNULL_END Index: src/OFXMLElement.h ================================================================== --- src/OFXMLElement.h +++ src/OFXMLElement.h @@ -276,21 +276,21 @@ * @brief Returns the attribute with the specified name. * * @param attributeName The name of the attribute * @return The attribute with the specified name */ -- (OFXMLAttribute *)attributeForName: (OFString *)attributeName; +- (nullable OFXMLAttribute *)attributeForName: (OFString *)attributeName; /*! * @brief Returns the attribute with the specified name and namespace. * * @param attributeName The name of the attribute * @param attributeNS The namespace of the attribute * @return The attribute with the specified name and namespace */ -- (OFXMLAttribute *)attributeForName: (OFString *)attributeName - namespace: (nullable OFString *)attributeNS; +- (nullable OFXMLAttribute *)attributeForName: (OFString *)attributeName + namespace: (nullable OFString *)attributeNS; /*! * @brief Removes the attribute with the specified name. * * @param attributeName The name of the attribute @@ -397,11 +397,11 @@ * @brief Returns the first child element with the specified name. * * @param elementName The name of the element * @return The first child element with the specified name */ -- (OFXMLElement *)elementForName: (OFString *)elementName; +- (nullable OFXMLElement *)elementForName: (OFString *)elementName; /*! * @brief Returns the child elements with the specified name. * * @param elementName The name of the elements @@ -415,12 +415,12 @@ * * @param elementName The name of the element * @param elementNS The namespace of the element * @return The first child element with the specified name and namespace */ -- (OFXMLElement *)elementForName: (OFString *)elementName - namespace: (nullable OFString *)elementNS; +- (nullable OFXMLElement *)elementForName: (OFString *)elementName + namespace: (nullable OFString *)elementNS; /*! * @brief Returns the child elements with the specified name and namespace. * * @param elementName The name of the elements Index: src/OFXMLParser.h ================================================================== --- src/OFXMLParser.h +++ src/OFXMLParser.h @@ -114,12 +114,12 @@ * * @param parser The parser which found an unknown entity * @param entity The name of the entity the XML parser didn't know * @return A substitution for the entity or `nil` */ -- (OFString *)parser: (OFXMLParser *)parser - foundUnknownEntityNamed: (OFString *)entity; +- (nullable OFString *)parser: (OFXMLParser *)parser + foundUnknownEntityNamed: (OFString *)entity; @end /*! * @class OFXMLParser OFXMLParser.h ObjFW/OFXMLParser.h *