Skip to content

Commit

Permalink
fix some long standing warnings
Browse files Browse the repository at this point in the history
git-svn-id: https://resknife.svn.sourceforge.net/svnroot/resknife/trunk@129 25122d23-1bc7-42f3-9251-2040de679093
  • Loading branch information
nickshanks committed Nov 9, 2009
1 parent 4733101 commit 75e10a0
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion ResKnife/Cocoa/Classes/InfoWindowController.m
Expand Up @@ -69,7 +69,7 @@ - (void)updateInfoWindow
FSRef *fileRef = (FSRef *) NewPtrClear(sizeof(FSRef));
if(fileRef && [currentDocument fileName])
{
OSStatus error = FSPathMakeRef([[currentDocument fileName] fileSystemRepresentation], fileRef, nil);
OSStatus error = FSPathMakeRef((unsigned char *)[[currentDocument fileName] fileSystemRepresentation], fileRef, nil);
if(!error) FSGetForkSizes(fileRef, &dataLogicalSize, &rsrcLogicalSize);
}
if(fileRef) DisposePtr((Ptr) fileRef);
Expand Down
4 changes: 2 additions & 2 deletions ResKnife/Cocoa/Classes/OutlineViewDelegate.m
Expand Up @@ -99,7 +99,7 @@ - (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableC
@pending remove setting of the cell formatter when that capability is in interface builder
*/

- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
- (void)outlineView:(NSOutlineView *)olView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
{
Resource *resource = (Resource *)item;
NSString *identifier = [tableColumn identifier];
Expand Down Expand Up @@ -161,7 +161,7 @@ - (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTab
// draw alternating blue/white backgrounds (if pre-10.3)
if(NSAppKitVersionNumber < 700.0)
{
int row = [outlineView rowForItem:item];
int row = [olView rowForItem:item];
if(row % 2) [cell setBackgroundColor:[NSColor colorWithCalibratedRed:0.93 green:0.95 blue:1.0 alpha:1.0]];
else [cell setBackgroundColor:[NSColor whiteColor]];
[cell setDrawsBackground:YES];
Expand Down
6 changes: 3 additions & 3 deletions ResKnife/Cocoa/Classes/Resource.m
Expand Up @@ -90,7 +90,7 @@ + (NSArray *)allResourcesOfType:(NSString *)typeValue inDocument:(NSDocument *)s
return [NSArray arrayWithArray:array];
}

+ (Resource *)resourceOfType:(NSString *)typeValue withName:(NSString *)nameValue inDocument:(NSDocument *)searchDoc
+ (id)resourceOfType:(NSString *)typeValue withName:(NSString *)nameValue inDocument:(NSDocument *)searchDoc
{
NSDocument *doc;
NSEnumerator *enumerator = [[[NSDocumentController sharedDocumentController] documents] objectEnumerator];
Expand All @@ -106,7 +106,7 @@ + (Resource *)resourceOfType:(NSString *)typeValue withName:(NSString *)nameValu
return nil;
}

+ (Resource *)resourceOfType:(NSString *)typeValue andID:(NSNumber *)resIDValue inDocument:(NSDocument *)searchDoc
+ (id)resourceOfType:(NSString *)typeValue andID:(NSNumber *)resIDValue inDocument:(NSDocument *)searchDoc
{
NSDocument *doc;
NSEnumerator *enumerator = [[[NSDocumentController sharedDocumentController] documents] objectEnumerator];
Expand Down Expand Up @@ -177,7 +177,7 @@ - (void)setDirty:(BOOL)newValue
[[NSNotificationCenter defaultCenter] postNotificationName:ResourceDidChangeNotification object:self];
}

- (ResourceDocument *)document
- (NSDocument *)document
{
return [Resource documentForResource:self];
}
Expand Down
6 changes: 3 additions & 3 deletions ResKnife/Cocoa/Classes/ResourceDataSource.mm
Expand Up @@ -222,11 +222,11 @@ - (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toP
@method outlineView:validateDrop:proposedItem:proposedChildIndex:
@abstract Called when the user is hovering with a drop over our outline view.
*/
- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id <NSDraggingInfo>)info proposedItem:(id)item proposedChildIndex:(int)childIndex
- (NSDragOperation)outlineView:(NSOutlineView *)olView validateDrop:(id <NSDraggingInfo>)info proposedItem:(id)item proposedChildIndex:(int)childIndex
{
if([info draggingSource] != outlineView)
if([info draggingSource] != olView)
{
[outlineView setDropItem:nil dropChildIndex:NSOutlineViewDropOnItemIndex];
[olView setDropItem:nil dropChildIndex:NSOutlineViewDropOnItemIndex];
return NSDragOperationCopy;
}
else return NSDragOperationNone;
Expand Down
20 changes: 10 additions & 10 deletions ResKnife/Cocoa/Classes/ResourceDocument.mm
Expand Up @@ -180,7 +180,7 @@ -(BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)fileKind
}

// tidy up loose ends
if(fileRefNum) FSClose(fileRefNum);
if(fileRefNum) FSCloseFork(fileRefNum);
DisposePtr((Ptr) fileRef);
return succeeded;
}
Expand Down Expand Up @@ -276,14 +276,14 @@ -(BOOL)readResourceMap:(SInt16)fileRefNum

// create the resource & add it to the array
NSString *name = [[NSString alloc] initWithBytes:&nameStr[1] length:nameStr[0] encoding:NSMacOSRomanStringEncoding];
NSString *type = [[NSString alloc] initWithBytes:(char *) &swappedType length:4 encoding:NSMacOSRomanStringEncoding];
NSString *resType = [[NSString alloc] initWithBytes:(char *) &swappedType length:4 encoding:NSMacOSRomanStringEncoding];
NSNumber *resID = [NSNumber numberWithShort:resIDShort];
NSNumber *attributes = [NSNumber numberWithShort:attrsShort];
NSData *data = [NSData dataWithBytes:*resourceHandle length:sizeLong];
Resource *resource = [Resource resourceOfType:type andID:resID withName:name andAttributes:attributes data:data];
Resource *resource = [Resource resourceOfType:resType andID:resID withName:name andAttributes:attributes data:data];
[resources addObject:resource]; // array retains resource
[name release];
[type release];
[resType release];

HUnlock(resourceHandle);
ReleaseResource(resourceHandle);
Expand Down Expand Up @@ -346,7 +346,7 @@ - (BOOL)writeToFile:(NSString *)fileName ofType:(NSString *)type
succeeded = [self writeResourceMap:fileRefNum];

// tidy up loose ends
if(fileRefNum) FSClose(fileRefNum);
if(fileRefNum) FSCloseFork(fileRefNum);
DisposePtr((Ptr) fileRef);

// update info window
Expand Down Expand Up @@ -383,7 +383,7 @@ - (BOOL)writeForkStreamsToFile:(NSString *)fileName
error = FSOpenFork(fileRef, [[resource representedFork] length], (UniChar *) uniname, fsWrPerm, &forkRefNum);
if(!error && forkRefNum)
error = FSWriteFork(forkRefNum, fsFromStart, 0, [[resource data] length], [[resource data] bytes], NULL);
if(forkRefNum) FSClose(forkRefNum);
if(forkRefNum) FSCloseFork(forkRefNum);
}
DisposePtr((Ptr) fileRef);
return YES;
Expand Down Expand Up @@ -977,7 +977,7 @@ - (void)resourceIDWillChange:(NSNotification *)notification
[[self undoManager] registerUndoWithTarget:resource selector:@selector(setResID:) object:[[[resource resID] copy] autorelease]];
if([[resource name] length] == 0)
[[self undoManager] setActionName:NSLocalizedString(@"ID Change", nil)];
else [[self undoManager] setActionName:[NSString stringWithFormat:NSLocalizedString(@"ID Change for Ò%@Ó", nil), [resource name]]];
else [[self undoManager] setActionName:[NSString stringWithFormat:NSLocalizedString(@"ID Change for '%@'", nil), [resource name]]];
}

