Permalink
Browse files

Fixing warnings for "uninitialized automatic variables"

  • Loading branch information...
1 parent 6a36fb5 commit 398951c50a773aa3cde7c42e3fa15c2957dbb89b @robbiehanson committed Sep 1, 2011
View
@@ -481,7 +481,7 @@ - (UInt64)numberOfBytesReceived
- (BOOL)resetByteCountPerConnection
{
- __block BOOL result;
+ __block BOOL result = NO;
dispatch_block_t block = ^{
result = (config & kResetByteCountPerConnection) ? YES : NO;
@@ -514,7 +514,7 @@ - (void)setResetByteCountPerConnection:(BOOL)flag
- (BOOL)enableBackgroundingOnSocket
{
- __block BOOL result;
+ __block BOOL result = NO;
dispatch_block_t block = ^{
result = (config & kEnableBackgroundingOnSocket) ? YES : NO;
@@ -676,7 +676,7 @@ - (void)setDidStartNegotiation:(BOOL)flag
**/
- (BOOL)isDisconnected
{
- __block BOOL result;
+ __block BOOL result = NO;
dispatch_block_t block = ^{
result = (state == STATE_XMPP_DISCONNECTED);
@@ -696,7 +696,7 @@ - (BOOL)isDisconnected
**/
- (BOOL)isConnected
{
- __block BOOL result;
+ __block BOOL result = NO;
dispatch_block_t block = ^{
result = (state == STATE_XMPP_CONNECTED);
@@ -854,7 +854,7 @@ - (BOOL)oldSchoolSecureConnect:(NSError **)errPtr
{
XMPPLogTrace();
- __block BOOL result;
+ __block BOOL result = NO;
__block NSError *err = nil;
dispatch_block_t block = ^{
@@ -4027,7 +4027,7 @@ - (NSThread *)xmppUtilityThread
- (NSRunLoop *)xmppUtilityRunLoop
{
- __block NSRunLoop *result;
+ __block NSRunLoop *result = nil;
dispatch_block_t block = ^{
result = [xmppUtilityRunLoop retain];
@@ -98,7 +98,7 @@ - (void)dealloc
- (BOOL)autoReconnect
{
- __block BOOL result;
+ __block BOOL result = NO;
dispatch_block_t block = ^{
result = (config & kAutoReconnect) ? YES : NO;
@@ -133,7 +133,7 @@ - (GCDMulticastDelegate *)multicastDelegate
- (BOOL)autoFetchRoster
{
- __block BOOL result;
+ __block BOOL result = NO;
dispatch_block_t block = ^{
result = (config & kAutoFetchRoster) ? YES : NO;
@@ -165,7 +165,7 @@ - (void)setAutoFetchRoster:(BOOL)flag
- (BOOL)autoAcceptKnownPresenceSubscriptionRequests
{
- __block BOOL result;
+ __block BOOL result = NO;
dispatch_block_t block = ^{
result = (config & kAutoAcceptKnownPresenceSubscriptionRequests) ? YES : NO;
@@ -253,7 +253,7 @@ - (BOOL)setCapabilitiesNode:(NSString *)node
XMPPLogTrace();
- __block BOOL result;
+ __block BOOL result = NO;
__block NSXMLElement *newCapabilities = nil;
[self executeBlock:^{
@@ -329,9 +329,9 @@ - (BOOL)getCapabilitiesHash:(NSString **)hashPtr
XMPPLogTrace();
- __block BOOL result;
- __block NSString *hash;
- __block NSString *hashAlg;
+ __block BOOL result = NO;
+ __block NSString *hash = nil;
+ __block NSString *hashAlg = nil;
[self executeBlock:^{
@@ -192,7 +192,7 @@ - (void)dealloc
- (BOOL)autoFetchHashedCapabilities
{
- __block BOOL result;
+ __block BOOL result = NO;
dispatch_block_t block = ^{
result = autoFetchHashedCapabilities;
@@ -220,7 +220,7 @@ - (void)setAutoFetchHashedCapabilities:(BOOL)flag
- (BOOL)autoFetchNonHashedCapabilities
{
- __block BOOL result;
+ __block BOOL result = NO;
dispatch_block_t block = ^{
result = autoFetchNonHashedCapabilities;
@@ -1336,7 +1336,7 @@ - (void)maybeQueryNextJidWithHashKey:(NSString *)key dueToHashMismatch:(BOOL)has
if (requestIndex < [jids count])
{
- XMPPJID *jid = [jids objectAtIndex:requestIndex];
+ jid = [jids objectAtIndex:requestIndex];
NSString *node = nil;
NSString *ver = nil;
@@ -1373,7 +1373,7 @@ - (void)maybeQueryNextJidWithHashKey:(NSString *)key dueToHashMismatch:(BOOL)has
NSUInteger i;
for (i = 1; i < [jids count]; i++)
{
- XMPPJID *jid = [jids objectAtIndex:i];
+ jid = [jids objectAtIndex:i];
[discoRequestJidSet removeObject:jid];
[xmppCapabilitiesStorage setCapabilitiesFetchFailedForJID:jid xmppStream:xmppStream];
@@ -6,7 +6,7 @@
// Log levels: off, error, warn, info, verbose
// Log flags: trace
#if DEBUG
- static const int xmppLogLevel = XMPP_LOG_LEVEL_WARN | XMPP_LOG_FLAG_TRACE;
+ static const int xmppLogLevel = XMPP_LOG_LEVEL_WARN; // | XMPP_LOG_FLAG_TRACE;
#else
static const int xmppLogLevel = XMPP_LOG_LEVEL_WARN;
#endif
@@ -276,10 +276,10 @@ - (BOOL)xmppStream:(XMPPStream *)sender didReceiveIQ:(XMPPIQ *)iq
NSXMLElement *time = [iq elementForName:@"time" xmlns:@"urn:xmpp:time"];
if (time)
{
- NSXMLElement *time = [[self class] timeElement];
+ NSXMLElement *currentTime = [[self class] timeElement];
XMPPIQ *response = [XMPPIQ iqWithType:@"result" to:[iq from] elementID:[iq elementID]];
- [response addChild:time];
+ [response addChild:currentTime];
[sender sendElement:response];
@@ -275,11 +275,11 @@ - (void)forwardInvocation:(NSInvocation *)origInvocation
NSInvocation *dupInvocation = [self duplicateInvocation:origInvocation];
dispatch_async(node->delegateQueue, ^{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ NSAutoreleasePool *delegatePool = [[NSAutoreleasePool alloc] init];
[dupInvocation invokeWithTarget:delegate];
- [pool drain];
+ [delegatePool drain];
});
}
@@ -91,7 +91,7 @@ - (void)dealloc
- (NSString *)srvName
{
- __block NSString *result;
+ __block NSString *result = nil;
dispatch_block_t block = ^{
result = [srvName copy];
@@ -107,7 +107,7 @@ - (NSString *)srvName
- (NSTimeInterval)timeout
{
- __block NSTimeInterval result;
+ __block NSTimeInterval result = 0.0;
dispatch_block_t block = ^{
result = timeout;
@@ -509,10 +509,10 @@ - (void)startWithSRVName:(NSString *)aSRVName timeout:(NSTimeInterval)aTimeout
// Invoking DNSServiceProcessResult will invoke our QueryRecordCallback,
// the callback we set when we created the sdRef.
- DNSServiceErrorType sdErr = DNSServiceProcessResult(sdRef);
- if (sdErr != kDNSServiceErr_NoError)
+ DNSServiceErrorType dnsErr = DNSServiceProcessResult(sdRef);
+ if (dnsErr != kDNSServiceErr_NoError)
{
- [self failWithDNSError:sdErr];
+ [self failWithDNSError:dnsErr];
}
[handlerPool drain];
@@ -1209,7 +1209,7 @@ - (void)setPreferIPv4OverIPv6:(BOOL)flag
- (id)userData
{
- __block id result;
+ __block id result = nil;
dispatch_block_t block = ^{
@@ -2851,7 +2851,7 @@ - (NSError *)otherError:(NSString *)errMsg
- (BOOL)isDisconnected
{
- __block BOOL result;
+ __block BOOL result = NO;
dispatch_block_t block = ^{
result = (flags & kSocketStarted) ? NO : YES;
@@ -2867,7 +2867,7 @@ - (BOOL)isDisconnected
- (BOOL)isConnected
{
- __block BOOL result;
+ __block BOOL result = NO;
dispatch_block_t block = ^{
result = (flags & kConnected) ? YES : NO;

0 comments on commit 398951c

Please sign in to comment.