Converted int to NSInteger

This commit is contained in:
Virgil Dupras 2010-01-15 11:19:24 +01:00
parent 0f250ac92d
commit 9b870ad863
8 changed files with 29 additions and 28 deletions

View File

@ -66,7 +66,7 @@ http://www.hardcoded.net/licenses/hs_license
[cell addItemWithTitle:@"Normal"]; [cell addItemWithTitle:@"Normal"];
[cell addItemWithTitle:@"Reference"]; [cell addItemWithTitle:@"Reference"];
[cell addItemWithTitle:@"Excluded"]; [cell addItemWithTitle:@"Excluded"];
for (int i=0;i<[[cell itemArray] count];i++) for (NSInteger i=0;i<[[cell itemArray] count];i++)
{ {
NSMenuItem *mi = [[cell itemArray] objectAtIndex:i]; NSMenuItem *mi = [[cell itemArray] objectAtIndex:i];
[mi setTarget:self]; [mi setTarget:self];
@ -135,8 +135,8 @@ http://www.hardcoded.net/licenses/hs_license
} }
else else
{ {
int state = n2i([[node buffer] objectAtIndex:1]); NSInteger state = n2i([[node buffer] objectAtIndex:1]);
int newState = state == 2 ? 0 : 2; // If excluded, put it back NSInteger newState = state == 2 ? 0 : 2; // If excluded, put it back
[_py setDirectory:p2a([node indexPath]) state:i2n(newState)]; [_py setDirectory:p2a([node indexPath]) state:i2n(newState)];
[node resetAllBuffers]; [node resetAllBuffers];
[directories display]; [directories display];
@ -153,7 +153,7 @@ http://www.hardcoded.net/licenses/hs_license
- (void)addDirectory:(NSString *)directory - (void)addDirectory:(NSString *)directory
{ {
int r = [[_py addDirectory:directory] intValue]; NSInteger r = [[_py addDirectory:directory] intValue];
if (r) if (r)
{ {
NSString *m; NSString *m;
@ -186,7 +186,7 @@ http://www.hardcoded.net/licenses/hs_license
} }
[removeButton setEnabled:YES]; [removeButton setEnabled:YES];
OVNode *node = [directories itemAtRow:[directories selectedRow]]; OVNode *node = [directories itemAtRow:[directories selectedRow]];
int state = n2i([[node buffer] objectAtIndex:1]); NSInteger state = n2i([[node buffer] objectAtIndex:1]);
NSString *buttonText = state == 2 ? @"Put Back" : @"Remove"; NSString *buttonText = state == 2 ? @"Put Back" : @"Remove";
[removeButton setTitle:buttonText]; [removeButton setTitle:buttonText];
} }
@ -201,7 +201,7 @@ http://www.hardcoded.net/licenses/hs_license
- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item - (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
{ {
OVNode *node = item; OVNode *node = item;
int state = n2i([[node buffer] objectAtIndex:1]); NSInteger state = n2i([[node buffer] objectAtIndex:1]);
if ([cell isKindOfClass:[NSTextFieldCell class]]) if ([cell isKindOfClass:[NSTextFieldCell class]])
{ {
NSTextFieldCell *textCell = cell; NSTextFieldCell *textCell = cell;

View File

@ -62,5 +62,5 @@ http://www.hardcoded.net/licenses/hs_license
- (void)setDisplayDeltaValues:(NSNumber *)display_delta_values; - (void)setDisplayDeltaValues:(NSNumber *)display_delta_values;
- (void)setEscapeFilterRegexp:(NSNumber *)escape_filter_regexp; - (void)setEscapeFilterRegexp:(NSNumber *)escape_filter_regexp;
- (void)setRemoveEmptyFolders:(NSNumber *)remove_empty_folders; - (void)setRemoveEmptyFolders:(NSNumber *)remove_empty_folders;
- (void)setSizeThreshold:(int)size_threshold; - (void)setSizeThreshold:(NSInteger)size_threshold;
@end @end

View File

@ -32,7 +32,7 @@ http://www.hardcoded.net/licenses/hs_license
} }
/* Helpers */ /* Helpers */
- (void)fillColumnsMenu; - (void)fillColumnsMenu;
- (NSTableColumn *)getColumnForIdentifier:(int)aIdentifier title:(NSString *)aTitle width:(int)aWidth refCol:(NSTableColumn *)aColumn; - (NSTableColumn *)getColumnForIdentifier:(NSInteger)aIdentifier title:(NSString *)aTitle width:(NSInteger)aWidth refCol:(NSTableColumn *)aColumn;
- (NSArray *)getColumnsOrder; - (NSArray *)getColumnsOrder;
- (NSDictionary *)getColumnsWidth; - (NSDictionary *)getColumnsWidth;
- (NSArray *)getSelected:(BOOL)aDupesOnly; - (NSArray *)getSelected:(BOOL)aDupesOnly;

View File

@ -19,7 +19,7 @@ http://www.hardcoded.net/licenses/hs_license
{ {
unichar key = [[theEvent charactersIgnoringModifiers] characterAtIndex:0]; unichar key = [[theEvent charactersIgnoringModifiers] characterAtIndex:0];
// get flags and strip the lower 16 (device dependant) bits // get flags and strip the lower 16 (device dependant) bits
unsigned int flags = ( [theEvent modifierFlags] & 0x00FF ); NSUInteger flags = ( [theEvent modifierFlags] & 0x00FF );
if (((key == NSDeleteFunctionKey) || (key == NSDeleteCharacter)) && (flags == 0)) if (((key == NSDeleteFunctionKey) || (key == NSDeleteCharacter)) && (flags == 0))
[self sendAction:@selector(removeSelected:) to:[self delegate]]; [self sendAction:@selector(removeSelected:) to:[self delegate]];
else else
@ -85,9 +85,9 @@ http://www.hardcoded.net/licenses/hs_license
[mi setTarget:self]; [mi setTarget:self];
} }
- (NSTableColumn *)getColumnForIdentifier:(int)aIdentifier title:(NSString *)aTitle width:(int)aWidth refCol:(NSTableColumn *)aColumn - (NSTableColumn *)getColumnForIdentifier:(NSInteger)aIdentifier title:(NSString *)aTitle width:(NSInteger)aWidth refCol:(NSTableColumn *)aColumn
{ {
NSNumber *n = [NSNumber numberWithInt:aIdentifier]; NSNumber *n = [NSNumber numberWithInteger:aIdentifier];
NSTableColumn *col = [[NSTableColumn alloc] initWithIdentifier:[n stringValue]]; NSTableColumn *col = [[NSTableColumn alloc] initWithIdentifier:[n stringValue]];
[col setWidth:aWidth]; [col setWidth:aWidth];
[col setEditable:NO]; [col setEditable:NO];
@ -123,7 +123,7 @@ http://www.hardcoded.net/licenses/hs_license
while (col = [e nextObject]) while (col = [e nextObject])
{ {
colId = [col identifier]; colId = [col identifier];
width = [NSNumber numberWithFloat:[col width]]; width = [NSNumber numberWithDouble:[col width]];
[result setObject:width forKey:colId]; [result setObject:width forKey:colId];
} }
return result; return result;
@ -136,7 +136,7 @@ http://www.hardcoded.net/licenses/hs_license
NSIndexSet *indexes = [matches selectedRowIndexes]; NSIndexSet *indexes = [matches selectedRowIndexes];
NSMutableArray *nodeList = [NSMutableArray array]; NSMutableArray *nodeList = [NSMutableArray array];
OVNode *node; OVNode *node;
int i = [indexes firstIndex]; NSInteger i = [indexes firstIndex];
while (i != NSNotFound) while (i != NSNotFound)
{ {
node = [matches itemAtRow:i]; node = [matches itemAtRow:i];
@ -238,7 +238,7 @@ http://www.hardcoded.net/licenses/hs_license
- (IBAction)copyMarked:(id)sender - (IBAction)copyMarked:(id)sender
{ {
int mark_count = [[py getMarkCount] intValue]; NSInteger mark_count = [[py getMarkCount] intValue];
if (!mark_count) if (!mark_count)
return; return;
NSOpenPanel *op = [NSOpenPanel openPanel]; NSOpenPanel *op = [NSOpenPanel openPanel];
@ -257,7 +257,7 @@ http://www.hardcoded.net/licenses/hs_license
- (IBAction)deleteMarked:(id)sender - (IBAction)deleteMarked:(id)sender
{ {
int mark_count = [[py getMarkCount] intValue]; NSInteger mark_count = [[py getMarkCount] intValue];
if (!mark_count) if (!mark_count)
return; return;
if ([Dialogs askYesNo:[NSString stringWithFormat:@"You are about to send %d files to Trash. Continue?",mark_count]] == NSAlertSecondButtonReturn) // NO if ([Dialogs askYesNo:[NSString stringWithFormat:@"You are about to send %d files to Trash. Continue?",mark_count]] == NSAlertSecondButtonReturn) // NO
@ -269,7 +269,7 @@ http://www.hardcoded.net/licenses/hs_license
- (IBAction)expandAll:(id)sender - (IBAction)expandAll:(id)sender
{ {
for (int i=0;i < [matches numberOfRows];i++) for (NSInteger i=0;i < [matches numberOfRows];i++)
[matches expandItem:[matches itemAtRow:i]]; [matches expandItem:[matches itemAtRow:i]];
} }
@ -281,7 +281,7 @@ http://www.hardcoded.net/licenses/hs_license
- (IBAction)moveMarked:(id)sender - (IBAction)moveMarked:(id)sender
{ {
int mark_count = [[py getMarkCount] intValue]; NSInteger mark_count = [[py getMarkCount] intValue];
if (!mark_count) if (!mark_count)
return; return;
NSOpenPanel *op = [NSOpenPanel openPanel]; NSOpenPanel *op = [NSOpenPanel openPanel];
@ -313,8 +313,8 @@ http://www.hardcoded.net/licenses/hs_license
{ {
// It might look like a complicated way to get the length of the current dupe list on the py side // It might look like a complicated way to get the length of the current dupe list on the py side
// but after a lot of fussing around, believe it or not, it actually is. // but after a lot of fussing around, believe it or not, it actually is.
int matchesTag = _powerMode ? 2 : 0; NSInteger matchesTag = _powerMode ? 2 : 0;
int startLen = [[py getOutlineView:matchesTag childCountsForPath:[NSArray array]] count]; NSInteger startLen = [[py getOutlineView:matchesTag childCountsForPath:[NSArray array]] count];
[self performPySelection:[self getSelectedPaths:YES]]; [self performPySelection:[self getSelectedPaths:YES]];
[py makeSelectedReference]; [py makeSelectedReference];
// In some cases (when in a filtered view in Power Marker mode, it's possible that the demoted // In some cases (when in a filtered view in Power Marker mode, it's possible that the demoted
@ -384,7 +384,7 @@ http://www.hardcoded.net/licenses/hs_license
- (void)jobCompleted:(NSNotification *)aNotification - (void)jobCompleted:(NSNotification *)aNotification
{ {
[[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self]; [[NSNotificationCenter defaultCenter] postNotificationName:ResultsChangedNotification object:self];
int r = n2i([py getOperationalErrorCount]); NSInteger r = n2i([py getOperationalErrorCount]);
id lastAction = [[ProgressController mainProgressController] jobId]; id lastAction = [[ProgressController mainProgressController] jobId];
if ([lastAction isEqualTo:jobCopy]) { if ([lastAction isEqualTo:jobCopy]) {
if (r > 0) if (r > 0)

View File

@ -95,7 +95,7 @@ http://www.hardcoded.net/licenses/hs_license
[ud setObject: [result getColumnsWidth] forKey:@"columnsWidth"]; [ud setObject: [result getColumnsWidth] forKey:@"columnsWidth"];
[py saveIgnoreList]; [py saveIgnoreList];
[py saveResults]; [py saveResults];
int sc = [ud integerForKey:@"sessionCountSinceLastIgnorePurge"]; NSInteger sc = [ud integerForKey:@"sessionCountSinceLastIgnorePurge"];
if (sc >= 10) if (sc >= 10)
{ {
sc = -1; sc = -1;

View File

@ -19,5 +19,5 @@ http://www.hardcoded.net/licenses/hs_license
- (void)enable:(NSNumber *)enable scanForTag:(NSString *)tag; - (void)enable:(NSNumber *)enable scanForTag:(NSString *)tag;
- (void)scanDeadTracks; - (void)scanDeadTracks;
- (void)removeDeadTracks; - (void)removeDeadTracks;
- (int)deadTrackCount; - (NSInteger)deadTrackCount;
@end @end

View File

@ -36,7 +36,7 @@ http://www.hardcoded.net/licenses/hs_license
/* Actions */ /* Actions */
- (IBAction)clearIgnoreList:(id)sender - (IBAction)clearIgnoreList:(id)sender
{ {
int i = n2i([py getIgnoreListCount]); NSInteger i = n2i([py getIgnoreListCount]);
if (!i) if (!i)
return; return;
if ([Dialogs askYesNo:[NSString stringWithFormat:@"Do you really want to remove all %d items from the ignore list?",i]] == NSAlertSecondButtonReturn) // NO if ([Dialogs askYesNo:[NSString stringWithFormat:@"Do you really want to remove all %d items from the ignore list?",i]] == NSAlertSecondButtonReturn) // NO
@ -139,8 +139,8 @@ http://www.hardcoded.net/licenses/hs_license
- (IBAction)renameSelected:(id)sender - (IBAction)renameSelected:(id)sender
{ {
int col = [matches columnWithIdentifier:@"0"]; NSInteger col = [matches columnWithIdentifier:@"0"];
int row = [matches selectedRow]; NSInteger row = [matches selectedRow];
[matches editColumn:col row:row withEvent:[NSApp currentEvent] select:YES]; [matches editColumn:col row:row withEvent:[NSApp currentEvent] select:YES];
} }
@ -187,7 +187,7 @@ http://www.hardcoded.net/licenses/hs_license
[_py setWordWeighting:[ud objectForKey:@"wordWeighting"]]; [_py setWordWeighting:[ud objectForKey:@"wordWeighting"]];
[_py setMixFileKind:[ud objectForKey:@"mixFileKind"]]; [_py setMixFileKind:[ud objectForKey:@"mixFileKind"]];
[_py setMatchSimilarWords:[ud objectForKey:@"matchSimilarWords"]]; [_py setMatchSimilarWords:[ud objectForKey:@"matchSimilarWords"]];
int r = n2i([py doScan]); NSInteger r = n2i([py doScan]);
[matches reloadData]; [matches reloadData];
[self refreshStats]; [self refreshStats];
if (r == 1) if (r == 1)
@ -272,7 +272,7 @@ http://www.hardcoded.net/licenses/hs_license
id lastAction = [[ProgressController mainProgressController] jobId]; id lastAction = [[ProgressController mainProgressController] jobId];
if ([lastAction isEqualTo:jobScanDeadTracks]) if ([lastAction isEqualTo:jobScanDeadTracks])
{ {
int deadTrackCount = [(PyDupeGuru *)py deadTrackCount]; NSInteger deadTrackCount = [(PyDupeGuru *)py deadTrackCount];
if (deadTrackCount > 0) if (deadTrackCount > 0)
{ {
NSString *msg = @"Your iTunes Library contains %d dead tracks ready to be removed. Continue?"; NSString *msg = @"Your iTunes Library contains %d dead tracks ready to be removed. Continue?";

View File

@ -88,7 +88,7 @@
CE381C9509914ACE003581CE /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; }; CE381C9509914ACE003581CE /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = SOURCE_ROOT; };
CE381C9A09914ADF003581CE /* ResultWindow.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = ResultWindow.m; sourceTree = SOURCE_ROOT; }; CE381C9A09914ADF003581CE /* ResultWindow.m */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.objc; path = ResultWindow.m; sourceTree = SOURCE_ROOT; };
CE381C9B09914ADF003581CE /* ResultWindow.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = ResultWindow.h; sourceTree = SOURCE_ROOT; }; CE381C9B09914ADF003581CE /* ResultWindow.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = ResultWindow.h; sourceTree = SOURCE_ROOT; };
CE381CF509915304003581CE /* dg_cocoa.plugin */ = {isa = PBXFileReference; lastKnownFileType = folder; name = dg_cocoa.plugin; path = dg_cocoa.plugin; sourceTree = SOURCE_ROOT; }; CE381CF509915304003581CE /* dg_cocoa.plugin */ = {isa = PBXFileReference; lastKnownFileType = folder; path = dg_cocoa.plugin; sourceTree = SOURCE_ROOT; };
CE3FBDD11094637800B72D77 /* DetailsPanel.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = DetailsPanel.xib; path = ../../base/xib/DetailsPanel.xib; sourceTree = "<group>"; }; CE3FBDD11094637800B72D77 /* DetailsPanel.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = DetailsPanel.xib; path = ../../base/xib/DetailsPanel.xib; sourceTree = "<group>"; };
CE3FBDD21094637800B72D77 /* DirectoryPanel.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = DirectoryPanel.xib; path = ../../base/xib/DirectoryPanel.xib; sourceTree = "<group>"; }; CE3FBDD21094637800B72D77 /* DirectoryPanel.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = DirectoryPanel.xib; path = ../../base/xib/DirectoryPanel.xib; sourceTree = "<group>"; };
CE49DEF20FDFEB810098617B /* BRSingleLineFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BRSingleLineFormatter.h; path = ../../cocoalib/brsinglelineformatter/BRSingleLineFormatter.h; sourceTree = SOURCE_ROOT; }; CE49DEF20FDFEB810098617B /* BRSingleLineFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BRSingleLineFormatter.h; path = ../../cocoalib/brsinglelineformatter/BRSingleLineFormatter.h; sourceTree = SOURCE_ROOT; };
@ -459,6 +459,7 @@
ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)"; ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386"; ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
GCC_C_LANGUAGE_STANDARD = c99; GCC_C_LANGUAGE_STANDARD = c99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.5; MACOSX_DEPLOYMENT_TARGET = 10.5;