- (void)resourceTypeWillChange:(NSNotification *)notification
Expand All @@ -987,7 +987,7 @@ - (void)resourceTypeWillChange:(NSNotification *)notification
[[self undoManager] registerUndoWithTarget:resource selector:@selector(setType:) object:[[[resource type] copy] autorelease]];
if([[resource name] length] == 0)
[[self undoManager] setActionName:NSLocalizedString(@"Type Change", nil)];
else [[self undoManager] setActionName:[NSString stringWithFormat:NSLocalizedString(@"Type Change for Ò%@Ó", nil), [resource name]]];
else [[self undoManager] setActionName:[NSString stringWithFormat:NSLocalizedString(@"Type Change for '%@'", nil), [resource name]]];
}

- (void)resourceAttributesWillChange:(NSNotification *)notification
Expand All @@ -997,7 +997,7 @@ - (void)resourceAttributesWillChange:(NSNotification *)notification
[[self undoManager] registerUndoWithTarget:resource selector:@selector(setAttributes:) object:[[[resource attributes] copy] autorelease]];
if([[resource name] length] == 0)
[[self undoManager] setActionName:NSLocalizedString(@"Attributes Change", nil)];
else [[self undoManager] setActionName:[NSString stringWithFormat:NSLocalizedString(@"Attributes Change for Ò%@Ó", nil), [resource name]]];
else [[self undoManager] setActionName:[NSString stringWithFormat:NSLocalizedString(@"Attributes Change for '%@'", nil), [resource name]]];
}

- (void)resourceDataDidChange:(NSNotification *)notification
Expand Down Expand Up @@ -1106,7 +1106,7 @@ - (void)deleteSelectedResources
[dataSource removeResource:resource];
if([[resource name] length] == 0)
[[self undoManager] setActionName:NSLocalizedString(@"Delete Resource", nil)];
else [[self undoManager] setActionName:[NSString stringWithFormat:NSLocalizedString(@"Delete Resource Ò%@Ó", nil), [resource name]]];
else [[self undoManager] setActionName:[NSString stringWithFormat:NSLocalizedString(@"Delete Resource '%@'", nil), [resource name]]];
}
[[self undoManager] endUndoGrouping];

Expand Down
2 changes: 1 addition & 1 deletion ResKnife/ResKnife.xcodeproj/project.pbxproj
Expand Up @@ -608,7 +608,7 @@
F5B5883F0156D40B01000001 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/PrefsWindow.nib; sourceTree = "<group>"; };
F5B588410156D40B01000001 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/ResourceDocument.nib; sourceTree = "<group>"; };
F5B588430156D40B01000001 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
F5B588450156D40B01000001 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; lineEnding = 0; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; };
F5B588450156D40B01000001 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; lineEnding = 0; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; };
F5B588460156D40B01000001 /* ResKnife.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = ResKnife.icns; sourceTree = "<group>"; };
F5B588470156D40B01000001 /* Resource file.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "Resource file.icns"; sourceTree = "<group>"; };
F5B588480156D40B01000001 /* Icon file.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "Icon file.icns"; sourceTree = "<group>"; };
Expand Down

0 comments on commit 75e10a0

Please sign in to comment.