From e0ff07860ad4ea9456543a9b8e06da093563d142 Mon Sep 17 00:00:00 2001 From: Jonathan Schleifer Date: Sun, 23 Jul 2017 14:07:40 +0200 Subject: [PATCH] Make sure all properties are nonatomic --- configure.ac | 2 ++ src/XMPPConnection.h | 12 ++++++------ src/XMPPDiscoEntity.h | 4 ++-- src/XMPPMessage.h | 6 ++++-- src/XMPPRoster.h | 2 +- src/XMPPSRVLookup.h | 8 ++++---- 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/configure.ac b/configure.ac index eb4b863..0a584f3 100644 --- a/configure.ac +++ b/configure.ac @@ -24,6 +24,8 @@ OBJCFLAGS="$OBJCFLAGS -Wall $($OBJFW_CONFIG --objcflags)" LDFLAGS="$LDFLAGS $($OBJFW_CONFIG --ldflags)" LIBS="$LIBS $($OBJFW_CONFIG --libs)" +AX_CHECK_COMPILER_FLAGS(-Watomic-properties, + [OBJCFLAGS="$OBJCFLAGS -Watomic-properties"]) AX_CHECK_COMPILER_FLAGS(-Wdocumentation, [OBJCFLAGS="$OBJCFLAGS -Wdocumentation"]) diff --git a/src/XMPPConnection.h b/src/XMPPConnection.h index b681067..bed99eb 100644 --- a/src/XMPPConnection.h +++ b/src/XMPPConnection.h @@ -219,12 +219,12 @@ OF_ASSUME_NONNULL_BEGIN /*! * The port to connect to. */ -@property uint16_t port; +@property (nonatomic) uint16_t port; /*! * An object for data storage, conforming to the XMPPStorage protocol. */ -@property OF_NULLABLE_PROPERTY (assign) id dataStorage; +@property OF_NULLABLE_PROPERTY (nonatomic, assign) id dataStorage; /*! * The socket used for the connection. @@ -234,22 +234,22 @@ OF_ASSUME_NONNULL_BEGIN /*! * Whether encryption is required. */ -@property bool encryptionRequired; +@property (nonatomic) bool encryptionRequired; /*! * Whether the connection is encrypted. */ -@property (readonly) bool encrypted; +@property (readonly, nonatomic) bool encrypted; /*! * Whether roster versioning is supported. */ -@property (readonly) bool supportsRosterVersioning; +@property (readonly, nonatomic) bool supportsRosterVersioning; /*! * Whether stream management is supported. */ -@property (readonly) bool supportsStreamManagement; +@property (readonly, nonatomic) bool supportsStreamManagement; /*! * Creates a new autoreleased XMPPConnection. diff --git a/src/XMPPDiscoEntity.h b/src/XMPPDiscoEntity.h index 21e07da..852c9c3 100644 --- a/src/XMPPDiscoEntity.h +++ b/src/XMPPDiscoEntity.h @@ -48,12 +48,12 @@ OF_ASSUME_NONNULL_BEGIN * This usually contains at least all immediate child nodes, but may contain * any number of nodes nested more deeply. */ -@property (readonly) OFDictionary *discoNodes; +@property (readonly, nonatomic) OFDictionary *discoNodes; /*! * The node advertised for the entity's capabilites. */ -@property (readonly) OFString *capsNode; +@property (readonly, nonatomic) OFString *capsNode; + (instancetype)discoNodeWithJID: (XMPPJID *)JID node: (nullable OFString *)node OF_UNAVAILABLE; diff --git a/src/XMPPMessage.h b/src/XMPPMessage.h index 2a6a28a..a436e4c 100644 --- a/src/XMPPMessage.h +++ b/src/XMPPMessage.h @@ -29,8 +29,10 @@ OF_ASSUME_NONNULL_BEGIN * @brief A class describing a message stanza. */ @interface XMPPMessage: XMPPStanza -/*! The text content of the body of the message. */ -@property (copy) OFString *body; +/*! + * The text content of the body of the message. + */ +@property (nonatomic, copy) OFString *body; /*! * @brief Creates a new autoreleased XMPPMessage. diff --git a/src/XMPPRoster.h b/src/XMPPRoster.h index 3a76111..b1de940 100644 --- a/src/XMPPRoster.h +++ b/src/XMPPRoster.h @@ -72,7 +72,7 @@ OF_ASSUME_NONNULL_BEGIN /*! * @brief The connection to which the roster belongs */ -@property (readonly, assign) XMPPConnection *connection; +@property (readonly, nonatomic) XMPPConnection *connection; /*! * @brief An object for data storage, conforming to the XMPPStorage protocol. diff --git a/src/XMPPSRVLookup.h b/src/XMPPSRVLookup.h index 16cdcd0..12c4c7f 100644 --- a/src/XMPPSRVLookup.h +++ b/src/XMPPSRVLookup.h @@ -38,10 +38,10 @@ OF_ASSUME_NONNULL_BEGIN OFString *_target; } -@property (readonly) uint16_t priority; -@property (readonly) uint16_t weight; -@property uint32_t accumulatedWeight; -@property (readonly) uint16_t port; +@property (readonly, nonatomic) uint16_t priority; +@property (readonly, nonatomic) uint16_t weight; +@property (nonatomic) uint32_t accumulatedWeight; +@property (readonly, nonatomic) uint16_t port; @property (readonly, nonatomic) OFString *target; + (instancetype)entryWithPriority: (uint16_t)priority