@@ -108,11 +108,11 @@ * @param start The starting index of the range * @param length The length of the range * @return An OFRangeith the specified start and length */ static OF_INLINE OFRange OF_CONST_FUNC -OFRangeMake(size_t start, size_t length) +OFMakeRange(size_t start, size_t length) { OFRange range = { start, length }; return range; } @@ -123,11 +123,11 @@ * @param range1 The first range for the comparison * @param range2 The second range for the comparison * @return Whether the two ranges are equal */ static OF_INLINE bool -OFRangeEqual(OFRange range1, OFRange range2) +OFEqualRanges(OFRange range1, OFRange range2) { if (range1.location != range2.location) return false; if (range1.length != range2.length) @@ -159,11 +159,11 @@ * @param x The x coordinate of the point * @param y The x coordinate of the point * @return An OFPoint with the specified coordinates */ static OF_INLINE OFPoint OF_CONST_FUNC -OFPointMake(float x, float y) +OFMakePoint(float x, float y) { OFPoint point = { x, y }; return point; } @@ -174,11 +174,11 @@ * @param point1 The first point for the comparison * @param point2 The second point for the comparison * @return Whether the two points are equal */ static OF_INLINE bool -OFPointEqual(OFPoint point1, OFPoint point2) +OFEqualPoints(OFPoint point1, OFPoint point2) { if (point1.x != point2.x) return false; if (point1.y != point2.y) @@ -205,11 +205,11 @@ * @param width The width of the size * @param height The height of the size * @return An OFSize with the specified width and height */ static OF_INLINE OFSize OF_CONST_FUNC -OFSizeMake(float width, float height) +OFMakeSize(float width, float height) { OFSize size = { width, height }; return size; } @@ -220,11 +220,11 @@ * @param size1 The first size for the comparison * @param size2 The second size for the comparison * @return Whether the two sizes are equal */ static OF_INLINE bool -OFSizeEqual(OFSize size1, OFSize size2) +OFEqualSizes(OFSize size1, OFSize size2) { if (size1.width != size2.width) return false; if (size1.height != size2.height) @@ -253,15 +253,15 @@ * @param width The width of the rectangle * @param height The height of the rectangle * @return An OFRect with the specified origin and size */ static OF_INLINE OFRect OF_CONST_FUNC -OFRectMake(float x, float y, float width, float height) +OFMakeRect(float x, float y, float width, float height) { OFRect rect = { - OFPointMake(x, y), - OFSizeMake(width, height) + OFMakePoint(x, y), + OFMakeSize(width, height) }; return rect; } @@ -271,16 +271,16 @@ * @param rect1 The first rectangle for the comparison * @param rect2 The second rectangle for the comparison * @return Whether the two rectangles are equal */ static OF_INLINE bool -OFRectEqual(OFRect rect1, OFRect rect2) +OFEqualRects(OFRect rect1, OFRect rect2) { - if (!OFPointEqual(rect1.origin, rect2.origin)) + if (!OFEqualPoints(rect1.origin, rect2.origin)) return false; - if (!OFSizeEqual(rect1.size, rect2.size)) + if (!OFEqualSizes(rect1.size, rect2.size)) return false; return true; } @@ -289,11 +289,11 @@ * * @param hash A pointer to a hash to add the byte to * @param byte The byte to add to the hash */ static OF_INLINE void -OFHashAdd(unsigned long *_Nonnull hash, unsigned char byte) +OFHashAddByte(unsigned long *_Nonnull hash, unsigned char byte) { uint32_t tmp = (uint32_t)*hash; tmp += byte; tmp += tmp << 10; @@ -309,14 +309,14 @@ * @param otherHash The hash to add to the hash */ static OF_INLINE void OFHashAddHash(unsigned long *_Nonnull hash, unsigned long otherHash) { - OFHashAdd(hash, (otherHash >> 24) & 0xFF); - OFHashAdd(hash, (otherHash >> 16) & 0xFF); - OFHashAdd(hash, (otherHash >> 8) & 0xFF); - OFHashAdd(hash, otherHash & 0xFF); + OFHashAddByte(hash, (otherHash >> 24) & 0xFF); + OFHashAddByte(hash, (otherHash >> 16) & 0xFF); + OFHashAddByte(hash, (otherHash >> 8) & 0xFF); + OFHashAddByte(hash, otherHash & 0xFF); } /** * @brief Finalizes the specified hash. * @@ -360,20 +360,20 @@ * @return The superclass of the object */ - (nullable Class)superclass; /** - * @brief Returns a 32 bit hash for the object. + * @brief Returns a hash for the object. * * Classes containing data (like strings, arrays, lists etc.) should reimplement * this! * * @warning If you reimplement this, you also need to reimplement @ref isEqual: * to behave in a way compatible to your reimplementation of this * method! * - * @return A 32 bit hash for the object + * @return A hash for the object */ - (unsigned long)hash; /** * @brief Returns the retain count. @@ -388,20 +388,13 @@ * @return Whether the object is a proxy object */ - (bool)isProxy; /** - * @brief Returns whether the object allows weak references. - * - * @return Whether the object allows weak references - */ -- (bool)allowsWeakReference; - -/** - * @brief Returns a boolean whether the object of the specified kind. - * - * @param class_ The class whose kind is checked + * @brief Returns a boolean whether the object is of the specified kind. + * + * @param class_ The class for which the receiver is checked * @return A boolean whether the object is of the specified kind */ - (bool)isKindOfClass: (Class)class_; /** @@ -550,10 +543,17 @@ * * @return The receiver */ - (instancetype)self; +/** + * @brief Returns whether the object allows a weak reference. + * + * @return Whether the object allows a weak references + */ +- (bool)allowsWeakReference; + /** * @brief Retain a weak reference to this object. * * @return Whether a weak reference to this object has been retained */