Browse files

Fix type and deprecation warnings.

  • Loading branch information...
1 parent 1b6d1f9 commit b394c3acff444cf675946429ab9abf70042e846e @sorbits sorbits committed Aug 2, 2012
Showing with 11 additions and 11 deletions.
  1. +9 −9 Dialog.mm
  2. +2 −2 ValueTransformers.mm
View
18 Dialog.mm
@@ -17,7 +17,7 @@ @interface Dialog : NSObject <TextMateDialogServerProtocol>
- (id)initWithPlugInController:(id <TMPlugInController>)aController;
@end
-@interface TMDWindowController : NSObject
+@interface TMDWindowController : NSObject <NSWindowDelegate>
{
NSWindow* window;
BOOL isModal;
@@ -196,7 +196,7 @@ - (NSDictionary*)instantiateNib:(NSNib*)aNib
}
@catch(NSException* e) {
// our retain count is too high if we reach this branch (<rdar://4803521>) so no RAII idioms for Cocoa, which is why we have the didLock variable, etc.
- NSLog(@"%s failed to instantiate nib (%@)", _cmd, [e reason]);
+ NSLog(@"%s failed to instantiate nib (%@)", SELNAME(_cmd), [e reason]);
}
[topLevelObjects retain];
@@ -237,7 +237,7 @@ - (NSDictionary*)instantiateNib:(NSNib*)aNib
}
else
{
- NSLog(@"%s didn't find a window in nib", _cmd);
+ NSLog(@"%s didn't find a window in nib", SELNAME(_cmd));
[self cleanupAndRelease:self];
}
@@ -257,7 +257,7 @@ - (void)updateParameters:(NSMutableDictionary *)updatedParams
- (void)dealloc
{
-// NSLog(@"%s %@ %d", _cmd, self, token);
+// NSLog(@"%s %@ %d", SELNAME(_cmd), self, token);
[[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -346,7 +346,7 @@ - (NSMutableDictionary *)returnResult
- (void)dealloc
{
-// NSLog(@"%s %@ %d", _cmd, self, token);
+// NSLog(@"%s %@ %d", SELNAME(_cmd), self, token);
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
@@ -449,7 +449,7 @@ - (id)initWithPlugInController:(id <TMPlugInController>)aController
NSString* portName = [NSString stringWithFormat:@"%@.%d", @"com.macromates.dialog_1", getpid()];
if([connection registerName:portName] == NO)
- NSLog(@"couldn't setup port: ", portName), NSBeep();
+ NSLog(@"couldn't setup port: %@", portName), NSBeep();
setenv("DIALOG_1_PORT_NAME", [portName UTF8String], 1);
if(NSString* path = [[NSBundle bundleForClass:[self class]] pathForResource:@"tm_dialog" ofType:nil]) {
@@ -579,7 +579,7 @@ - (id)showNib:(NSString*)aNibPath withParameters:(id)someParameters andInitialVa
if(![[NSFileManager defaultManager] fileExistsAtPath:aNibPath])
{
- NSLog(@"%s nib file not found: %@", _cmd, aNibPath);
+ NSLog(@"%s nib file not found: %@", SELNAME(_cmd), aNibPath);
return nil;
}
@@ -589,13 +589,13 @@ - (id)showNib:(NSString*)aNibPath withParameters:(id)someParameters andInitialVa
NSNib* nib = [[[NSNib alloc] initWithContentsOfURL:[NSURL fileURLWithPath:aNibPath]] autorelease];
if(!nib)
{
- NSLog(@"%s failed loading nib: %@", _cmd, aNibPath);
+ NSLog(@"%s failed loading nib: %@", SELNAME(_cmd), aNibPath);
return nil;
}
TMDNibWindowController* nibOwner = [[TMDNibWindowController alloc] initWithParameters:someParameters modal:modal center:shouldCenter aysnc:async];
if(!nibOwner)
- NSLog(@"%s couldn't create nib loader", _cmd);
+ NSLog(@"%s couldn't create nib loader", SELNAME(_cmd));
[nibOwner instantiateNib:nib];
// if(async || (not modal))
View
4 ValueTransformers.mm
@@ -106,8 +106,8 @@ - (id)reverseTransformedValue:(id)value
aColor = [aColor colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
if([aColor alphaComponent] != 1.0f)
- return [NSString stringWithFormat:@"#%02X%02X%02X%02X", lroundf(255.0f*[aColor redComponent]), lroundf(255.0f*[aColor greenComponent]), lroundf(255.0f*[aColor blueComponent]), lroundf(255.0f*[aColor alphaComponent])];
- else return [NSString stringWithFormat:@"#%02X%02X%02X", lroundf(255.0f*[aColor redComponent]), lroundf(255.0f*[aColor greenComponent]), lroundf(255.0f*[aColor blueComponent])];
+ return [NSString stringWithFormat:@"#%02lX%02lX%02lX%02lX", lroundf(255.0f*[aColor redComponent]), lroundf(255.0f*[aColor greenComponent]), lroundf(255.0f*[aColor blueComponent]), lroundf(255.0f*[aColor alphaComponent])];
+ else return [NSString stringWithFormat:@"#%02lX%02lX%02lX", lroundf(255.0f*[aColor redComponent]), lroundf(255.0f*[aColor greenComponent]), lroundf(255.0f*[aColor blueComponent])];
}
@implementation OakStringToColorTransformer

0 comments on commit b394c3a

Please sign in to comment.