@@ -567,7 +567,7 @@ - (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender
567567
568568 // The user default MMUntitledWindow can be set to control whether an
569569 // untitled window should open on 'Open' and 'Reopen' events.
570- int untitledWindowFlag = [ud integerForKey: MMUntitledWindowKey];
570+ NSInteger untitledWindowFlag = [ud integerForKey: MMUntitledWindowKey];
571571
572572 BOOL isAppOpenEvent = [desc eventID ] == kAEOpenApplication ;
573573 if (isAppOpenEvent && (untitledWindowFlag & MMUntitledWindowOnOpen) == 0 )
@@ -700,7 +700,7 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:
700700 boolForKey: MMSuppressTerminationAlertKey]) {
701701 // No unmodified buffers, but give a warning if there are multiple
702702 // windows and/or tabs open.
703- int numWindows = [vimControllers count ];
703+ int numWindows = ( int ) [vimControllers count ];
704704 int numTabs = 0 ;
705705
706706 // Count the number of open tabs
@@ -1065,7 +1065,7 @@ - (void)refreshMainMenu
10651065 [fileMenu removeItemAtIndex: dummyIdx];
10661066
10671067 NSMenu *recentFilesParentMenu = [recentFilesMenuItem menu ];
1068- int idx = [recentFilesParentMenu indexOfItem: recentFilesMenuItem];
1068+ NSInteger idx = [recentFilesParentMenu indexOfItem: recentFilesMenuItem];
10691069 if (idx >= 0 ) {
10701070 [[recentFilesMenuItem retain ] autorelease ];
10711071 [recentFilesParentMenu removeItemAtIndex: idx];
@@ -1133,7 +1133,7 @@ - (BOOL)openFiles:(NSArray *)filenames withArguments:(NSDictionary *)args
11331133
11341134 // The meaning of "layout" is defined by the WIN_* defines in main.c.
11351135 NSUserDefaults *ud = [NSUserDefaults standardUserDefaults ];
1136- int layout = [ud integerForKey: MMOpenLayoutKey];
1136+ NSInteger layout = [ud integerForKey: MMOpenLayoutKey];
11371137 BOOL splitVert = [ud boolForKey: MMVerticalSplitKey];
11381138 BOOL openInCurrentWindow = [ud boolForKey: MMOpenInCurrentWindowKey];
11391139
@@ -1166,7 +1166,7 @@ - (BOOL)openFiles:(NSArray *)filenames withArguments:(NSDictionary *)args
11661166 // selection will be lost when selectionRange is set.
11671167 NSDictionary *args = [NSDictionary dictionaryWithObjectsAndKeys:
11681168 firstFile, @" filename" ,
1169- [NSNumber numberWithInt: layout], @" layout" ,
1169+ [NSNumber numberWithInt: ( int ) layout], @" layout" ,
11701170 nil ];
11711171 [vc sendMessage: SelectAndFocusOpenedFileMsgID data: [args dictionaryAsData ]];
11721172 }
@@ -1188,7 +1188,7 @@ - (BOOL)openFiles:(NSArray *)filenames withArguments:(NSDictionary *)args
11881188 // b) Open any remaining files
11891189 //
11901190
1191- [arguments setObject: [NSNumber numberWithInt: layout] forKey: @" layout" ];
1191+ [arguments setObject: [NSNumber numberWithInt: ( int ) layout] forKey: @" layout" ];
11921192 [arguments setObject: filenames forKey: @" filenames" ];
11931193 // (Indicate that files should be opened from now on.)
11941194 [arguments setObject: [NSNumber numberWithBool: NO ] forKey: @" dontOpen" ];
@@ -1202,7 +1202,7 @@ - (BOOL)openFiles:(NSArray *)filenames withArguments:(NSDictionary *)args
12021202 }
12031203
12041204 BOOL openOk = YES ;
1205- int numFiles = [filenames count ];
1205+ int numFiles = ( int ) [filenames count ];
12061206 if (MMLayoutWindows == layout && numFiles > 1 ) {
12071207 // Open one file at a time in a new window, but don't open too many at
12081208 // once (at most cap+1 windows will open). If the user has increased
@@ -1246,7 +1246,7 @@ - (BOOL)openFiles:(NSArray *)filenames withArguments:(NSDictionary *)args
12461246
12471247- (void )refreshAllAppearances
12481248{
1249- unsigned count = [vimControllers count ];
1249+ const NSUInteger count = [vimControllers count ];
12501250 for (unsigned i = 0 ; i < count; ++i) {
12511251 MMVimController *vc = [vimControllers objectAtIndex: i];
12521252 [vc.windowController refreshApperanceMode ];
@@ -1256,7 +1256,7 @@ - (void)refreshAllAppearances
12561256// / Refresh all Vim text views' fonts.
12571257- (void )refreshAllFonts
12581258{
1259- unsigned count = [vimControllers count ];
1259+ const NSUInteger count = [vimControllers count ];
12601260 for (unsigned i = 0 ; i < count; ++i) {
12611261 MMVimController *vc = [vimControllers objectAtIndex: i];
12621262 [vc.windowController refreshFonts ];
@@ -1267,7 +1267,7 @@ - (void)refreshAllFonts
12671267// / and resize the windows to match the constraints.
12681268- (void )refreshAllResizeConstraints
12691269{
1270- const unsigned count = [vimControllers count ];
1270+ const NSUInteger count = [vimControllers count ];
12711271 for (unsigned i = 0 ; i < count; ++i) {
12721272 MMVimController *vc = [vimControllers objectAtIndex: i];
12731273 [vc.windowController updateResizeConstraints: YES ];
@@ -1278,7 +1278,7 @@ - (void)refreshAllResizeConstraints
12781278// / cmdline alignment properties to make sure they are pinned properly.
12791279- (void )refreshAllTextViews
12801280{
1281- unsigned count = [vimControllers count ];
1281+ const NSUInteger count = [vimControllers count ];
12821282 for (unsigned i = 0 ; i < count; ++i) {
12831283 MMVimController *vc = [vimControllers objectAtIndex: i];
12841284 [vc.windowController.vimView.textView updateCmdlineRow ];
@@ -1408,7 +1408,7 @@ - (IBAction)selectNextWindow:(id)sender
14081408{
14091409 ASLogDebug (@" Select next window" );
14101410
1411- unsigned i, count = [vimControllers count ];
1411+ NSUInteger i, count = [vimControllers count ];
14121412 if (!count) return ;
14131413
14141414 NSWindow *keyWindow = [NSApp keyWindow ];
@@ -1430,7 +1430,7 @@ - (IBAction)selectPreviousWindow:(id)sender
14301430{
14311431 ASLogDebug (@" Select previous window" );
14321432
1433- unsigned i, count = [vimControllers count ];
1433+ NSUInteger i, count = [vimControllers count ];
14341434 if (!count) return ;
14351435
14361436 NSWindow *keyWindow = [NSApp keyWindow ];
@@ -1542,7 +1542,7 @@ - (IBAction)coreTextButtonClicked:(id)sender
15421542 // any new Vim process will pick up on the changed setting.
15431543 CFPreferencesSetAppValue (
15441544 (CFStringRef)MMRendererKey,
1545- (CFPropertyListRef)[NSNumber numberWithInt: renderer],
1545+ (CFPropertyListRef)[NSNumber numberWithInt: ( int ) renderer],
15461546 kCFPreferencesCurrentApplication );
15471547 CFPreferencesAppSynchronize (kCFPreferencesCurrentApplication );
15481548
@@ -1578,7 +1578,7 @@ - (MMVimController *)keyVimController
15781578{
15791579 NSWindow *keyWindow = [NSApp keyWindow ];
15801580 if (keyWindow) {
1581- unsigned i, count = [vimControllers count ];
1581+ NSUInteger i, count = [vimControllers count ];
15821582 for (i = 0 ; i < count; ++i) {
15831583 MMVimController *vc = [vimControllers objectAtIndex: i];
15841584 if ([[[vc windowController ] window ] isEqual: keyWindow])
@@ -1660,7 +1660,7 @@ - (NSArray *)serverList
16601660{
16611661 NSMutableArray *array = [NSMutableArray array ];
16621662
1663- unsigned i, count = [vimControllers count ];
1663+ NSUInteger i, count = [vimControllers count ];
16641664 for (i = 0 ; i < count; ++i) {
16651665 MMVimController *controller = [vimControllers objectAtIndex: i];
16661666 if ([controller serverName ])
@@ -1931,15 +1931,15 @@ - (MMVimController *)topmostVimController
19311931 NSEnumerator *e = [[NSApp orderedWindows ] objectEnumerator ];
19321932 id window;
19331933 while ((window = [e nextObject ]) && [window isVisible ]) {
1934- unsigned i, count = [vimControllers count ];
1934+ NSUInteger i, count = [vimControllers count ];
19351935 for (i = 0 ; i < count; ++i) {
19361936 MMVimController *vc = [vimControllers objectAtIndex: i];
19371937 if ([[[vc windowController ] window ] isEqual: window])
19381938 return vc;
19391939 }
19401940 }
19411941
1942- unsigned i, count = [vimControllers count ];
1942+ NSUInteger i, count = [vimControllers count ];
19431943 for (i = 0 ; i < count; ++i) {
19441944 MMVimController *vc = [vimControllers objectAtIndex: i];
19451945 if ([[[vc windowController ] window ] isVisible ]) {
@@ -2016,7 +2016,7 @@ - (NSArray *)filterFilesAndNotify:(NSArray *)filenames
20162016
20172017 NSString *firstMissingFile = nil ;
20182018 NSMutableArray *files = [NSMutableArray array ];
2019- unsigned i, count = [filenames count ];
2019+ NSUInteger i, count = [filenames count ];
20202020
20212021 for (i = 0 ; i < count; ++i) {
20222022 NSString *name = [filenames objectAtIndex: i];
@@ -2076,7 +2076,7 @@ - (NSArray *)filterOpenFiles:(NSArray *)filenames
20762076 @" map([\" %@ \" ],\" bufloaded(v:val)\" )" ,
20772077 [files componentsJoinedByString: @" \" ,\" " ]];
20782078
2079- unsigned i, count = [vimControllers count ];
2079+ NSUInteger i, count = [vimControllers count ];
20802080 for (i = 0 ; i < count && [files count ] > 0 ; ++i) {
20812081 MMVimController *vc = [vimControllers objectAtIndex: i];
20822082
@@ -2428,12 +2428,12 @@ - (int)maxPreloadCacheSize
24282428{
24292429 // The maximum number of Vim processes to keep in the cache can be
24302430 // controlled via the user default "MMPreloadCacheSize".
2431- int maxCacheSize = [[NSUserDefaults standardUserDefaults ]
2431+ NSInteger maxCacheSize = [[NSUserDefaults standardUserDefaults ]
24322432 integerForKey: MMPreloadCacheSizeKey];
24332433 if (maxCacheSize < 0 ) maxCacheSize = 0 ;
24342434 else if (maxCacheSize > 10 ) maxCacheSize = 10 ;
24352435
2436- return maxCacheSize;
2436+ return ( int ) maxCacheSize;
24372437}
24382438
24392439- (MMVimController *)takeVimControllerFromCache
@@ -2445,7 +2445,7 @@ - (MMVimController *)takeVimControllerFromCache
24452445 // This method may return nil even though the cache might be non-empty; the
24462446 // caller should handle this by starting a new Vim process.
24472447
2448- int i, count = [cachedVimControllers count ];
2448+ NSUInteger i, count = [cachedVimControllers count ];
24492449 if (0 == count) return nil ;
24502450
24512451 // Locate the first Vim controller with up-to-date rc-files sourced.
@@ -2461,7 +2461,7 @@ - (MMVimController *)takeVimControllerFromCache
24612461 // Clear out cache entries whose vimrc/gvimrc files were sourced before
24622462 // the latest modification date for those files. This ensures that the
24632463 // latest rc-files are always sourced for new windows.
2464- [self clearPreloadCacheWithCount: i];
2464+ [self clearPreloadCacheWithCount: ( int ) i];
24652465 }
24662466
24672467 if ([cachedVimControllers count ] == 0 ) {
@@ -2497,7 +2497,7 @@ - (void)clearPreloadCacheWithCount:(int)count
24972497 return ;
24982498
24992499 if (count < 0 )
2500- count = [cachedVimControllers count ];
2500+ count = ( int ) [cachedVimControllers count ];
25012501
25022502 // Make sure the preloaded Vim processes get killed or they'll just hang
25032503 // around being useless until MacVim is terminated.
@@ -2618,9 +2618,7 @@ - (void)startWatchingVimDir
26182618 (CFArrayRef)pathsToWatch, kFSEventStreamEventIdSinceNow ,
26192619 MMEventStreamLatency, kFSEventStreamCreateFlagNone );
26202620
2621- FSEventStreamScheduleWithRunLoop (fsEventStream,
2622- [[NSRunLoop currentRunLoop ] getCFRunLoop ],
2623- kCFRunLoopDefaultMode );
2621+ FSEventStreamSetDispatchQueue (fsEventStream, dispatch_get_main_queue ());
26242622
26252623 FSEventStreamStart (fsEventStream);
26262624 ASLogDebug (@" Started FS event stream" );
@@ -2734,9 +2732,9 @@ - (int)executeInLoginShell:(NSString *)path arguments:(NSArray *)args
27342732
27352733 // Send input to execute to the child process
27362734 [input appendString: @" \n " ];
2737- int bytes = [input lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
2735+ NSUInteger bytes = [input lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
27382736
2739- if (write (ds[1 ], [input UTF8String ], bytes) != bytes) return -1 ;
2737+ if (write (ds[1 ], [input UTF8String ], ( size_t ) bytes) != ( ssize_t ) bytes) return -1 ;
27402738 if (close (ds[1 ]) == -1 ) return -1 ;
27412739
27422740 ++numChildProcesses;
@@ -2797,7 +2795,7 @@ - (void)processInputQueues:(id)sender
27972795 NSNumber *key;
27982796 while ((key = [e nextObject ])) {
27992797 unsigned long ukey = [key unsignedLongValue ];
2800- int i = 0 , count = [vimControllers count ];
2798+ NSUInteger i = 0 , count = [vimControllers count ];
28012799 for (i = 0 ; i < count; ++i) {
28022800 MMVimController *vc = [vimControllers objectAtIndex: i];
28032801 if (ukey == [vc vimControllerId ]) {
@@ -2882,7 +2880,7 @@ - (NSDictionary *)convertVimControllerArguments:(NSDictionary *)args
28822880 *cmdline = nil ;
28832881
28842882 NSArray *filenames = [args objectForKey: @" filenames" ];
2885- int numFiles = filenames ? [filenames count ] : 0 ;
2883+ NSUInteger numFiles = filenames ? [filenames count ] : 0 ;
28862884 BOOL openFiles = ![[args objectForKey: @" dontOpen" ] boolValue ];
28872885
28882886 if (numFiles <= 0 || !openFiles)
@@ -3029,7 +3027,7 @@ - (void)removeInputSourceChangedObserver
30293027
30303028- (void )inputSourceChanged : (NSNotification *)notification
30313029{
3032- unsigned i, count = [vimControllers count ];
3030+ NSUInteger i, count = [vimControllers count ];
30333031 for (i = 0 ; i < count; ++i) {
30343032 MMVimController *controller = [vimControllers objectAtIndex: i];
30353033 MMWindowController *wc = [controller windowController ];
0 commit comments