Index: src/XMPPAuthenticator.h ================================================================== --- src/XMPPAuthenticator.h +++ src/XMPPAuthenticator.h @@ -25,13 +25,11 @@ /** * \brief A base class for classes implementing authentication mechanisms */ @interface XMPPAuthenticator: OFObject { - OFString *_authzid; - OFString *_authcid; - OFString *_password; + OFString *_authzid, *_authcid, *_password; } #ifdef OF_HAVE_PROPERTIES /// \brief The authzid to get authorization for @property (copy) OFString *authzid; Index: src/XMPPCallback.h ================================================================== --- src/XMPPCallback.h +++ src/XMPPCallback.h @@ -24,19 +24,19 @@ @class XMPPConnection; @class XMPPIQ; #ifdef OF_HAVE_BLOCKS -typedef void(^xmpp_callback_block_t)(XMPPConnection*, XMPPIQ*); +typedef void (^xmpp_callback_block_t)(XMPPConnection*, XMPPIQ*); #endif @interface XMPPCallback: OFObject { id _target; SEL _selector; #ifdef OF_HAVE_BLOCKS - xmpp_callback_block_t block; + xmpp_callback_block_t _block; #endif } #ifdef OF_HAVE_BLOCKS + callbackWithBlock: (xmpp_callback_block_t)callback; Index: src/XMPPCallback.m ================================================================== --- src/XMPPCallback.m +++ src/XMPPCallback.m @@ -31,16 +31,16 @@ + callbackWithBlock: (xmpp_callback_block_t)block { return [[(XMPPCallback*)[self alloc] initWithBlock: block] autorelease]; } -- initWithBlock: (xmpp_callback_block_t)block_ +- initWithBlock: (xmpp_callback_block_t)block { self = [super init]; @try { - block = [block_ copy]; + _block = [block copy]; } @catch (id e) { [self release]; @throw e; } @@ -68,24 +68,24 @@ - (void)dealloc { [_target release]; #ifdef OF_HAVE_BLOCKS - [block release]; + [_block release]; #endif [super dealloc]; } - (void)runWithIQ: (XMPPIQ*)iq connection: (XMPPConnection*)connection { #ifdef OF_HAVE_BLOCKS - if (block != NULL) - block(connection, iq); + if (_block != NULL) + _block(connection, iq); else #endif [_target performSelector: _selector withObject: connection withObject: iq]; } @end Index: src/XMPPDiscoIdentity.h ================================================================== --- src/XMPPDiscoIdentity.h +++ src/XMPPDiscoIdentity.h @@ -25,13 +25,11 @@ /** * \brief A class describing a Service Discovery Identity */ @interface XMPPDiscoIdentity: OFObject { - OFString *_category; - OFString *_name; - OFString *_type; + OFString *_category, *_name, *_type; } #ifdef OF_HAVE_PROPERTIES /// \brief The category of the identity @property (readonly) OFString *category; /// \brief The name of the identity, might be unset Index: src/XMPPExceptions.h ================================================================== --- src/XMPPExceptions.h +++ src/XMPPExceptions.h @@ -62,12 +62,11 @@ /** * \brief An exception indicating a stream error was received */ @interface XMPPStreamErrorException: XMPPException { - OFString *_condition; - OFString *_reason; + OFString *_condition, *_reason; } #ifdef OF_HAVE_PROPERTIES /// \brief The defined error condition specified by the stream error @property (readonly, assign) OFString *condition; @@ -107,12 +106,11 @@ * \brief An exception indicating a stringprep profile * did not apply to a string */ @interface XMPPStringPrepFailedException: XMPPException { - OFString *_profile; - OFString *_string; + OFString *_profile, *_string; } #ifdef OF_HAVE_PROPERTIES /// \brief The name of the stringprep profile that did not apply @property (readonly, assign) OFString *profile; @@ -151,12 +149,11 @@ /** * \brief An exception indicating IDNA translation of a string failed */ @interface XMPPIDNATranslationFailedException: XMPPException { - OFString *_operation; - OFString *_string; + OFString *_operation, *_string; } #ifdef OF_HAVE_PROPERTIES /// \brief The IDNA translation operation which failed @property (readonly, assign) OFString *operation; Index: src/XMPPJID.h ================================================================== --- src/XMPPJID.h +++ src/XMPPJID.h @@ -26,13 +26,11 @@ /** * \brief A class for easy handling of JIDs. */ @interface XMPPJID: OFObject { - OFString *_node; - OFString *_domain; - OFString *_resource; + OFString *_node, *_domain, *_resource; } #ifdef OF_HAVE_PROPERTIES /// \brief The JID's localpart @property (copy) OFString *node; Index: src/XMPPPresence.h ================================================================== --- src/XMPPPresence.h +++ src/XMPPPresence.h @@ -26,14 +26,13 @@ /** * \brief A class describing a presence stanza. */ @interface XMPPPresence: XMPPStanza { - OFString *_status; - OFString *_show; - OFNumber *_priority; + OFString *_status, *_show, *_priority; } + #ifdef OF_HAVE_PROPERTIES @property (copy) OFString *status; @property (copy) OFString *show; @property (copy) OFNumber *priority; #endif @@ -133,11 +132,12 @@ * \param priority The numeric content of the priority element */ - (void)setPriority: (OFNumber*)priority; /** - * \brief Returns the numeric content of the priority element of the presence stanza. + * \brief Returns the numeric content of the priority element of the presence + * stanza. * * \return The numeric content of the priority element of the presence stanza. */ - (OFNumber*)priority; @end Index: src/XMPPSRVLookup.h ================================================================== --- src/XMPPSRVLookup.h +++ src/XMPPSRVLookup.h @@ -81,13 +81,13 @@ - (void)XMPP_addEntry: (XMPPSRVEntry*)item; @end @interface XMPPSRVEnumerator: OFEnumerator { - OFList *list; - of_list_object_t *listIter; - OFList *subListCopy; - bool done; + OFList *_list; + of_list_object_t *_listIter; + OFList *_subListCopy; + bool _done; } - initWithList: (OFList*)list; @end Index: src/XMPPSRVLookup.m ================================================================== --- src/XMPPSRVLookup.m +++ src/XMPPSRVLookup.m @@ -301,16 +301,16 @@ return [[[XMPPSRVEnumerator alloc] initWithList: _list] autorelease]; } @end @implementation XMPPSRVEnumerator -- initWithList: (OFList*)list_ +- initWithList: (OFList*)list { self = [super init]; @try { - list = [list_ copy]; + _list = [list copy]; } @catch (id e) { [self release]; @throw e; } @@ -321,62 +321,62 @@ { XMPPSRVEntry *ret = nil; of_list_object_t *iter; uint32_t totalWeight = 0; - if (done) + if (_done) return nil; - if (listIter == NULL) - listIter = [list firstListObject]; + if (_listIter == NULL) + _listIter = [_list firstListObject]; - if (listIter == NULL) + if (_listIter == NULL) return nil; - if (subListCopy == nil) - subListCopy = [listIter->object copy]; + if (_subListCopy == nil) + _subListCopy = [_listIter->object copy]; - for (iter = [subListCopy firstListObject]; iter != NULL; + for (iter = [_subListCopy firstListObject]; iter != NULL; iter = iter->next) { totalWeight += [iter->object weight]; [iter->object setAccumulatedWeight: totalWeight]; } - if ([subListCopy count] > 0) { + if ([_subListCopy count] > 0) { uint32_t randomWeight; RAND_pseudo_bytes((uint8_t*)&randomWeight, sizeof(uint32_t)); randomWeight %= (totalWeight + 1); - for (iter = [subListCopy firstListObject]; iter != NULL; + for (iter = [_subListCopy firstListObject]; iter != NULL; iter = iter->next) { if ([iter->object accumulatedWeight] >= randomWeight) { ret = [[iter->object retain] autorelease]; - [subListCopy removeListObject: iter]; + [_subListCopy removeListObject: iter]; break; } } } - if ([subListCopy count] == 0) { - [subListCopy release]; - subListCopy = nil; - - listIter = listIter->next; - - if (listIter == NULL) - done = true; + if ([_subListCopy count] == 0) { + [_subListCopy release]; + _subListCopy = nil; + + _listIter = _listIter->next; + + if (_listIter == NULL) + _done = true; } return ret; } - (void)reset { - listIter = NULL; - [subListCopy release]; - subListCopy = nil; - done = false; + _listIter = NULL; + [_subListCopy release]; + _subListCopy = nil; + _done = false; } @end Index: src/XMPPStanza.h ================================================================== --- src/XMPPStanza.h +++ src/XMPPStanza.h @@ -28,15 +28,12 @@ /** * \brief A class describing an XMPP Stanza. */ @interface XMPPStanza: OFXMLElement { - XMPPJID *_from; - XMPPJID *_to; - OFString *_type; - OFString *_ID; - OFString *_language; + XMPPJID *_from, *_to; + OFString *_type, *_ID, *_language; } #ifdef OF_HAVE_PROPERTIES /// \brief The value of the stanza's from attribute @property (copy) XMPPJID *from; Index: src/XMPPStreamManagement.h ================================================================== --- src/XMPPStreamManagement.h +++ src/XMPPStreamManagement.h @@ -26,10 +26,10 @@ #ifdef OF_HAVE_OPTIONAL_PROTOCOLS #endif { XMPPConnection *_connection; - uint32_t receivedCount; + uint32_t _receivedCount; } - initWithConnection: (XMPPConnection*)connection; @end Index: src/XMPPStreamManagement.m ================================================================== --- src/XMPPStreamManagement.m +++ src/XMPPStreamManagement.m @@ -22,18 +22,17 @@ #import "XMPPStreamManagement.h" #import "namespaces.h" @implementation XMPPStreamManagement -- initWithConnection: (XMPPConnection*)connection_ +- initWithConnection: (XMPPConnection*)connection { self = [super init]; @try { - _connection = connection_; + _connection = connection; [_connection addDelegate: self]; - receivedCount = 0; } @catch (id e) { [self release]; @throw e; } @@ -45,19 +44,19 @@ [_connection removeDelegate: self]; [super dealloc]; } -- (void)connection: (XMPPConnection*)connection_ +- (void)connection: (XMPPConnection*)connection didReceiveElement: (OFXMLElement*)element { OFString *elementName = [element name]; OFString *elementNS = [element namespace]; if ([elementNS isEqual: XMPP_NS_SM]) { if ([elementName isEqual: @"enabled"]) { - receivedCount = 0; + _receivedCount = 0; return; } if ([elementName isEqual: @"failed"]) { /* TODO: How do we handle this? */ @@ -66,27 +65,27 @@ if ([elementName isEqual: @"r"]) { OFXMLElement *ack = [OFXMLElement elementWithName: @"a" namespace: XMPP_NS_SM]; + OFString *stringValue = [OFString + stringWithFormat: @"%" PRIu32, _receivedCount]; [ack addAttributeWithName: @"h" - stringValue: - [OFString stringWithFormat: @"%" PRIu32, - receivedCount]]; - [connection_ sendStanza: ack]; + stringValue: stringValue]; + [connection sendStanza: ack]; } } if ([elementNS isEqual: XMPP_NS_CLIENT] && ([elementName isEqual: @"iq"] || [elementName isEqual: @"presence"] || [elementName isEqual: @"message"])) - receivedCount++; + _receivedCount++; } /* TODO: Count outgoing stanzas here and cache them, send own ACK requests -- (void)connection: (XMPPConnection*)connection_ +- (void)connection: (XMPPConnection*)connection didSendElement: (OFXMLElement*)element { } */