diff --git a/src/XMPPAuthenticator.h b/src/XMPPAuthenticator.h index 06ee018..ec1fdc8 100644 --- a/src/XMPPAuthenticator.h +++ b/src/XMPPAuthenticator.h @@ -27,9 +27,7 @@ */ @interface XMPPAuthenticator: OFObject { - OFString *_authzid; - OFString *_authcid; - OFString *_password; + OFString *_authzid, *_authcid, *_password; } #ifdef OF_HAVE_PROPERTIES diff --git a/src/XMPPCallback.h b/src/XMPPCallback.h index bbe2e73..41568bf 100644 --- a/src/XMPPCallback.h +++ b/src/XMPPCallback.h @@ -26,7 +26,7 @@ @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 @@ -34,7 +34,7 @@ typedef void(^xmpp_callback_block_t)(XMPPConnection*, XMPPIQ*); id _target; SEL _selector; #ifdef OF_HAVE_BLOCKS - xmpp_callback_block_t block; + xmpp_callback_block_t _block; #endif } diff --git a/src/XMPPCallback.m b/src/XMPPCallback.m index ac70f61..edd5536 100644 --- a/src/XMPPCallback.m +++ b/src/XMPPCallback.m @@ -33,12 +33,12 @@ 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; @@ -70,7 +70,7 @@ { [_target release]; #ifdef OF_HAVE_BLOCKS - [block release]; + [_block release]; #endif [super dealloc]; @@ -80,8 +80,8 @@ connection: (XMPPConnection*)connection { #ifdef OF_HAVE_BLOCKS - if (block != NULL) - block(connection, iq); + if (_block != NULL) + _block(connection, iq); else #endif [_target performSelector: _selector diff --git a/src/XMPPDiscoIdentity.h b/src/XMPPDiscoIdentity.h index 118a0c5..abe09fc 100644 --- a/src/XMPPDiscoIdentity.h +++ b/src/XMPPDiscoIdentity.h @@ -27,9 +27,7 @@ */ @interface XMPPDiscoIdentity: OFObject { - OFString *_category; - OFString *_name; - OFString *_type; + OFString *_category, *_name, *_type; } #ifdef OF_HAVE_PROPERTIES /// \brief The category of the identity diff --git a/src/XMPPExceptions.h b/src/XMPPExceptions.h index feb59f2..002ac9a 100644 --- a/src/XMPPExceptions.h +++ b/src/XMPPExceptions.h @@ -64,8 +64,7 @@ */ @interface XMPPStreamErrorException: XMPPException { - OFString *_condition; - OFString *_reason; + OFString *_condition, *_reason; } #ifdef OF_HAVE_PROPERTIES @@ -109,8 +108,7 @@ */ @interface XMPPStringPrepFailedException: XMPPException { - OFString *_profile; - OFString *_string; + OFString *_profile, *_string; } #ifdef OF_HAVE_PROPERTIES @@ -153,8 +151,7 @@ */ @interface XMPPIDNATranslationFailedException: XMPPException { - OFString *_operation; - OFString *_string; + OFString *_operation, *_string; } #ifdef OF_HAVE_PROPERTIES diff --git a/src/XMPPJID.h b/src/XMPPJID.h index b250c00..90fc6c1 100644 --- a/src/XMPPJID.h +++ b/src/XMPPJID.h @@ -28,9 +28,7 @@ */ @interface XMPPJID: OFObject { - OFString *_node; - OFString *_domain; - OFString *_resource; + OFString *_node, *_domain, *_resource; } #ifdef OF_HAVE_PROPERTIES diff --git a/src/XMPPPresence.h b/src/XMPPPresence.h index 1bb1d00..4f6f72a 100644 --- a/src/XMPPPresence.h +++ b/src/XMPPPresence.h @@ -28,10 +28,9 @@ */ @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; @@ -135,7 +134,8 @@ - (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. */ diff --git a/src/XMPPSRVLookup.h b/src/XMPPSRVLookup.h index a11f342..d62465b 100644 --- a/src/XMPPSRVLookup.h +++ b/src/XMPPSRVLookup.h @@ -83,10 +83,10 @@ @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; diff --git a/src/XMPPSRVLookup.m b/src/XMPPSRVLookup.m index c5df961..5aab135 100644 --- a/src/XMPPSRVLookup.m +++ b/src/XMPPSRVLookup.m @@ -303,12 +303,12 @@ @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; @@ -323,50 +323,50 @@ 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; + if ([_subListCopy count] == 0) { + [_subListCopy release]; + _subListCopy = nil; - listIter = listIter->next; + _listIter = _listIter->next; - if (listIter == NULL) - done = true; + if (_listIter == NULL) + _done = true; } return ret; @@ -374,9 +374,9 @@ - (void)reset { - listIter = NULL; - [subListCopy release]; - subListCopy = nil; - done = false; + _listIter = NULL; + [_subListCopy release]; + _subListCopy = nil; + _done = false; } @end diff --git a/src/XMPPStanza.h b/src/XMPPStanza.h index 22f1faa..7601655 100644 --- a/src/XMPPStanza.h +++ b/src/XMPPStanza.h @@ -30,11 +30,8 @@ */ @interface XMPPStanza: OFXMLElement { - XMPPJID *_from; - XMPPJID *_to; - OFString *_type; - OFString *_ID; - OFString *_language; + XMPPJID *_from, *_to; + OFString *_type, *_ID, *_language; } #ifdef OF_HAVE_PROPERTIES diff --git a/src/XMPPStreamManagement.h b/src/XMPPStreamManagement.h index 8947073..32b6a92 100644 --- a/src/XMPPStreamManagement.h +++ b/src/XMPPStreamManagement.h @@ -28,7 +28,7 @@ #endif { XMPPConnection *_connection; - uint32_t receivedCount; + uint32_t _receivedCount; } - initWithConnection: (XMPPConnection*)connection; diff --git a/src/XMPPStreamManagement.m b/src/XMPPStreamManagement.m index 7bd5adf..54083fe 100644 --- a/src/XMPPStreamManagement.m +++ b/src/XMPPStreamManagement.m @@ -24,14 +24,13 @@ #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; @@ -47,7 +46,7 @@ [super dealloc]; } -- (void)connection: (XMPPConnection*)connection_ +- (void)connection: (XMPPConnection*)connection didReceiveElement: (OFXMLElement*)element { OFString *elementName = [element name]; @@ -55,7 +54,7 @@ if ([elementNS isEqual: XMPP_NS_SM]) { if ([elementName isEqual: @"enabled"]) { - receivedCount = 0; + _receivedCount = 0; return; } @@ -68,11 +67,11 @@ 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]; } } @@ -80,11 +79,11 @@ ([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 { }