ObjFW  Diff

Differences From Artifact [a855386419]:

  • File src/OFMapTable.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: 7574) [annotate] [blame] [check-ins using]

To Artifact [fa70b8daed]:

  • File src/OFMapTable.h — part of check-in [d526d938d7] at 2015-11-21 18:35:39 on branch trunk — Remove OF_NULLABLE / OF_NONNULL

    Now that Clang switched to use _Nullable and _Nonnull instead of
    __nullable / __nonnull, there is no longer a conflict with glibc, which
    means we can just define _Nullable / _Nonnull to nothing if they are not
    understood by the compiler (which did not work with __nullable /
    __nonnull due to this conflict).

    This also defines _Null_unspecified to nothing if unavailable. (user: js, size: 7557) [annotate] [blame] [check-ins using]


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*!
 * @struct of_map_table_functions_t OFMapTable.h ObjFW/OFMapTable.h
 *
 * @brief A struct describing the functions to be used by the map table.
 */
typedef struct {
	/// The function to retain keys / values
	void *OF_NONNULL (*OF_NULLABLE retain)(void *value);
	/// The function to release keys / values
	void (*OF_NULLABLE release)(void *value);
	/// The function to hash keys
	uint32_t (*OF_NULLABLE hash)(void *value);
	/// The function to compare keys / values
	bool (*OF_NULLABLE equal)(void *value1, void *value2);
} of_map_table_functions_t;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block for enumerating an OFMapTable.
 *
 * @param key The current key







|

|

|

|







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*!
 * @struct of_map_table_functions_t OFMapTable.h ObjFW/OFMapTable.h
 *
 * @brief A struct describing the functions to be used by the map table.
 */
typedef struct {
	/// The function to retain keys / values
	void *_Nonnull (*_Nullable retain)(void *value);
	/// The function to release keys / values
	void (*_Nullable release)(void *value);
	/// The function to hash keys
	uint32_t (*_Nullable hash)(void *value);
	/// The function to compare keys / values
	bool (*_Nullable equal)(void *value1, void *value2);
} of_map_table_functions_t;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block for enumerating an OFMapTable.
 *
 * @param key The current key
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*!
 * @brief A block for replacing values in an OFMapTable.
 *
 * @param key The key of the value to replace
 * @param value The value to replace
 * @return The value to replace the value with
 */
typedef void *OF_NONNULL (^of_map_table_replace_block_t)(
    void *key, void *value);
#endif

@class OFMapTableEnumerator;

/*!
 * @class OFMapTable OFMapTable.h ObjFW/OFMapTable.h
 *







|
<







52
53
54
55
56
57
58
59

60
61
62
63
64
65
66
/*!
 * @brief A block for replacing values in an OFMapTable.
 *
 * @param key The key of the value to replace
 * @param value The value to replace
 * @return The value to replace the value with
 */
typedef void *_Nonnull (^of_map_table_replace_block_t)(void *key, void *value);

#endif

@class OFMapTableEnumerator;

/*!
 * @class OFMapTable OFMapTable.h ObjFW/OFMapTable.h
 *