@@ -567,7 +567,7 @@ - (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender
567
567
568
568
// The user default MMUntitledWindow can be set to control whether an
569
569
// untitled window should open on 'Open' and 'Reopen' events.
570
- int untitledWindowFlag = [ud integerForKey: MMUntitledWindowKey];
570
+ NSInteger untitledWindowFlag = [ud integerForKey: MMUntitledWindowKey];
571
571
572
572
BOOL isAppOpenEvent = [desc eventID ] == kAEOpenApplication ;
573
573
if (isAppOpenEvent && (untitledWindowFlag & MMUntitledWindowOnOpen) == 0 )
@@ -700,7 +700,7 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:
700
700
boolForKey: MMSuppressTerminationAlertKey]) {
701
701
// No unmodified buffers, but give a warning if there are multiple
702
702
// windows and/or tabs open.
703
- int numWindows = [vimControllers count ];
703
+ int numWindows = ( int ) [vimControllers count ];
704
704
int numTabs = 0 ;
705
705
706
706
// Count the number of open tabs
@@ -1065,7 +1065,7 @@ - (void)refreshMainMenu
1065
1065
[fileMenu removeItemAtIndex: dummyIdx];
1066
1066
1067
1067
NSMenu *recentFilesParentMenu = [recentFilesMenuItem menu ];
1068
- int idx = [recentFilesParentMenu indexOfItem: recentFilesMenuItem];
1068
+ NSInteger idx = [recentFilesParentMenu indexOfItem: recentFilesMenuItem];
1069
1069
if (idx >= 0 ) {
1070
1070
[[recentFilesMenuItem retain ] autorelease ];
1071
1071
[recentFilesParentMenu removeItemAtIndex: idx];
@@ -1133,7 +1133,7 @@ - (BOOL)openFiles:(NSArray *)filenames withArguments:(NSDictionary *)args
1133
1133
1134
1134
// The meaning of "layout" is defined by the WIN_* defines in main.c.
1135
1135
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults ];
1136
- int layout = [ud integerForKey: MMOpenLayoutKey];
1136
+ NSInteger layout = [ud integerForKey: MMOpenLayoutKey];
1137
1137
BOOL splitVert = [ud boolForKey: MMVerticalSplitKey];
1138
1138
BOOL openInCurrentWindow = [ud boolForKey: MMOpenInCurrentWindowKey];
1139
1139
@@ -1166,7 +1166,7 @@ - (BOOL)openFiles:(NSArray *)filenames withArguments:(NSDictionary *)args
1166
1166
// selection will be lost when selectionRange is set.
1167
1167
NSDictionary *args = [NSDictionary dictionaryWithObjectsAndKeys:
1168
1168
firstFile, @" filename" ,
1169
- [NSNumber numberWithInt: layout], @" layout" ,
1169
+ [NSNumber numberWithInt: ( int ) layout], @" layout" ,
1170
1170
nil ];
1171
1171
[vc sendMessage: SelectAndFocusOpenedFileMsgID data: [args dictionaryAsData ]];
1172
1172
}
@@ -1188,7 +1188,7 @@ - (BOOL)openFiles:(NSArray *)filenames withArguments:(NSDictionary *)args
1188
1188
// b) Open any remaining files
1189
1189
//
1190
1190
1191
- [arguments setObject: [NSNumber numberWithInt: layout] forKey: @" layout" ];
1191
+ [arguments setObject: [NSNumber numberWithInt: ( int ) layout] forKey: @" layout" ];
1192
1192
[arguments setObject: filenames forKey: @" filenames" ];
1193
1193
// (Indicate that files should be opened from now on.)
1194
1194
[arguments setObject: [NSNumber numberWithBool: NO ] forKey: @" dontOpen" ];
@@ -1202,7 +1202,7 @@ - (BOOL)openFiles:(NSArray *)filenames withArguments:(NSDictionary *)args
1202
1202
}
1203
1203
1204
1204
BOOL openOk = YES ;
1205
- int numFiles = [filenames count ];
1205
+ int numFiles = ( int ) [filenames count ];
1206
1206
if (MMLayoutWindows == layout && numFiles > 1 ) {
1207
1207
// Open one file at a time in a new window, but don't open too many at
1208
1208
// once (at most cap+1 windows will open). If the user has increased
@@ -1246,7 +1246,7 @@ - (BOOL)openFiles:(NSArray *)filenames withArguments:(NSDictionary *)args
1246
1246
1247
1247
- (void )refreshAllAppearances
1248
1248
{
1249
- unsigned count = [vimControllers count ];
1249
+ const NSUInteger count = [vimControllers count ];
1250
1250
for (unsigned i = 0 ; i < count; ++i) {
1251
1251
MMVimController *vc = [vimControllers objectAtIndex: i];
1252
1252
[vc.windowController refreshApperanceMode ];
@@ -1256,7 +1256,7 @@ - (void)refreshAllAppearances
1256
1256
// / Refresh all Vim text views' fonts.
1257
1257
- (void )refreshAllFonts
1258
1258
{
1259
- unsigned count = [vimControllers count ];
1259
+ const NSUInteger count = [vimControllers count ];
1260
1260
for (unsigned i = 0 ; i < count; ++i) {
1261
1261
MMVimController *vc = [vimControllers objectAtIndex: i];
1262
1262
[vc.windowController refreshFonts ];
@@ -1267,7 +1267,7 @@ - (void)refreshAllFonts
1267
1267
// / and resize the windows to match the constraints.
1268
1268
- (void )refreshAllResizeConstraints
1269
1269
{
1270
- const unsigned count = [vimControllers count ];
1270
+ const NSUInteger count = [vimControllers count ];
1271
1271
for (unsigned i = 0 ; i < count; ++i) {
1272
1272
MMVimController *vc = [vimControllers objectAtIndex: i];
1273
1273
[vc.windowController updateResizeConstraints: YES ];
@@ -1278,7 +1278,7 @@ - (void)refreshAllResizeConstraints
1278
1278
// / cmdline alignment properties to make sure they are pinned properly.
1279
1279
- (void )refreshAllTextViews
1280
1280
{
1281
- unsigned count = [vimControllers count ];
1281
+ const NSUInteger count = [vimControllers count ];
1282
1282
for (unsigned i = 0 ; i < count; ++i) {
1283
1283
MMVimController *vc = [vimControllers objectAtIndex: i];
1284
1284
[vc.windowController.vimView.textView updateCmdlineRow ];
@@ -1408,7 +1408,7 @@ - (IBAction)selectNextWindow:(id)sender
1408
1408
{
1409
1409
ASLogDebug (@" Select next window" );
1410
1410
1411
- unsigned i, count = [vimControllers count ];
1411
+ NSUInteger i, count = [vimControllers count ];
1412
1412
if (!count) return ;
1413
1413
1414
1414
NSWindow *keyWindow = [NSApp keyWindow ];
@@ -1430,7 +1430,7 @@ - (IBAction)selectPreviousWindow:(id)sender
1430
1430
{
1431
1431
ASLogDebug (@" Select previous window" );
1432
1432
1433
- unsigned i, count = [vimControllers count ];
1433
+ NSUInteger i, count = [vimControllers count ];
1434
1434
if (!count) return ;
1435
1435
1436
1436
NSWindow *keyWindow = [NSApp keyWindow ];
@@ -1542,7 +1542,7 @@ - (IBAction)coreTextButtonClicked:(id)sender
1542
1542
// any new Vim process will pick up on the changed setting.
1543
1543
CFPreferencesSetAppValue (
1544
1544
(CFStringRef)MMRendererKey,
1545
- (CFPropertyListRef)[NSNumber numberWithInt: renderer],
1545
+ (CFPropertyListRef)[NSNumber numberWithInt: ( int ) renderer],
1546
1546
kCFPreferencesCurrentApplication );
1547
1547
CFPreferencesAppSynchronize (kCFPreferencesCurrentApplication );
1548
1548
@@ -1578,7 +1578,7 @@ - (MMVimController *)keyVimController
1578
1578
{
1579
1579
NSWindow *keyWindow = [NSApp keyWindow ];
1580
1580
if (keyWindow) {
1581
- unsigned i, count = [vimControllers count ];
1581
+ NSUInteger i, count = [vimControllers count ];
1582
1582
for (i = 0 ; i < count; ++i) {
1583
1583
MMVimController *vc = [vimControllers objectAtIndex: i];
1584
1584
if ([[[vc windowController ] window ] isEqual: keyWindow])
@@ -1660,7 +1660,7 @@ - (NSArray *)serverList
1660
1660
{
1661
1661
NSMutableArray *array = [NSMutableArray array ];
1662
1662
1663
- unsigned i, count = [vimControllers count ];
1663
+ NSUInteger i, count = [vimControllers count ];
1664
1664
for (i = 0 ; i < count; ++i) {
1665
1665
MMVimController *controller = [vimControllers objectAtIndex: i];
1666
1666
if ([controller serverName ])
@@ -1931,15 +1931,15 @@ - (MMVimController *)topmostVimController
1931
1931
NSEnumerator *e = [[NSApp orderedWindows ] objectEnumerator ];
1932
1932
id window;
1933
1933
while ((window = [e nextObject ]) && [window isVisible ]) {
1934
- unsigned i, count = [vimControllers count ];
1934
+ NSUInteger i, count = [vimControllers count ];
1935
1935
for (i = 0 ; i < count; ++i) {
1936
1936
MMVimController *vc = [vimControllers objectAtIndex: i];
1937
1937
if ([[[vc windowController ] window ] isEqual: window])
1938
1938
return vc;
1939
1939
}
1940
1940
}
1941
1941
1942
- unsigned i, count = [vimControllers count ];
1942
+ NSUInteger i, count = [vimControllers count ];
1943
1943
for (i = 0 ; i < count; ++i) {
1944
1944
MMVimController *vc = [vimControllers objectAtIndex: i];
1945
1945
if ([[[vc windowController ] window ] isVisible ]) {
@@ -2016,7 +2016,7 @@ - (NSArray *)filterFilesAndNotify:(NSArray *)filenames
2016
2016
2017
2017
NSString *firstMissingFile = nil ;
2018
2018
NSMutableArray *files = [NSMutableArray array ];
2019
- unsigned i, count = [filenames count ];
2019
+ NSUInteger i, count = [filenames count ];
2020
2020
2021
2021
for (i = 0 ; i < count; ++i) {
2022
2022
NSString *name = [filenames objectAtIndex: i];
@@ -2076,7 +2076,7 @@ - (NSArray *)filterOpenFiles:(NSArray *)filenames
2076
2076
@" map([\" %@ \" ],\" bufloaded(v:val)\" )" ,
2077
2077
[files componentsJoinedByString: @" \" ,\" " ]];
2078
2078
2079
- unsigned i, count = [vimControllers count ];
2079
+ NSUInteger i, count = [vimControllers count ];
2080
2080
for (i = 0 ; i < count && [files count ] > 0 ; ++i) {
2081
2081
MMVimController *vc = [vimControllers objectAtIndex: i];
2082
2082
@@ -2428,12 +2428,12 @@ - (int)maxPreloadCacheSize
2428
2428
{
2429
2429
// The maximum number of Vim processes to keep in the cache can be
2430
2430
// controlled via the user default "MMPreloadCacheSize".
2431
- int maxCacheSize = [[NSUserDefaults standardUserDefaults ]
2431
+ NSInteger maxCacheSize = [[NSUserDefaults standardUserDefaults ]
2432
2432
integerForKey: MMPreloadCacheSizeKey];
2433
2433
if (maxCacheSize < 0 ) maxCacheSize = 0 ;
2434
2434
else if (maxCacheSize > 10 ) maxCacheSize = 10 ;
2435
2435
2436
- return maxCacheSize;
2436
+ return ( int ) maxCacheSize;
2437
2437
}
2438
2438
2439
2439
- (MMVimController *)takeVimControllerFromCache
@@ -2445,7 +2445,7 @@ - (MMVimController *)takeVimControllerFromCache
2445
2445
// This method may return nil even though the cache might be non-empty; the
2446
2446
// caller should handle this by starting a new Vim process.
2447
2447
2448
- int i, count = [cachedVimControllers count ];
2448
+ NSUInteger i, count = [cachedVimControllers count ];
2449
2449
if (0 == count) return nil ;
2450
2450
2451
2451
// Locate the first Vim controller with up-to-date rc-files sourced.
@@ -2461,7 +2461,7 @@ - (MMVimController *)takeVimControllerFromCache
2461
2461
// Clear out cache entries whose vimrc/gvimrc files were sourced before
2462
2462
// the latest modification date for those files. This ensures that the
2463
2463
// latest rc-files are always sourced for new windows.
2464
- [self clearPreloadCacheWithCount: i];
2464
+ [self clearPreloadCacheWithCount: ( int ) i];
2465
2465
}
2466
2466
2467
2467
if ([cachedVimControllers count ] == 0 ) {
@@ -2497,7 +2497,7 @@ - (void)clearPreloadCacheWithCount:(int)count
2497
2497
return ;
2498
2498
2499
2499
if (count < 0 )
2500
- count = [cachedVimControllers count ];
2500
+ count = ( int ) [cachedVimControllers count ];
2501
2501
2502
2502
// Make sure the preloaded Vim processes get killed or they'll just hang
2503
2503
// around being useless until MacVim is terminated.
@@ -2618,9 +2618,7 @@ - (void)startWatchingVimDir
2618
2618
(CFArrayRef)pathsToWatch, kFSEventStreamEventIdSinceNow ,
2619
2619
MMEventStreamLatency, kFSEventStreamCreateFlagNone );
2620
2620
2621
- FSEventStreamScheduleWithRunLoop (fsEventStream,
2622
- [[NSRunLoop currentRunLoop ] getCFRunLoop ],
2623
- kCFRunLoopDefaultMode );
2621
+ FSEventStreamSetDispatchQueue (fsEventStream, dispatch_get_main_queue ());
2624
2622
2625
2623
FSEventStreamStart (fsEventStream);
2626
2624
ASLogDebug (@" Started FS event stream" );
@@ -2734,9 +2732,9 @@ - (int)executeInLoginShell:(NSString *)path arguments:(NSArray *)args
2734
2732
2735
2733
// Send input to execute to the child process
2736
2734
[input appendString: @" \n " ];
2737
- int bytes = [input lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
2735
+ NSUInteger bytes = [input lengthOfBytesUsingEncoding: NSUTF8StringEncoding];
2738
2736
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 ;
2740
2738
if (close (ds[1 ]) == -1 ) return -1 ;
2741
2739
2742
2740
++numChildProcesses;
@@ -2797,7 +2795,7 @@ - (void)processInputQueues:(id)sender
2797
2795
NSNumber *key;
2798
2796
while ((key = [e nextObject ])) {
2799
2797
unsigned long ukey = [key unsignedLongValue ];
2800
- int i = 0 , count = [vimControllers count ];
2798
+ NSUInteger i = 0 , count = [vimControllers count ];
2801
2799
for (i = 0 ; i < count; ++i) {
2802
2800
MMVimController *vc = [vimControllers objectAtIndex: i];
2803
2801
if (ukey == [vc vimControllerId ]) {
@@ -2882,7 +2880,7 @@ - (NSDictionary *)convertVimControllerArguments:(NSDictionary *)args
2882
2880
*cmdline = nil ;
2883
2881
2884
2882
NSArray *filenames = [args objectForKey: @" filenames" ];
2885
- int numFiles = filenames ? [filenames count ] : 0 ;
2883
+ NSUInteger numFiles = filenames ? [filenames count ] : 0 ;
2886
2884
BOOL openFiles = ![[args objectForKey: @" dontOpen" ] boolValue ];
2887
2885
2888
2886
if (numFiles <= 0 || !openFiles)
@@ -3029,7 +3027,7 @@ - (void)removeInputSourceChangedObserver
3029
3027
3030
3028
- (void )inputSourceChanged : (NSNotification *)notification
3031
3029
{
3032
- unsigned i, count = [vimControllers count ];
3030
+ NSUInteger i, count = [vimControllers count ];
3033
3031
for (i = 0 ; i < count; ++i) {
3034
3032
MMVimController *controller = [vimControllers objectAtIndex: i];
3035
3033
MMWindowController *wc = [controller windowController ];
0 commit comments