adium 4569:284f6d593ee4: Fixed a bunch of "Value stored to 'OBJE...

commits at adium.im commits at adium.im
Thu Jan 26 23:23:45 UTC 2012


details:	http://hg.adium.im/adium/rev/284f6d593ee4
revision:	4569:284f6d593ee4
branch:		(none)
author:		Adrian Godoroja <robotive at me.com>
date:		Fri Jan 27 01:23:38 2012 +0200

Fixed a bunch of "Value stored to 'OBJECT' is never read". Analyzer Warnings--.

diffs (420 lines):

diff -r 87a0f0ebd59a -r 284f6d593ee4 Frameworks/Adium Framework/Source/AIAbstractAccount.m
--- a/Frameworks/Adium Framework/Source/AIAbstractAccount.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIAbstractAccount.m	Fri Jan 27 01:23:38 2012 +0200
@@ -76,11 +76,9 @@
 	internalObjectID = [inInternalObjectID retain];
 
     if ((self = [super initWithUID:inUID service:inService])) {
-		NSString	*accountModifiedUID;
-		
 		isTemporary = NO;
 		
-		accountModifiedUID = [self accountWillSetUID:UID];
+		[self accountWillSetUID:UID];
 
 		//Register the defaults
 		static NSDictionary	*defaults = nil;
diff -r 87a0f0ebd59a -r 284f6d593ee4 Frameworks/Adium Framework/Source/AIAbstractListController.m
--- a/Frameworks/Adium Framework/Source/AIAbstractListController.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIAbstractListController.m	Fri Jan 27 01:23:38 2012 +0200
@@ -450,19 +450,13 @@
 
 	[contactListView setDesiredHeightPadding:1];
 	
-	//Bubbles special cases
+	// Bubbles special cases
 	pillowsOrPillowsFittedWindowStyle = (windowStyle == AIContactListWindowStyleContactBubbles || windowStyle == AIContactListWindowStyleContactBubbles_Fitted);
+	
 	if (pillowsOrPillowsFittedWindowStyle) {
-		//Treat the padding as spacing
-		int contactSpacing = [[prefDict objectForKey:KEY_LIST_LAYOUT_CONTACT_SPACING] intValue];
-		
 		/* If we're outline bubbles, insist upon the spacing being sufficient for the outlines. Otherwise, we
 		 * allow drawing glitches as one bubble overlaps the rect of another.
 		 */
-		BOOL	outlineBubble = [[prefDict objectForKey:KEY_LIST_LAYOUT_OUTLINE_BUBBLE] boolValue];
-		int		outlineBubbleLineWidth = [[prefDict objectForKey:KEY_LIST_LAYOUT_OUTLINE_BUBBLE_WIDTH] intValue];
-		if (outlineBubble && (outlineBubbleLineWidth > contactSpacing)) contactSpacing = outlineBubbleLineWidth;
-		
 		[contentCell setSplitVerticalSpacing:[[prefDict objectForKey:KEY_LIST_LAYOUT_CONTACT_SPACING] intValue]];
 		[contentCell setLeftSpacing:[[prefDict objectForKey:KEY_LIST_LAYOUT_CONTACT_LEFT_INDENT] intValue]];
 		[contentCell setRightSpacing:[[prefDict objectForKey:KEY_LIST_LAYOUT_CONTACT_RIGHT_INDENT] intValue]];
@@ -728,15 +722,10 @@
 
 - (NSMenu *)outlineView:(NSOutlineView *)outlineView menuForEvent:(NSEvent *)theEvent
 {
-    NSPoint	location;
-    NSInteger		row;
-    id		item;
-	
-    //Get the clicked item
-    location = [outlineView convertPoint:[theEvent locationInWindow] fromView:nil];
-    row = [outlineView rowAtPoint:location];
-    item = [outlineView itemAtRow:row];
-	
+	// Get the clicked item -> row
+    NSPoint	location = [outlineView convertPoint:[theEvent locationInWindow] fromView:nil];
+    NSInteger row = [outlineView rowAtPoint:location];
+
     //Select the clicked row and bring the window forward
     [outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
     [[outlineView window] makeKeyAndOrderFront:nil];
diff -r 87a0f0ebd59a -r 284f6d593ee4 Frameworks/Adium Framework/Source/AIEditStateWindowController.m
--- a/Frameworks/Adium Framework/Source/AIEditStateWindowController.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIEditStateWindowController.m	Fri Jan 27 01:23:38 2012 +0200
@@ -520,7 +520,7 @@
 	current = [self _positionControl:box_idle relativeTo:current height:&height];
 	current = [self _positionControl:checkBox_muteSounds relativeTo:current height:&height];
 	current = [self _positionControl:checkBox_silenceGrowl relativeTo:current height:&height];
-	current = [self _positionControl:checkBox_save relativeTo:current height:&height];
+	[self _positionControl:checkBox_save relativeTo:current height:&height];
 
 	[window setContentSize:NSMakeSize([[window contentView] frame].size.width, height)
 				   display:YES
diff -r 87a0f0ebd59a -r 284f6d593ee4 Frameworks/Adium Framework/Source/AIListContactCell.m
--- a/Frameworks/Adium Framework/Source/AIListContactCell.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListContactCell.m	Fri Jan 27 01:23:38 2012 +0200
@@ -409,16 +409,16 @@
 												   [listObject valueForProperty:@"extendedStatus"])
 										drawUnder:YES];
 		
-		rect = [self drawDisplayNameWithFrame:rect];
+		[self drawDisplayNameWithFrame:rect];
 		
 	} else if (!idleTimeIsBelow && !statusMessageIsBelow) {
 		// Draw the display name before
 		rect = [self drawDisplayNameWithFrame:rect];
 		
-		rect = [self drawUserExtendedStatusInRect:rect
-									  withMessage:(useStatusMessageAsExtendedStatus ?
-												   [listObject statusMessageString] : 
-												   [listObject valueForProperty:@"extendedStatus"])
+		[self drawUserExtendedStatusInRect:rect
+							   withMessage:(useStatusMessageAsExtendedStatus ?
+											[listObject statusMessageString] :
+											[listObject valueForProperty:@"extendedStatus"])
 										drawUnder:NO];	
 	} else {
 		if (statusMessageIsBelow && statusMessageVisible) {
@@ -443,9 +443,9 @@
 		}
 		
 		if (!idleTimeIsBelow && idleTimeVisible) {
-			rect = [self drawUserExtendedStatusInRect:rect
-										  withMessage:[listObject valueForProperty:@"idleReadable"]
-											drawUnder:NO];
+			[self drawUserExtendedStatusInRect:rect
+								   withMessage:[listObject valueForProperty:@"idleReadable"]
+									 drawUnder:NO];
 		}
 	}
 }
diff -r 87a0f0ebd59a -r 284f6d593ee4 Frameworks/Adium Framework/Source/AIListGroupCell.m
--- a/Frameworks/Adium Framework/Source/AIListGroupCell.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListGroupCell.m	Fri Jan 27 01:23:38 2012 +0200
@@ -202,7 +202,8 @@
 	if ([listObject boolValueForProperty:@"showCount"]) {
 		rect = [self drawGroupCountWithFrame:rect];
 	}
-	rect = [self drawDisplayNameWithFrame:rect];
+	
+	[self drawDisplayNameWithFrame:rect];
 }
 
 - (NSRect)drawGroupCountWithFrame:(NSRect)inRect
diff -r 87a0f0ebd59a -r 284f6d593ee4 Frameworks/Adium Framework/Source/AISoundSet.m
--- a/Frameworks/Adium Framework/Source/AISoundSet.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AISoundSet.m	Fri Jan 27 01:23:38 2012 +0200
@@ -261,7 +261,6 @@
 			oldSetString = [NSString stringWithContentsOfURL:[NSURL fileURLWithPath:[tempSetPath stringByAppendingPathComponent:[setName stringByAppendingPathExtension:@"txt"]]]
 													encoding:NSUTF8StringEncoding
 													   error:NULL];
-			success = NO;
 			
 			if (!oldSetString || ![oldSetString length]) {
 				//If we can't find a txt file with the correct name, try to use any text file
diff -r 87a0f0ebd59a -r 284f6d593ee4 Frameworks/Adium Framework/Source/AIStatusGroup.m
--- a/Frameworks/Adium Framework/Source/AIStatusGroup.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIStatusGroup.m	Fri Jan 27 01:23:38 2012 +0200
@@ -191,12 +191,9 @@
 		 * Sorting the menu items before enumerating means that we know our statuses are sorted first by statusType
 		 */
 		if ((currentStatusType != thisStatusType)) {			
-			if ((currentStatusType != AIOfflineStatusType) &&
-				addedItemForThisStatusType) {
+			if ((currentStatusType != AIOfflineStatusType) && addedItemForThisStatusType) {
 				//Add a divider
 				[menu addItem:[NSMenuItem separatorItem]];
-
-				addedItemForThisStatusType = NO;
 			}
 
 			currentStatusType = thisStatusType;
diff -r 87a0f0ebd59a -r 284f6d593ee4 Frameworks/Adium Framework/Source/DCJoinChatViewController.m
--- a/Frameworks/Adium Framework/Source/DCJoinChatViewController.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Frameworks/Adium Framework/Source/DCJoinChatViewController.m	Fri Jan 27 01:23:38 2012 +0200
@@ -302,14 +302,12 @@
 		if ([[pboard availableTypeFromArray:[NSArray arrayWithObject:@"AIListObjectUniqueIDs"]] isEqualToString:@"AIListObjectUniqueIDs"]) {
 			NSArray			*dragItemsUniqueIDs;
 			NSString		*uniqueID;
-			AIListObject	*listObject;
 			AIListContact	*listContact;
 			
 			dragItemsUniqueIDs = [pboard propertyListForType:@"AIListObjectUniqueIDs"];
 			
 			for (uniqueID in dragItemsUniqueIDs) {
 				NSString *oldValue = [theField stringValue];
-				listObject = [adium.contactController existingListObjectWithUniqueID:uniqueID];
 				
 				// Get contacts with our service
 				// (May not be necessary, as we reject ungood contacts in the dragging entered phase)
diff -r 87a0f0ebd59a -r 284f6d593ee4 Frameworks/Adium Framework/Source/ESTextAndButtonsWindowController.m
--- a/Frameworks/Adium Framework/Source/ESTextAndButtonsWindowController.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Frameworks/Adium Framework/Source/ESTextAndButtonsWindowController.m	Fri Jan 27 01:23:38 2012 +0200
@@ -385,8 +385,7 @@
 	}
 	
 	//Set the default button
-	NSRect newFrame, oldFrame;
-	oldFrame = [button_default frame];
+	NSRect newFrame;
 
 	[button_default setTitle:(defaultButton ? defaultButton : AILocalizedString(@"OK",nil))];
 	[button_default sizeToFit];
@@ -404,8 +403,6 @@
 	
 	//Set the alternate button if we were provided one, otherwise hide it
 	if (alternateButton) {
-		oldFrame = [button_alternate frame];
-
 		[button_alternate setTitle:alternateButton];
 		[button_alternate sizeToFit];
 		
@@ -422,8 +419,8 @@
 		//Set the other button if we were provided one, otherwise hide it
 		if (otherButton) {
 			[window setFrame:windowFrame display:NO animate:NO];
-
-			oldFrame = [button_other frame];
+			
+			NSRect oldFrame = [button_other frame];
 
 			[button_other setTitle:otherButton];
 
diff -r 87a0f0ebd59a -r 284f6d593ee4 Plugins/Link Management/SHLinkEditorWindowController.m
--- a/Plugins/Link Management/SHLinkEditorWindowController.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Plugins/Link Management/SHLinkEditorWindowController.m	Fri Jan 27 01:23:38 2012 +0200
@@ -226,15 +226,14 @@
 
 - (IBAction)removeURL:(id)sender
 {
-    id selectedLink;
     if ([[textView textStorage] length] &&
        [textView selectedRange].location != NSNotFound &&
        [textView selectedRange].location != [[textView textStorage] length]) {
             NSRange selectionRange = [textView selectedRange];
             // Get range
-            selectedLink = [[textView textStorage] attribute:NSLinkAttributeName
-												 atIndex:selectionRange.location
-										  effectiveRange:&selectionRange];
+            [[textView textStorage] attribute:NSLinkAttributeName
+									  atIndex:selectionRange.location
+							   effectiveRange:&selectionRange];
 			// Remove the link from it
             [[textView textStorage] removeAttribute:NSLinkAttributeName range:selectionRange];
     }
diff -r 87a0f0ebd59a -r 284f6d593ee4 Plugins/Purple Service/AIPurpleCertificateTrustWarningAlert.m
--- a/Plugins/Purple Service/AIPurpleCertificateTrustWarningAlert.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Plugins/Purple Service/AIPurpleCertificateTrustWarningAlert.m	Fri Jan 27 01:23:38 2012 +0200
@@ -156,10 +156,10 @@
 		.Data = (uint8*)&ssloptions 
 	};
 	
-	err = SecPolicySetValue(policyRef, &theCssmData);
-	// don't care about the error
+	SecPolicySetValue(policyRef, &theCssmData); // Don't care about the error
 	
 	err = SecTrustCreateWithCertificates(certificates, policyRef, &trustRef);
+
 	if(err != noErr) {
 		CFRelease(searchRef);
 		CFRelease(policyRef);
diff -r 87a0f0ebd59a -r 284f6d593ee4 Plugins/Purple Service/DCPurpleZephyrJoinChatViewController.m
--- a/Plugins/Purple Service/DCPurpleZephyrJoinChatViewController.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Plugins/Purple Service/DCPurpleZephyrJoinChatViewController.m	Fri Jan 27 01:23:38 2012 +0200
@@ -59,9 +59,6 @@
 	
 	if (class && [class length]) {
 		NSString	*name;
-		//The chatCreationInfo has keys corresponding to the GHashTable keys and values to match them.
-		chatCreationInfo = [NSMutableDictionary dictionaryWithObject:class
-															  forKey:@"class"];
 
 		//The chatCreationInfo has keys corresponding to the GHashTable keys and values to match them.
 		chatCreationInfo = [NSDictionary dictionaryWithObjectsAndKeys:class,@"class",instance,@"instance",recipient,@"recipient",nil];
diff -r 87a0f0ebd59a -r 284f6d593ee4 Source/AIContactSortSelectionPlugin.m
--- a/Source/AIContactSortSelectionPlugin.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Source/AIContactSortSelectionPlugin.m	Fri Jan 27 01:23:38 2012 +0200
@@ -117,10 +117,8 @@
  */
 - (void)_configureSortSelectionMenuItems
 {
-    NSMenu				*sortSelectionMenu;
-	
     //Create the menu
-    sortSelectionMenu = [[[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@""] autorelease];
+    [[[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@""] autorelease];
 	
 	//Add each sort controller
 	for (AISortController *controller in [AISortController availableSortControllers]) {
diff -r 87a0f0ebd59a -r 284f6d593ee4 Source/AIInterfaceController.m
--- a/Source/AIInterfaceController.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Source/AIInterfaceController.m	Fri Jan 27 01:23:38 2012 +0200
@@ -1751,10 +1751,11 @@
         [entryString adjustColorsToShowOnBackground:[NSColor colorWithCalibratedRed:1.000f green:1.000f blue:0.800f alpha:1.0f]];
 
         //headIndent doesn't apply to the first line of a paragraph... so when new lines are in the entry, we need to tab over to the proper location
-		if ([entryString replaceOccurrencesOfString:@"\r" withString:@"\r\t\t" options:NSLiteralSearch range:fullLength])
+		if ([entryString replaceOccurrencesOfString:@"\r" withString:@"\r\t\t" options:NSLiteralSearch range:fullLength]) {
             fullLength = NSMakeRange(0, [entryString length]);
-        if ([entryString replaceOccurrencesOfString:@"\n" withString:@"\n\t\t" options:NSLiteralSearch range:fullLength])
-            fullLength = NSMakeRange(0, [entryString length]);
+		}
+		
+        [entryString replaceOccurrencesOfString:@"\n" withString:@"\n\t\t" options:NSLiteralSearch range:fullLength];
 		
         //Run the entry through the filters and add it to tipString
 		entryString = [[adium.contentController filterAttributedString:entryString
diff -r 87a0f0ebd59a -r 284f6d593ee4 Source/AIStatusController.m
--- a/Source/AIStatusController.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Source/AIStatusController.m	Fri Jan 27 01:23:38 2012 +0200
@@ -100,8 +100,8 @@
 
 	//Put each account into the status it was in last time we quit.
 	BOOL		needToRebuildMenus = NO;
-	BOOL		allStatusesInSameState = YES;
 	AIStatus	*prevStatus = nil;
+
 	for (AIAccount *account in adium.accountController.accounts) {
 		NSData		*lastStatusData = [account preferenceForKey:@"LastStatus"
 														  group:GROUP_ACCOUNT_STATUS];
@@ -131,10 +131,10 @@
 
 				needToRebuildMenus = YES;
 			}
-			if (!prevStatus)
+			if (!prevStatus) {
 				prevStatus = lastStatus;
-			else if (prevStatus != lastStatus)
-				allStatusesInSameState = NO;
+			} //else if (prevStatus != lastStatus) {}
+
 			[account setStatusStateAndRemainOffline:lastStatus];
 		}
 	}
diff -r 87a0f0ebd59a -r 284f6d593ee4 Source/AdiumOTREncryption.m
--- a/Source/AdiumOTREncryption.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Source/AdiumOTREncryption.m	Fri Jan 27 01:23:38 2012 +0200
@@ -726,7 +726,7 @@
 
 		ConnContext		*context = contextForChat(inContentMessage.chat);
 
-		err = otrl_message_fragment_and_send(&ui_ops, /* opData */ NULL, context,
+		otrl_message_fragment_and_send(&ui_ops, /* opData */ NULL, context,
 											 fullOutgoingMessage, OTRL_FRAGMENT_SEND_ALL_BUT_LAST, &lastFragmentOfMessage);
 
 		//This new message is what should be sent to the remote contact
diff -r 87a0f0ebd59a -r 284f6d593ee4 Source/BGICImportController.m
--- a/Source/BGICImportController.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Source/BGICImportController.m	Fri Jan 27 01:23:38 2012 +0200
@@ -403,7 +403,6 @@
 	}
 	
 	if ([importLogsButton state] == NSOnState && currentStep > 0  && !doneSomething) {
-		doneSomething = YES;
 		[proceedButton setEnabled:NO];
 		[self populateAccountPicker];
 		[titleField	setStringValue:[AILocalizedString(@"Importing iChat Transcripts", nil) stringByAppendingEllipsis]];
@@ -411,7 +410,6 @@
 		[assistantPanes selectTabViewItemWithIdentifier:@"logs"];
 		[importLogsButton setState:NSOffState]; // reset so we don't do this again
 	} else if (currentStep == 0  && !doneSomething) {
-		doneSomething = YES;
 		[backButton setEnabled:YES];
 		[titleField	setStringValue:AILocalizedString(@"Import Finished", nil)];
 		[assistantPanes selectTabViewItemWithIdentifier:@"end"];
diff -r 87a0f0ebd59a -r 284f6d593ee4 Source/ESOTRUnknownFingerprintController.m
--- a/Source/ESOTRUnknownFingerprintController.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Source/ESOTRUnknownFingerprintController.m	Fri Jan 27 01:23:38 2012 +0200
@@ -88,8 +88,6 @@
 									denyButton:(NSString *)denyButton
 								  responseInfo:(NSDictionary *)responseInfo
 {
-	ESTextAndButtonsWindowController	*windowController;
-
 	AIAccount	*account = [responseInfo objectForKey:@"AIAccount"];
 
 	NSImage		*serviceImage = nil;
@@ -100,17 +98,17 @@
 												  direction:AIIconNormal];
 	}
 	
-	windowController = [ESTextAndButtonsWindowController showTextAndButtonsWindowWithTitle:AILocalizedString(@"OTR Fingerprint Verification",nil)
-																			 defaultButton:acceptButton
-																		   alternateButton:denyButton
-																			   otherButton:AILocalizedString(@"Help", nil)
-																			   suppression:nil
-																				  onWindow:nil
-																		 withMessageHeader:nil
-																				andMessage:[AIHTMLDecoder decodeHTML:messageString]
-																					 image:serviceImage
-																					target:self
-																				  userInfo:responseInfo];	
+	[ESTextAndButtonsWindowController showTextAndButtonsWindowWithTitle:AILocalizedString(@"OTR Fingerprint Verification",nil)
+														  defaultButton:acceptButton
+														alternateButton:denyButton
+															otherButton:AILocalizedString(@"Help", nil)
+															suppression:nil
+															   onWindow:nil
+													  withMessageHeader:nil
+															 andMessage:[AIHTMLDecoder decodeHTML:messageString]
+																  image:serviceImage
+																 target:self
+															   userInfo:responseInfo];	
 }
 
 /*!
diff -r 87a0f0ebd59a -r 284f6d593ee4 Source/RAFBlockEditorWindowController.m
--- a/Source/RAFBlockEditorWindowController.m	Thu Jan 26 17:23:27 2012 +0200
+++ b/Source/RAFBlockEditorWindowController.m	Fri Jan 27 01:23:38 2012 +0200
@@ -534,9 +534,8 @@
 
 - (void)selectPrivacyOption:(AIPrivacyOption)privacyOption
 {
-	BOOL success = [stateChooser selectItemWithTag:privacyOption];
 	if (privacyOption == AIPrivacyOptionCustom) {
-		if (!success) {
+		if (![stateChooser selectItemWithTag:privacyOption]) {
 			NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"(Multiple privacy levels are active)", nil) 
 															  action:NULL
 													   keyEquivalent:@""];
@@ -544,7 +543,7 @@
 			[[stateChooser menu] addItem:menuItem];
 			[menuItem release];
 			
-			success = [stateChooser selectItemWithTag:privacyOption];
+			[stateChooser selectItemWithTag:privacyOption];
 		}
 
 	} else {
@@ -887,9 +886,7 @@
 - (BOOL)tableView:(NSTableView*)tv acceptDrop:(id <NSDraggingInfo>)info row:(NSInteger)row dropOperation:(NSTableViewDropOperation)op
 {
 	BOOL accept = NO;
-    if (row < 0)
-		row = 0;
-	
+
 	if ([info.draggingPasteboard.types containsObject:@"AIListObjectUniqueIDs"]) {
 		for (NSString *uniqueUID in [info.draggingPasteboard propertyListForType:@"AIListObjectUniqueIDs"])
 			[self addListObjectToList:[adium.contactController existingListObjectWithUniqueID:uniqueUID]];




More information about the commits mailing list