From 7df307b567e3e82387de5cbc345853dad3eb10e0 Mon Sep 17 00:00:00 2001 From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Sun, 3 Mar 2024 09:54:59 -0500 Subject: [PATCH] Use NSInteger/NSUInteger where appropiate These return values now match the type specified by Apple. --- Mac/PythonLauncher/FileSettings.m | 2 +- Mac/PythonLauncher/MyAppDelegate.m | 2 +- Mac/PythonLauncher/PreferencesWindowController.h | 8 ++++---- Mac/PythonLauncher/PreferencesWindowController.m | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Mac/PythonLauncher/FileSettings.m b/Mac/PythonLauncher/FileSettings.m index 3438870b7484c4..a1ca8d2fefc4ef 100644 --- a/Mac/PythonLauncher/FileSettings.m +++ b/Mac/PythonLauncher/FileSettings.m @@ -97,7 +97,7 @@ - (id)initForFileType: (NSString *)filetype - (id)initForFSDefaultFileType: (NSString *)filetype { - int i; + NSUInteger i; NSString *filename; NSDictionary *dict; static NSDictionary *factorySettings; diff --git a/Mac/PythonLauncher/MyAppDelegate.m b/Mac/PythonLauncher/MyAppDelegate.m index 9cc2aa0ad90982..3491e64b2c34f8 100644 --- a/Mac/PythonLauncher/MyAppDelegate.m +++ b/Mac/PythonLauncher/MyAppDelegate.m @@ -61,7 +61,7 @@ - (void)testFileTypeBinding NSURL *appUrl; static NSString *extensions[] = { @"py", @"pyw", @"pyc", NULL}; NSString **ext_p; - int i; + NSInteger i; if ([[NSUserDefaults standardUserDefaults] boolForKey: @"SkipFileBindingTest"]) return; diff --git a/Mac/PythonLauncher/PreferencesWindowController.h b/Mac/PythonLauncher/PreferencesWindowController.h index 63469968c1e3e7..d7a8537ffa2d44 100644 --- a/Mac/PythonLauncher/PreferencesWindowController.h +++ b/Mac/PythonLauncher/PreferencesWindowController.h @@ -30,9 +30,9 @@ - (void)controlTextDidChange:(NSNotification *)aNotification; -- (unsigned int)comboBox:(NSComboBox *)aComboBox indexOfItemWithStringValue:(NSString *)aString; -- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)index; -- (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox; - +- (NSUInteger)comboBox:(NSComboBox *)aComboBox + indexOfItemWithStringValue:(NSString *)aString; +- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)index; +- (NSUInteger)numberOfItemsInComboBox:(NSComboBox *)aComboBox; @end diff --git a/Mac/PythonLauncher/PreferencesWindowController.m b/Mac/PythonLauncher/PreferencesWindowController.m index dc65064463c48d..a4418dbe115701 100644 --- a/Mac/PythonLauncher/PreferencesWindowController.m +++ b/Mac/PythonLauncher/PreferencesWindowController.m @@ -93,24 +93,24 @@ - (void)controlTextDidChange:(NSNotification *)aNotification }; // NSComboBoxDataSource protocol -- (unsigned int)comboBox:(NSComboBox *)aComboBox indexOfItemWithStringValue:(NSString *)aString +- (NSUInteger)comboBox:(NSComboBox *)aComboBox indexOfItemWithStringValue:(NSString *)aString { NSArray *interp_list = [settings interpreters]; - unsigned int rv = [interp_list indexOfObjectIdenticalTo: aString]; + NSUInteger rv = [interp_list indexOfObjectIdenticalTo: aString]; return rv; } -- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)index +- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(NSInteger)index { NSArray *interp_list = [settings interpreters]; id rv = [interp_list objectAtIndex: index]; return rv; } -- (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox +- (NSUInteger)numberOfItemsInComboBox:(NSComboBox *)aComboBox { NSArray *interp_list = [settings interpreters]; - int rv = [interp_list count]; + NSUInteger rv = [interp_list count]; return rv; }