Revision: 7162
http://skim-app.svn.sourceforge.net/skim-app/?rev=7162&view=rev
Author: hofman
Date: 2011-03-13 23:57:56 +0000 (Sun, 13 Mar 2011)
Log Message:
-----------
fix some warnings, mostly about assignments of variables, not really errors
Modified Paths:
--------------
trunk/NSScrollView_SKExtensions.m
trunk/SKBookmark.m
trunk/SKDownload.m
trunk/SKImageToolTipWindow.m
trunk/SKInfoWindowController.m
trunk/SKNoteTypeSheetController.m
trunk/SKNoteWindowController.m
trunk/SKNotesDocument.m
trunk/SKNotesPanelController.m
trunk/SKReleaseNotesController.m
trunk/SKTemplateParser.m
trunk/vendorsrc/andymatuschak/Sparkle/SUHost.m
Modified: trunk/NSScrollView_SKExtensions.m
===================================================================
--- trunk/NSScrollView_SKExtensions.m 2011-03-13 13:21:42 UTC (rev 7161)
+++ trunk/NSScrollView_SKExtensions.m 2011-03-13 23:57:56 UTC (rev 7162)
@@ -154,8 +154,9 @@
[bgImage drawInRect:midRect fromRect:midSrcRect
operation:NSCompositeSourceOver fraction:1.0];
NSEnumerator *viewEnum = [[self subviews] objectEnumerator];
- NSView *view = [viewEnum nextObject];
+ NSView *view;
CGFloat f = [[self window] isMainWindow] || [[self window] isKeyWindow] ?
1.0 : 0.33333;
+ [viewEnum nextObject];
while (view = [viewEnum nextObject]) {
divRect.origin.x = NSMinX([view frame]);
[divImage drawInRect:divRect fromRect:divSrcRect
operation:NSCompositeSourceOver fraction:f];
Modified: trunk/SKBookmark.m
===================================================================
--- trunk/SKBookmark.m 2011-03-13 13:21:42 UTC (rev 7161)
+++ trunk/SKBookmark.m 2011-03-13 23:57:56 UTC (rev 7162)
@@ -145,8 +145,8 @@
[array addObject:bookmark];
[bookmark release];
}
- } else if (docClass = [dc documentClassForType:fileType]) {
- if (bookmark = [[self alloc] initWithPath:path
pageIndex:([docClass isPDFDocument] ? 0 : NSNotFound) label:[fm
displayNameAtPath:path]]) {
+ } else if ((docClass = [dc documentClassForType:fileType])) {
+ if ((bookmark = [[self alloc] initWithPath:path
pageIndex:([docClass isPDFDocument] ? 0 : NSNotFound) label:[fm
displayNameAtPath:path]])) {
[array addObject:bookmark];
[bookmark release];
}
@@ -330,7 +330,7 @@
NSMutableArray *aChildren = [NSMutableArray array];
SKBookmark *child;
for (NSDictionary *setup in aSetupDicts) {
- if (child = [[SKBookmark alloc] initWithSetup:setup label:@""]) {
+ if ((child = [[SKBookmark alloc] initWithSetup:setup label:@""])) {
[aChildren addObject:child];
[child release];
}
@@ -351,7 +351,7 @@
NSMutableArray *newChildren = [NSMutableArray array];
SKBookmark *child;
for (NSDictionary *dict in [dictionary objectForKey:CHILDREN_KEY]) {
- if (child = [[SKBookmark alloc] initWithProperties:dict]) {
+ if ((child = [[SKBookmark alloc] initWithProperties:dict])) {
[newChildren addObject:child];
[child release];
} else
@@ -635,7 +635,7 @@
} else if ([[NSFileManager defaultManager]
fileExistsAtPath:aPath] == NO) {
[[NSScriptCommand currentCommand]
setScriptErrorNumber:NSArgumentsWrongScriptError];
[[NSScriptCommand currentCommand]
setScriptErrorString:@"New file bookmark requires an existing file."];
- } else if (docClass = [[NSDocumentController
sharedDocumentController] documentClassForContentsOfURL:aURL]) {
+ } else if ((docClass = [[NSDocumentController
sharedDocumentController] documentClassForContentsOfURL:aURL])) {
NSUInteger aPageNumber = [[properties
objectForKey:@"pageNumber"] unsignedIntegerValue];
if (aPageNumber > 0)
aPageNumber--;
Modified: trunk/SKDownload.m
===================================================================
--- trunk/SKDownload.m 2011-03-13 13:21:42 UTC (rev 7161)
+++ trunk/SKDownload.m 2011-03-13 23:57:56 UTC (rev 7162)
@@ -311,10 +311,8 @@
CFStringRef UTI =
UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType,
(CFStringRef)[response MIMEType], kUTTypeData);
if (UTI) {
NSString *type = [[NSWorkspace sharedWorkspace]
preferredFilenameExtensionForType:(NSString *)UTI];
- if (type) {
+ if (type)
[self setFileIcon:[[NSWorkspace sharedWorkspace]
iconForFileType:type]];
- CFRelease(type);
- }
CFRelease(UTI);
}
Modified: trunk/SKImageToolTipWindow.m
===================================================================
--- trunk/SKImageToolTipWindow.m 2011-03-13 13:21:42 UTC (rev 7161)
+++ trunk/SKImageToolTipWindow.m 2011-03-13 23:57:56 UTC (rev 7162)
@@ -97,7 +97,7 @@
- (void)showDelayed {
NSPoint thePoint = NSEqualPoints(point, NSZeroPoint) ? [NSEvent
mouseLocation] : point;
- NSRect contentRect;
+ NSRect contentRect = NSZeroRect;
NSImage *image = [context toolTipImage];
[self cancelDelayedAnimations];
Modified: trunk/SKInfoWindowController.m
===================================================================
--- trunk/SKInfoWindowController.m 2011-03-13 13:21:42 UTC (rev 7161)
+++ trunk/SKInfoWindowController.m 2011-03-13 23:57:56 UTC (rev 7162)
@@ -205,11 +205,13 @@
if (adjSize < 1024) {
[string appendFormat:@"%.1f KB", size / 1024.0f];
} else {
- adjSize >>= 10; size >>= 10;
+ adjSize >>= 10;
+ size >>= 10;
if (adjSize < 1024) {
[string appendFormat:@"%.1f MB", size / 1024.0f];
} else {
- adjSize >>= 10; size >>= 10;
+ //adjSize >>= 10;
+ size >>= 10;
[string appendFormat:@"%.1f GB", size / 1024.0f];
}
}
@@ -219,11 +221,13 @@
if (adjSize < 1024) {
[string appendFormat:@"%.1f TB", size / 1024.0f];
} else {
- adjSize >>= 10; size >>= 10;
+ adjSize >>= 10;
+ size >>= 10;
if (adjSize < 1024) {
[string appendFormat:@"%.1f PB", size / 1024.0f];
} else {
- adjSize >>= 10; size >>= 10;
+ //adjSize >>= 10;
+ size >>= 10;
[string appendFormat:@"%.1f EB", size / 1024.0f];
}
}
Modified: trunk/SKNoteTypeSheetController.m
===================================================================
--- trunk/SKNoteTypeSheetController.m 2011-03-13 13:21:42 UTC (rev 7161)
+++ trunk/SKNoteTypeSheetController.m 2011-03-13 23:57:56 UTC (rev 7162)
@@ -67,8 +67,8 @@
[menuItem setState:NSOnState];
}
[noteTypeMenu addItem:[NSMenuItem separatorItem]];
- menuItem = [noteTypeMenu addItemWithTitle:NSLocalizedString(@"Show
All", @"Menu item title") action:@selector(displayAllNoteTypes:) target:self];
- menuItem = [noteTypeMenu
addItemWithTitle:[NSLocalizedString(@"Select", @"Menu item title")
stringByAppendingEllipsis] action:@selector(selectNoteTypes:) target:self];
+ [noteTypeMenu addItemWithTitle:NSLocalizedString(@"Show All", @"Menu
item title") action:@selector(displayAllNoteTypes:) target:self];
+ [noteTypeMenu addItemWithTitle:[NSLocalizedString(@"Select", @"Menu
item title") stringByAppendingEllipsis] action:@selector(selectNoteTypes:)
target:self];
}
return self;
}
Modified: trunk/SKNoteWindowController.m
===================================================================
--- trunk/SKNoteWindowController.m 2011-03-13 13:21:42 UTC (rev 7161)
+++ trunk/SKNoteWindowController.m 2011-03-13 23:57:56 UTC (rev 7162)
@@ -100,7 +100,7 @@
}
- (id)init {
- return self = [self initWithNote:nil];
+ return [self initWithNote:nil];
}
- (id)initWithNote:(PDFAnnotation *)aNote {
@@ -327,7 +327,7 @@
NSString *name = [note string];
if ([name length] == 0)
name = @"NoteImage";
- NSString *basePath = [[dropDestination path]
stringByAppendingPathComponent:[note string]];
+ NSString *basePath = [[dropDestination path]
stringByAppendingPathComponent:name];
NSString *path = [basePath stringByAppendingPathExtension:@"tiff"];
NSInteger i = 0;
NSFileManager *fm = [NSFileManager defaultManager];
Modified: trunk/SKNotesDocument.m
===================================================================
--- trunk/SKNotesDocument.m 2011-03-13 13:21:42 UTC (rev 7161)
+++ trunk/SKNotesDocument.m 2011-03-13 23:57:56 UTC (rev 7162)
@@ -685,7 +685,7 @@
}
item = [menu addItemWithTitle:[items count] == 1 ?
NSLocalizedString(@"Auto Size Row", @"Menu item title") :
NSLocalizedString(@"Auto Size Rows", @"Menu item title")
action:@selector(autoSizeNoteRows:) target:self];
[item setRepresentedObject:items];
- item = [menu addItemWithTitle:NSLocalizedString(@"Auto Size All",
@"Menu item title") action:@selector(autoSizeNoteRows:) target:self];
+ [menu addItemWithTitle:NSLocalizedString(@"Auto Size All", @"Menu
item title") action:@selector(autoSizeNoteRows:) target:self];
}
}
}
Modified: trunk/SKNotesPanelController.m
===================================================================
--- trunk/SKNotesPanelController.m 2011-03-13 13:21:42 UTC (rev 7161)
+++ trunk/SKNotesPanelController.m 2011-03-13 23:57:56 UTC (rev 7162)
@@ -58,7 +58,7 @@
- (id)init {
if (sharedController) NSLog(@"Attempt to allocate second instance of %@",
self);
- return (self = [super initWithWindowNibName:@"NotesPanel"]);
+ return [super initWithWindowNibName:@"NotesPanel"];
}
- (void)windowDidLoad {
Modified: trunk/SKReleaseNotesController.m
===================================================================
--- trunk/SKReleaseNotesController.m 2011-03-13 13:21:42 UTC (rev 7161)
+++ trunk/SKReleaseNotesController.m 2011-03-13 23:57:56 UTC (rev 7162)
@@ -53,7 +53,7 @@
- (id)init {
if (sharedReleaseNotesController) NSLog(@"Attempt to allocate second
instance of %@", self);
- return (self = [super initWithWindowNibName:@"ReleaseNotes"]);
+ return [super initWithWindowNibName:@"ReleaseNotes"];
}
- (void)dealloc {
Modified: trunk/SKTemplateParser.m
===================================================================
--- trunk/SKTemplateParser.m 2011-03-13 13:21:42 UTC (rev 7161)
+++ trunk/SKTemplateParser.m 2011-03-13 23:57:56 UTC (rev 7162)
@@ -477,7 +477,7 @@
if (subtemplate == nil && [[tag subtemplates] count] > count)
subtemplate = [tag subtemplateAtIndex:count];
if (subtemplate != nil) {
- if (keyValue = [self stringFromTemplateArray:subtemplate
usingObject:object atIndex:anIndex])
+ if ((keyValue = [self stringFromTemplateArray:subtemplate
usingObject:object atIndex:anIndex]))
[result appendString:keyValue];
}
@@ -723,7 +723,6 @@
NSUInteger i, count = [matchStrings count];
NSArray *subtemplate = nil;
- count = [matchStrings count];
subtemplate = nil;
for (i = 0; i < count; i++) {
matchString = [matchStrings objectAtIndex:i];
@@ -737,7 +736,7 @@
if (subtemplate == nil && [[tag subtemplates] count] > count)
subtemplate = [tag subtemplateAtIndex:count];
if (subtemplate != nil) {
- if (tmpAttrStr = [self
attributedStringFromTemplateArray:subtemplate usingObject:object
atIndex:anIndex])
+ if ((tmpAttrStr = [self
attributedStringFromTemplateArray:subtemplate usingObject:object
atIndex:anIndex]))
[result appendAttributedString:tmpAttrStr];
}
Modified: trunk/vendorsrc/andymatuschak/Sparkle/SUHost.m
===================================================================
--- trunk/vendorsrc/andymatuschak/Sparkle/SUHost.m 2011-03-13 13:21:42 UTC
(rev 7161)
+++ trunk/vendorsrc/andymatuschak/Sparkle/SUHost.m 2011-03-13 23:57:56 UTC
(rev 7162)
@@ -221,7 +221,7 @@
#endif
{
NSString *versionPlistPath =
@"/System/Library/CoreServices/SystemVersion.plist";
- verStr = [[[NSDictionary
dictionaryWithContentsOfFile:versionPlistPath] objectForKey:@"ProductVersion"]
retain];
+ verStr = [[[[NSDictionary
dictionaryWithContentsOfFile:versionPlistPath] objectForKey:@"ProductVersion"]
retain] autorelease];
}
return verStr;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit