Change BeepHammer to use NSU?Integer instead of int/unsigned. Fixes a bunch of 64-to-32 warnings.
authorPeter Hosey <hg@boredzo.org>
Mon Nov 30 19:53:37 2009 -0800 (2009-11-30)
changeset 455802d3d0481b6b
parent 4557 4077d115b390
child 4559 53cb25bcdfea
Change BeepHammer to use NSU?Integer instead of int/unsigned. Fixes a bunch of 64-to-32 warnings.
Developer Tools/BeepHammer/BeepController.m
     1.1 --- a/Developer Tools/BeepHammer/BeepController.m	Mon Nov 30 19:47:22 2009 -0800
     1.2 +++ b/Developer Tools/BeepHammer/BeepController.m	Mon Nov 30 19:53:37 2009 -0800
     1.3 @@ -61,14 +61,14 @@
     1.4  	
     1.5  #pragma mark This is a cheap hack to work with the preference
     1.6  	NSDictionary *prefsDict = [NSDictionary dictionaryWithContentsOfFile:GROWL_PREFS_PATH];
     1.7 -	[growlLoggingButton setState:[[prefsDict valueForKey:@"GrowlLoggingEnabled"] intValue]];
     1.8 +	[growlLoggingButton setState:[[prefsDict valueForKey:@"GrowlLoggingEnabled"] integerValue]];
     1.9  }
    1.10  
    1.11  - (IBAction)toggleGrowlLogging:(id)sender
    1.12  {
    1.13  #pragma mark This is a cheap hack to work with the preference
    1.14  	NSMutableDictionary *prefsDict = [NSMutableDictionary dictionaryWithContentsOfFile:GROWL_PREFS_PATH];
    1.15 -	[prefsDict setObject:[NSNumber numberWithInt:[sender state]] forKey:@"GrowlLoggingEnabled"];
    1.16 +	[prefsDict setObject:[NSNumber numberWithInteger:[sender state]] forKey:@"GrowlLoggingEnabled"];
    1.17  	[prefsDict writeToFile:GROWL_PREFS_PATH atomically:NO];
    1.18  }
    1.19  
    1.20 @@ -101,14 +101,14 @@
    1.21  
    1.22  - (IBAction)showEditSheet:(id)sender {
    1.23  #pragma unused(sender)
    1.24 -	int index = [notificationsTable selectedRow];
    1.25 +	NSInteger index = [notificationsTable selectedRow];
    1.26  	if (index < 0)
    1.27  		NSBeep();
    1.28  	else {
    1.29  		NSDictionary *dict = [notifications objectAtIndex:index];
    1.30  		[notificationDefault     setState:      [dict stateForKey:GROWL_NOTIFICATION_DEFAULT]];
    1.31  		[notificationSticky      setState:      [dict stateForKey:GROWL_NOTIFICATION_STICKY]];
    1.32 -		int priority = [[dict objectForKey:GROWL_NOTIFICATION_PRIORITY] intValue];
    1.33 +		NSInteger priority = [[dict objectForKey:GROWL_NOTIFICATION_PRIORITY] integerValue];
    1.34  		[notificationPriority    selectItemAtIndex:[notificationPriority indexOfItemWithTag:priority]];
    1.35  		[notificationImage       setImage:      [dict objectForKey:GROWL_NOTIFICATION_ICON]];
    1.36  		[notificationDescription setStringValue:[dict objectForKey:GROWL_NOTIFICATION_DESCRIPTION]];
    1.37 @@ -125,13 +125,13 @@
    1.38  		   modalForWindow:mainWindow
    1.39  			modalDelegate:self
    1.40  		   didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
    1.41 -			  contextInfo:[[NSNumber alloc] initWithInt:index]];
    1.42 +			  contextInfo:[[NSNumber alloc] initWithInteger:index]];
    1.43  	}
    1.44  }
    1.45  
    1.46  - (IBAction)removeNotification:(id)sender {
    1.47  #pragma unused(sender)
    1.48 -	int selectedRow = [notificationsTable selectedRow];
    1.49 +	NSInteger selectedRow = [notificationsTable selectedRow];
    1.50  	if (selectedRow < 0) {
    1.51  		//no selection
    1.52  		NSBeep();
    1.53 @@ -153,10 +153,10 @@
    1.54  
    1.55  - (IBAction)sendNotification:(id)sender {
    1.56  #pragma unused(sender)
    1.57 -	int selectedRow = [notificationsTable selectedRow];
    1.58 +	NSInteger selectedRow = [notificationsTable selectedRow];
    1.59  
    1.60  	if (selectedRow != -1){
    1.61 -		int batchCount = ([batchCountField intValue] > 0 ? [batchCountField intValue] : 1); // always 1
    1.62 +		NSInteger batchCount = ([batchCountField integerValue] > 0 ? [batchCountField integerValue] : 1); // always 1
    1.63  		
    1.64  		if([groupingType selectedRow] == 0)
    1.65  		{
    1.66 @@ -188,7 +188,7 @@
    1.67  			// loop through and send the appropriate number of notifications
    1.68  			while(batchCount > 0)
    1.69  			{
    1.70 -				for(int currentRow = 0; currentRow < [notifications count]; currentRow++)
    1.71 +				for(NSUInteger currentRow = 0; currentRow < [notifications count]; currentRow++)
    1.72  				{
    1.73  					//send a notification for the row
    1.74  					NSDictionary *note = [notifications objectAtIndex:currentRow];
    1.75 @@ -225,11 +225,11 @@
    1.76  	[NSApp endSheet:[sender window] returnCode:NSCancelButton];
    1.77  }
    1.78  
    1.79 -- (void) sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {
    1.80 +- (void) sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo {
    1.81  	if (returnCode == NSOKButton) {
    1.82  		NSNumber *defaultValue = [NSNumber numberWithBool:[notificationDefault  state] == NSOnState];
    1.83  		NSNumber *stickyValue  = [NSNumber numberWithBool:[notificationSticky   state] == NSOnState];
    1.84 -		NSNumber *priority     = [NSNumber numberWithInt:[[notificationPriority selectedItem] tag]];
    1.85 +		NSNumber *priority     = [NSNumber numberWithInteger:[[notificationPriority selectedItem] tag]];
    1.86  		NSImage  *image        = [notificationImage image];
    1.87  		NSString *title        = [notificationTitle       stringValue];
    1.88  		NSString *desc         = [notificationDescription stringValue];
    1.89 @@ -250,7 +250,7 @@
    1.90  
    1.91  		NSNumber *indexNum = contextInfo;
    1.92  		if (indexNum) {
    1.93 -			[notifications replaceObjectAtIndex:[indexNum unsignedIntValue]
    1.94 +			[notifications replaceObjectAtIndex:[indexNum unsignedIntegerValue]
    1.95  									 withObject:dict];
    1.96  			[indexNum release];
    1.97  		} else {
    1.98 @@ -273,19 +273,19 @@
    1.99  
   1.100  #pragma mark Table Data Source Methods
   1.101  
   1.102 -- (int)numberOfRowsInTableView:(NSTableView *)tableView {
   1.103 +- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
   1.104  #pragma unused(tableView)
   1.105      return [notifications count];
   1.106  }
   1.107  
   1.108 -- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)col row:(int)row {
   1.109 +- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)col row:(NSInteger)row {
   1.110  #pragma unused(tableView, col, row)
   1.111      return [[notifications objectAtIndex:row] objectForKey:GROWL_NOTIFICATION_NAME];
   1.112  }
   1.113  
   1.114  #pragma mark Table Delegate Methods
   1.115  
   1.116 -- (BOOL)tableView:(NSTableView *)tableView shouldEditTableColumn:(NSTableColumn *)col row:(int)row {
   1.117 +- (BOOL)tableView:(NSTableView *)tableView shouldEditTableColumn:(NSTableColumn *)col row:(NSInteger)row {
   1.118  #pragma unused(tableView, col, row)
   1.119      return NO;
   1.120  }
   1.121 @@ -319,16 +319,16 @@
   1.122  	NSMutableArray *defNotesArray = [NSMutableArray array];
   1.123  	NSMutableArray *allNotesArray = [NSMutableArray array];
   1.124  	NSNumber *isDefaultNum;
   1.125 -	unsigned numNotifications = [notifications count];
   1.126 +	NSUInteger numNotifications = [notifications count];
   1.127  
   1.128  	//Build an array of all notifications we want to use
   1.129 -	for (unsigned i = 0U; i < numNotifications; ++i) {
   1.130 +	for (NSUInteger i = 0U; i < numNotifications; ++i) {
   1.131  		NSDictionary *def = [notifications objectAtIndex:i];
   1.132  		[allNotesArray addObject:[def objectForKey:GROWL_NOTIFICATION_NAME]];
   1.133  
   1.134  		isDefaultNum = [def objectForKey:GROWL_NOTIFICATION_DEFAULT];
   1.135  		if (isDefaultNum && [isDefaultNum boolValue])
   1.136 -			[defNotesArray addObject:[NSNumber numberWithUnsignedInt:i]];
   1.137 +			[defNotesArray addObject:[NSNumber numberWithUnsignedInteger:i]];
   1.138  	}
   1.139  
   1.140  	[allNotesArray addObject:CLICK_RECEIVED_NOTIFICATION_NAME];