mirror of
https://github.com/nickshanks/ResKnife.git
synced 2025-03-11 16:29:28 +00:00
Fix some long-standing warnings.
This commit is contained in:
parent
9187840237
commit
fe032b0da4
@ -69,7 +69,7 @@
|
||||
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);
|
||||
|
@ -99,7 +99,7 @@ int compareResourcesDescending(Resource *r1, Resource *r2, void *context)
|
||||
@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];
|
||||
@ -161,7 +161,7 @@ int compareResourcesDescending(Resource *r1, Resource *r2, void *context)
|
||||
// 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];
|
||||
|
@ -90,7 +90,7 @@ NSString *RKResourcePboardType = @"RKResourcePboardType";
|
||||
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];
|
||||
@ -106,7 +106,7 @@ NSString *RKResourcePboardType = @"RKResourcePboardType";
|
||||
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];
|
||||
@ -177,7 +177,7 @@ NSString *RKResourcePboardType = @"RKResourcePboardType";
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:ResourceDidChangeNotification object:self];
|
||||
}
|
||||
|
||||
- (ResourceDocument *)document
|
||||
- (NSDocument *)document
|
||||
{
|
||||
return [Resource documentForResource:self];
|
||||
}
|
||||
|
@ -222,11 +222,11 @@ extern NSString *RKResourcePboardType;
|
||||
@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;
|
||||
|
@ -180,7 +180,7 @@ extern NSString *RKResourcePboardType;
|
||||
}
|
||||
|
||||
// tidy up loose ends
|
||||
if(fileRefNum) FSClose(fileRefNum);
|
||||
if(fileRefNum) FSCloseFork(fileRefNum);
|
||||
DisposePtr((Ptr) fileRef);
|
||||
return succeeded;
|
||||
}
|
||||
@ -276,14 +276,14 @@ extern NSString *RKResourcePboardType;
|
||||
|
||||
// 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);
|
||||
@ -346,7 +346,7 @@ extern NSString *RKResourcePboardType;
|
||||
succeeded = [self writeResourceMap:fileRefNum];
|
||||
|
||||
// tidy up loose ends
|
||||
if(fileRefNum) FSClose(fileRefNum);
|
||||
if(fileRefNum) FSCloseFork(fileRefNum);
|
||||
DisposePtr((Ptr) fileRef);
|
||||
|
||||
// update info window
|
||||
@ -383,7 +383,7 @@ extern NSString *RKResourcePboardType;
|
||||
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;
|
||||
@ -977,7 +977,7 @@ static NSString *RKExportItemIdentifier = @"com.nickshanks.resknife.toolbar.exp
|
||||
[[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
|
||||
@ -987,7 +987,7 @@ static NSString *RKExportItemIdentifier = @"com.nickshanks.resknife.toolbar.exp
|
||||
[[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
|
||||
@ -997,7 +997,7 @@ static NSString *RKExportItemIdentifier = @"com.nickshanks.resknife.toolbar.exp
|
||||
[[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
|
||||
@ -1106,7 +1106,7 @@ static NSString *RKExportItemIdentifier = @"com.nickshanks.resknife.toolbar.exp
|
||||
[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];
|
||||
|
||||
|
@ -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>"; };
|
||||
|
Loading…
x
Reference in New Issue
Block a user