Comment: | Add OF_NULLABLE_PROPERTY
This is necessary to make GCC (>= 4.6 and Apple GCC) happy as they don't |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
80e1a9655beab3177781fb00694e45a0 |
User & Date: | js on 2015-06-17 22:11:31 |
Other Links: | manifest | tags |
2015-06-17
| ||
22:19 | utils/ofhttp: Make old Apple GCC happy check-in: a3f24bdd18 user: js tags: trunk | |
22:11 | Add OF_NULLABLE_PROPERTY check-in: 80e1a9655b user: js tags: trunk | |
2015-06-14
| ||
13:10 | OFDate: Improve handling of distant past / future check-in: 168b748eb8 user: js tags: trunk | |
Modified src/OFApplication.h from [e950676ac5] to [ed8ed6f607].
︙ | ︙ | |||
131 132 133 134 135 136 137 | } #ifdef OF_HAVE_PROPERTIES @property (readonly, copy, nonatomic) OFString *programName; @property (readonly, copy, nonatomic) OFArray OF_GENERIC(OFString*) *arguments; @property (readonly, copy, nonatomic) OFDictionary OF_GENERIC(OFString*, OFString*) *environment; | | | 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 | } #ifdef OF_HAVE_PROPERTIES @property (readonly, copy, nonatomic) OFString *programName; @property (readonly, copy, nonatomic) OFArray OF_GENERIC(OFString*) *arguments; @property (readonly, copy, nonatomic) OFDictionary OF_GENERIC(OFString*, OFString*) *environment; @property OF_NULLABLE_PROPERTY (assign) id <OFApplicationDelegate> delegate; #endif /*! * @brief Returns the only OFApplication instance in the application. * * @return The only OFApplication instance in the application */ |
︙ | ︙ |
Modified src/OFHTTPClient.h from [74c3496cfd] to [1d478e9a98].
︙ | ︙ | |||
106 107 108 109 110 111 112 | OFTCPSocket *_socket; OFURL *_lastURL; bool _lastWasHEAD; OFHTTPResponse *_lastResponse; } #ifdef OF_HAVE_PROPERTIES | | | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | OFTCPSocket *_socket; OFURL *_lastURL; bool _lastWasHEAD; OFHTTPResponse *_lastResponse; } #ifdef OF_HAVE_PROPERTIES @property OF_NULLABLE_PROPERTY (assign) id <OFHTTPClientDelegate> delegate; @property bool insecureRedirectsAllowed; #endif /*! * @brief Creates a new OFHTTPClient. * * @return A new, autoreleased OFHTTPClient |
︙ | ︙ |
Modified src/OFHTTPRequest.h from [a0120e2911] to [2b094f8687].
︙ | ︙ | |||
80 81 82 83 84 85 86 | OFString *_remoteAddress; } #ifdef OF_HAVE_PROPERTIES @property (copy) OFURL *URL; @property of_http_request_method_t method; @property of_http_request_protocol_version_t protocolVersion; | > | < | | | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | OFString *_remoteAddress; } #ifdef OF_HAVE_PROPERTIES @property (copy) OFURL *URL; @property of_http_request_method_t method; @property of_http_request_protocol_version_t protocolVersion; @property OF_NULLABLE_PROPERTY (copy) OFDictionary OF_GENERIC(OFString*, OFString*) *headers; @property OF_NULLABLE_PROPERTY (retain) OFDataArray *body; @property OF_NULLABLE_PROPERTY (copy) OFString *remoteAddress; #endif /*! * @brief Creates a new OFHTTPRequest. * * @return A new, autoreleased OFHTTPRequest */ |
︙ | ︙ |
Modified src/OFHTTPResponse.h from [043802ccf0] to [127c6d8f9d].
︙ | ︙ | |||
32 33 34 35 36 37 38 | short _statusCode; OFDictionary OF_GENERIC(OFString*, OFString*) *_headers; } #ifdef OF_HAVE_PROPERTIES @property of_http_request_protocol_version_t protocolVersion; @property short statusCode; | > | < | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | short _statusCode; OFDictionary OF_GENERIC(OFString*, OFString*) *_headers; } #ifdef OF_HAVE_PROPERTIES @property of_http_request_protocol_version_t protocolVersion; @property short statusCode; @property OF_NULLABLE_PROPERTY (copy) OFDictionary OF_GENERIC(OFString*, OFString*) *headers; #endif /*! * @brief Sets the protocol version of the HTTP request reply. * * @param protocolVersion The protocol version of the HTTP request reply */ |
︙ | ︙ |
Modified src/OFHTTPServer.h from [a9420ff4db] to [0b4b52c4cd].
︙ | ︙ | |||
75 76 77 78 79 80 81 | uint16_t _port; id <OFHTTPServerDelegate> _delegate; OFString *_name; OFTCPSocket *_listeningSocket; } #ifdef OF_HAVE_PROPERTIES | | | | | 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | uint16_t _port; id <OFHTTPServerDelegate> _delegate; OFString *_name; OFTCPSocket *_listeningSocket; } #ifdef OF_HAVE_PROPERTIES @property OF_NULLABLE_PROPERTY (copy) OFString *host; @property uint16_t port; @property OF_NULLABLE_PROPERTY (assign) id <OFHTTPServerDelegate> delegate; @property OF_NULLABLE_PROPERTY (copy) OFString *name; #endif /*! * @brief Creates a new HTTP server. * * @return A new HTTP server */ |
︙ | ︙ |
Modified src/OFIntrospection.h from [0bd232c6bc] to [061b43fb0e].
︙ | ︙ | |||
48 49 50 51 52 53 54 | OFString *_name; const char *_typeEncoding; } #ifdef OF_HAVE_PROPERTIES @property (readonly) SEL selector; @property (readonly, copy) OFString *name; | | | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | OFString *_name; const char *_typeEncoding; } #ifdef OF_HAVE_PROPERTIES @property (readonly) SEL selector; @property (readonly, copy) OFString *name; @property OF_NULLABLE_PROPERTY (assign, readonly) const char *typeEncoding; #endif /*! * @brief Returns the selector of the method. * * @return The selector of the method */ |
︙ | ︙ | |||
88 89 90 91 92 93 94 | unsigned _attributes; OFString *_getter, *_setter; } #ifdef OF_HAVE_PROPERTIES @property (readonly, copy) OFString *name; @property (readonly) unsigned attributes; | | | 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | unsigned _attributes; OFString *_getter, *_setter; } #ifdef OF_HAVE_PROPERTIES @property (readonly, copy) OFString *name; @property (readonly) unsigned attributes; @property OF_NULLABLE_PROPERTY (copy, readonly) OFString *getter, *setter; #endif /*! * @brief Returns the name of the property. * * @return The name of the property */ |
︙ | ︙ | |||
149 150 151 152 153 154 155 | const char *_typeEncoding; ptrdiff_t _offset; } #ifdef OF_HAVE_PROPERTIES @property (readonly, copy) OFString *name; @property (readonly) ptrdiff_t offset; | | | 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | const char *_typeEncoding; ptrdiff_t _offset; } #ifdef OF_HAVE_PROPERTIES @property (readonly, copy) OFString *name; @property (readonly) ptrdiff_t offset; @property OF_NULLABLE_PROPERTY (assign, readonly) const char *typeEncoding; #endif /*! * @brief Returns the name of the instance variable. * * @return The name of the instance variable */ |
︙ | ︙ |
Modified src/OFKernelEventObserver.h from [134a6fc2ce] to [dd8f6e2345].
︙ | ︙ | |||
125 126 127 128 129 130 131 | #endif #ifdef OF_HAVE_THREADS OFMutex *_mutex; #endif } #ifdef OF_HAVE_PROPERTIES | > | | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | #endif #ifdef OF_HAVE_THREADS OFMutex *_mutex; #endif } #ifdef OF_HAVE_PROPERTIES @property OF_NULLABLE_PROPERTY (assign) id <OFKernelEventObserverDelegate> delegate; #endif /*! * @brief Creates a new OFKernelEventObserver. * * @return A new, autoreleased OFKernelEventObserver */ |
︙ | ︙ |
Modified src/OFList.h from [5074e7258e] to [2c4a93e677].
︙ | ︙ | |||
57 58 59 60 61 62 63 | of_list_object_t *_firstListObject; of_list_object_t *_lastListObject; size_t _count; unsigned long _mutations; } #ifdef OF_HAVE_PROPERTIES | | | | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | of_list_object_t *_firstListObject; of_list_object_t *_lastListObject; size_t _count; unsigned long _mutations; } #ifdef OF_HAVE_PROPERTIES @property OF_NULLABLE_PROPERTY (readonly) of_list_object_t *firstListObject; @property OF_NULLABLE_PROPERTY (readonly) of_list_object_t *lastListObject; #endif /*! * @brief Creates a new OFList. * * @return A new autoreleased OFList */ |
︙ | ︙ |
Modified src/OFLocking.h from [aabddd2a24] to [5d56441827].
︙ | ︙ | |||
21 22 23 24 25 26 27 | /*! * @protocol OFLocking OFLocking.h ObjFW/OFLocking.h * * @brief A protocol for locks. */ @protocol OFLocking <OFObject> #ifdef OF_HAVE_PROPERTIES | | | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | /*! * @protocol OFLocking OFLocking.h ObjFW/OFLocking.h * * @brief A protocol for locks. */ @protocol OFLocking <OFObject> #ifdef OF_HAVE_PROPERTIES @property OF_NULLABLE_PROPERTY (copy) OFString *name; #endif /*! * @brief Locks the lock. */ - (void)lock; |
︙ | ︙ |
Modified src/OFTCPSocket.h from [5654a78b4e] to [6382beb2ce].
︙ | ︙ | |||
65 66 67 68 69 70 71 | socklen_t _addressLength; OFString *_SOCKS5Host; uint16_t _SOCKS5Port; } #ifdef OF_HAVE_PROPERTIES @property (readonly, getter=isListening) bool listening; | | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | socklen_t _addressLength; OFString *_SOCKS5Host; uint16_t _SOCKS5Port; } #ifdef OF_HAVE_PROPERTIES @property (readonly, getter=isListening) bool listening; @property OF_NULLABLE_PROPERTY (copy) OFString *SOCKS5Host; @property uint16_t SOCKS5Port; @property (getter=isKeepAliveEnabled) bool keepAliveEnabled; @property (getter=isTCPNoDelayEnabled) bool TCPNoDelayEnabled; #endif /*! * @brief Sets the global SOCKS5 proxy host to use when creating a new socket |
︙ | ︙ |
Modified src/OFTLSSocket.h from [968eca3d6d] to [d1223f2527].
︙ | ︙ | |||
53 54 55 56 57 58 59 | * @protocol OFTLSSocket OFTLSSocket.h ObjFW/OFTLSSocket.h * * @brief A protocol that should be implemented by 3rd-party libraries * implementing TLS. */ @protocol OFTLSSocket #ifdef OF_HAVE_PROPERTIES | | > | | | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | * @protocol OFTLSSocket OFTLSSocket.h ObjFW/OFTLSSocket.h * * @brief A protocol that should be implemented by 3rd-party libraries * implementing TLS. */ @protocol OFTLSSocket #ifdef OF_HAVE_PROPERTIES @property OF_NULLABLE_PROPERTY (assign) id <OFTLSSocketDelegate> delegate; @property OF_NULLABLE_PROPERTY (copy) OFString *certificateFile, *privateKeyFile; @property OF_NULLABLE_PROPERTY (assign) const char *privateKeyPassphrase; @property (getter=isCertificateVerificationEnabled) bool certificateVerificationEnabled; #endif /*! * @brief Initializes the TLS socket with the specified TCP socket as its * underlying socket. |
︙ | ︙ |
Modified src/OFURL.h from [a3a984e369] to [f7f23cc369].
︙ | ︙ | |||
30 31 32 33 34 35 36 | { OFString *_scheme, *_host; uint16_t _port; OFString *_user, *_password, *_path, *_parameters, *_query, *_fragment; } #ifdef OF_HAVE_PROPERTIES | | < | < | < < | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | { OFString *_scheme, *_host; uint16_t _port; OFString *_user, *_password, *_path, *_parameters, *_query, *_fragment; } #ifdef OF_HAVE_PROPERTIES @property (copy) OFString *scheme, *host; @property uint16_t port; @property OF_NULLABLE_PROPERTY (copy) OFString *user, *password; @property (copy) OFString *path; @property OF_NULLABLE_PROPERTY (copy) OFString *parameters, *query, *fragment; #endif /*! * Creates a new URL. * * @return A new, autoreleased OFURL */ |
︙ | ︙ |
Modified src/OFXMLAttribute.h from [06dd68e3e3] to [bddff10d67].
︙ | ︙ | |||
30 31 32 33 34 35 36 | @public OFString *_name, *_namespace, *_stringValue; } #ifdef OF_HAVE_PROPERTIES @property (readonly, copy) OFString *name; # ifdef __cplusplus | | > | | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | @public OFString *_name, *_namespace, *_stringValue; } #ifdef OF_HAVE_PROPERTIES @property (readonly, copy) OFString *name; # ifdef __cplusplus @property OF_NULLABLE_PROPERTY (readonly, copy, getter=namespace) OFString *namespace_; # else @property OF_NULLABLE_PROPERTY (readonly, copy) OFString *namespace; # endif #endif /*! * @brief Creates a new XML attribute. * * @param name The name of the attribute |
︙ | ︙ |
Modified src/OFXMLElement.h from [06c926080e] to [f0a48e322d].
︙ | ︙ | |||
39 40 41 42 43 44 45 | OFMutableDictionary OF_GENERIC(OFString*, OFString*) *_namespaces; OFMutableArray OF_GENERIC(OFXMLNode*) *_children; } #ifdef OF_HAVE_PROPERTIES @property (copy) OFString *name; # ifdef __cplusplus | | | | | | | | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | OFMutableDictionary OF_GENERIC(OFString*, OFString*) *_namespaces; OFMutableArray OF_GENERIC(OFXMLNode*) *_children; } #ifdef OF_HAVE_PROPERTIES @property (copy) OFString *name; # ifdef __cplusplus @property OF_NULLABLE_PROPERTY (copy, getter=namespace, setter=setNamespace:) OFString *namespace_; # else @property OF_NULLABLE_PROPERTY (copy) OFString *namespace; # endif @property OF_NULLABLE_PROPERTY (copy) OFString *defaultNamespace; @property OF_NULLABLE_PROPERTY (copy, readonly) OFArray OF_GENERIC(OFXMLAttribute*) *attributes; @property OF_NULLABLE_PROPERTY (copy) OFArray OF_GENERIC(OFXMLNode*) *children; #endif /*! * @brief Creates a new XML element with the specified name. * * @param name The name for the element * @return A new autoreleased OFXMLElement with the specified element name |
︙ | ︙ |
Modified src/OFXMLElementBuilder.h from [0cd8345c79] to [4ca47d4bb3].
︙ | ︙ | |||
109 110 111 112 113 114 115 | @interface OFXMLElementBuilder: OFObject <OFXMLParserDelegate> { OFMutableArray OF_GENERIC(OFXMLElement*) *_stack; id <OFXMLElementBuilderDelegate> _delegate; } #ifdef OF_HAVE_PROPERTIES | > | | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | @interface OFXMLElementBuilder: OFObject <OFXMLParserDelegate> { OFMutableArray OF_GENERIC(OFXMLElement*) *_stack; id <OFXMLElementBuilderDelegate> _delegate; } #ifdef OF_HAVE_PROPERTIES @property OF_NULLABLE_PROPERTY (assign) id <OFXMLElementBuilderDelegate> delegate; #endif /*! * @brief Creates a new element builder. * * @return A new, autoreleased OFXMLElementBuilder */ |
︙ | ︙ |
Modified src/OFXMLParser.h from [67de382a36] to [8ab695520f].
︙ | ︙ | |||
174 175 176 177 178 179 180 | size_t _lineNumber; bool _lastCarriageReturn, _finishedParsing; of_string_encoding_t _encoding; size_t _depthLimit; } #ifdef OF_HAVE_PROPERTIES | | | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | size_t _lineNumber; bool _lastCarriageReturn, _finishedParsing; of_string_encoding_t _encoding; size_t _depthLimit; } #ifdef OF_HAVE_PROPERTIES @property OF_NULLABLE_PROPERTY (assign) id <OFXMLParserDelegate> delegate; @property size_t depthLimit; #endif /*! * @brief Creates a new XML parser. * * @return A new, autoreleased OFXMLParser |
︙ | ︙ |
Modified src/macros.h from [6f2726fb11] to [67aef400e2].
︙ | ︙ | |||
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 | #endif #if __has_feature(nullability) # define OF_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") # define OF_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") # define OF_NONNULL __nonnull # define OF_NULLABLE __nullable #else # define OF_ASSUME_NONNULL_BEGIN # define OF_ASSUME_NONNULL_END # define OF_NONNULL # define OF_NULLABLE # define nonnull # define nullable #endif #if __has_feature(objc_kindof) # define OF_KINDOF(cls) __kindof cls #else | > > | 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | #endif #if __has_feature(nullability) # define OF_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") # define OF_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") # define OF_NONNULL __nonnull # define OF_NULLABLE __nullable # define OF_NULLABLE_PROPERTY(...) (__VA_ARGS__, nullable) #else # define OF_ASSUME_NONNULL_BEGIN # define OF_ASSUME_NONNULL_END # define OF_NONNULL # define OF_NULLABLE # define OF_NULLABLE_PROPERTY # define nonnull # define nullable #endif #if __has_feature(objc_kindof) # define OF_KINDOF(cls) __kindof cls #else |
︙ | ︙ |