Merge pull request #369 from macvim-dev/fix/warnings

Suppress warnings 2nd round for Xcode 8
This commit is contained in:
Kazuki Sakamoto
2016-10-01 23:46:42 -07:00
committed by GitHub
10 changed files with 49 additions and 32 deletions
+1 -1
View File
@@ -349,7 +349,7 @@ static DBPrefsWindowController *_sharedPrefsWindowController = nil;
{
[viewAnimation stopAnimation];
if ([self shiftSlowsAnimation] && [[[self window] currentEvent] modifierFlags] & NSShiftKeyMask)
if ([self shiftSlowsAnimation] && [[[self window] currentEvent] modifierFlags] & NSEventModifierFlagShift)
[viewAnimation setDuration:1.25];
else
[viewAnimation setDuration:0.25];
+1 -1
View File
@@ -1869,7 +1869,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
// background, the runloop won't bother flushing the autorelease pool.
// Triggering an NSEvent works around this.
// http://www.mikeash.com/pyblog/more-fun-with-autorelease.html
NSEvent* event = [NSEvent otherEventWithType:NSApplicationDefined
NSEvent* event = [NSEvent otherEventWithType:NSEventTypeApplicationDefined
location:NSZeroPoint
modifierFlags:0
timestamp:0
+4 -3
View File
@@ -27,14 +27,15 @@
// help mode' (the keyDown: event itself never reaches the text view). By
// clearing the 'help key flag' this event will be treated like a normal
// key event.
if ((NSKeyDown == type || NSKeyUp == type) && (flags & NSHelpKeyMask)) {
flags &= ~NSHelpKeyMask;
if ((NSEventTypeKeyDown == type || NSEventTypeKeyUp == type) &&
(flags & NSEventModifierFlagHelp)) {
flags &= ~NSEventModifierFlagHelp;
event = [NSEvent keyEventWithType:[event type]
location:[event locationInWindow]
modifierFlags:flags
timestamp:[event timestamp]
windowNumber:[event windowNumber]
context:[event context]
context:nil // [event context] is always nil
characters:[event characters]
charactersIgnoringModifiers:[event charactersIgnoringModifiers]
isARepeat:[event isARepeat]
+6 -6
View File
@@ -3173,11 +3173,11 @@ static int eventModifierFlagsToVimModMask(int modifierFlags)
{
int modMask = 0;
if (modifierFlags & NSShiftKeyMask)
if (modifierFlags & NSEventModifierFlagShift)
modMask |= MOD_MASK_SHIFT;
if (modifierFlags & NSControlKeyMask)
if (modifierFlags & NSEventModifierFlagControl)
modMask |= MOD_MASK_CTRL;
if (modifierFlags & NSAlternateKeyMask)
if (modifierFlags & NSEventModifierFlagOption)
modMask |= MOD_MASK_ALT;
if (modifierFlags & NSEventModifierFlagCommand)
modMask |= MOD_MASK_CMD;
@@ -3189,11 +3189,11 @@ static int eventModifierFlagsToVimMouseModMask(int modifierFlags)
{
int modMask = 0;
if (modifierFlags & NSShiftKeyMask)
if (modifierFlags & NSEventModifierFlagShift)
modMask |= MOUSE_SHIFT;
if (modifierFlags & NSControlKeyMask)
if (modifierFlags & NSEventModifierFlagControl)
modMask |= MOUSE_CTRL;
if (modifierFlags & NSAlternateKeyMask)
if (modifierFlags & NSEventModifierFlagOption)
modMask |= MOUSE_ALT;
return modMask;
+4 -4
View File
@@ -150,12 +150,12 @@ static const NSTrackingRectTag kTrackingRectTag = 0xBADFACE;
}
}
// Sends a fake NSMouseExited event to the view for its current tracking rect.
// Sends a fake NSEventTypeMouseExited event to the view for its current tracking rect.
- (void)_sendToolTipMouseExited
{
// Nothing matters except window, trackingNumber, and userData.
int windowNumber = [[self window] windowNumber];
NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSMouseExited
NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSEventTypeMouseExited
location:NSMakePoint(0, 0)
modifierFlags:0
timestamp:0
@@ -167,12 +167,12 @@ static const NSTrackingRectTag kTrackingRectTag = 0xBADFACE;
[trackingRectOwner_ mouseExited:fakeEvent];
}
// Sends a fake NSMouseEntered event to the view for its current tracking rect.
// Sends a fake NSEventTypeMouseEntered event to the view for its current tracking rect.
- (void)_sendToolTipMouseEntered
{
// Nothing matters except window, trackingNumber, and userData.
int windowNumber = [[self window] windowNumber];
NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSMouseEntered
NSEvent *fakeEvent = [NSEvent enterExitEventWithType:NSEventTypeMouseEntered
location:NSMakePoint(0, 0)
modifierFlags:0
timestamp:0
+1 -1
View File
@@ -910,7 +910,7 @@ defaultAdvanceForFont(NSFont *font)
numColumns:width];
[signImg drawInRect:r
fromRect:NSZeroRect
operation:NSCompositeSourceOver
operation:NSCompositingOperationSourceOver
fraction:1.0];
} else if (DrawStringDrawType == type) {
int bg = *((int*)bytes); bytes += sizeof(int);
+1 -1
View File
@@ -67,7 +67,7 @@ enum {
// (another way would be to make the existing window large enough that the
// title bar is off screen. but that doesn't work with multiple screens).
self = [super initWithContentRect:[screen frame]
styleMask:NSBorderlessWindowMask
styleMask:NSWindowStyleMaskBorderless
backing:NSBackingStoreBuffered
defer:YES
// since we're passing [screen frame] above,
+14 -12
View File
@@ -158,12 +158,13 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
// ASCII chars in the range after space (0x20) and before backspace (0x7f).
// Note that this implies that 'mmta' (if enabled) breaks input methods
// when the Alt key is held.
if ((flags & NSAlternateKeyMask) && [mmta boolValue] && [unmod length] == 1
if ((flags & NSEventModifierFlagOption)
&& [mmta boolValue] && [unmod length] == 1
&& [unmod characterAtIndex:0] > 0x20) {
ASLogDebug(@"MACMETA key, don't interpret it");
string = unmod;
} else if (imState && (flags & NSControlKeyMask)
&& !(flags & (NSAlternateKeyMask|NSEventModifierFlagCommand))
} else if (imState && (flags & NSEventModifierFlagControl)
&& !(flags & (NSEventModifierFlagOption|NSEventModifierFlagCommand))
&& [unmod length] == 1
&& ([unmod characterAtIndex:0] == '6' ||
[unmod characterAtIndex:0] == '^')) {
@@ -186,8 +187,9 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
// following heuristic seems to work but it may have to change.
// Note that the Shift and Alt flags may also need to be cleared
// (see doKeyDown:keyCode:modifiers: in MMBackend).
if ((flags & NSShiftKeyMask && !(flags & NSAlternateKeyMask))
|| flags & NSControlKeyMask)
if ((flags & NSEventModifierFlagShift
&& !(flags & NSEventModifierFlagOption))
|| flags & NSEventModifierFlagControl)
string = unmod;
}
}
@@ -339,12 +341,12 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
// If desired, intepret Ctrl-Click as a right mouse click.
BOOL translateCtrlClick = [[NSUserDefaults standardUserDefaults]
boolForKey:MMTranslateCtrlClickKey];
flags = flags & NSDeviceIndependentModifierFlagsMask;
flags = flags & NSEventModifierFlagDeviceIndependentFlagsMask;
if (translateCtrlClick && button == 0 &&
(flags == NSControlKeyMask ||
flags == (NSControlKeyMask|NSAlphaShiftKeyMask))) {
(flags == NSEventModifierFlagControl || flags ==
(NSEventModifierFlagControl|NSEventModifierFlagCapsLock))) {
button = 1;
flags &= ~NSControlKeyMask;
flags &= ~NSEventModifierFlagControl;
}
[data appendBytes:&row length:sizeof(int)];
@@ -853,7 +855,7 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
// The low 16 bits are not used for modifier flags by NSEvent. Use
// these bits for custom flags.
flags &= NSDeviceIndependentModifierFlagsMask;
flags &= NSEventModifierFlagDeviceIndependentFlagsMask;
if ([currentEvent isARepeat])
flags |= 1;
@@ -886,8 +888,8 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
// HACK! Keys on the numeric key pad are treated as special keys by Vim
// so we need to pass on key code and modifier flags in this situation.
unsigned mods = [currentEvent modifierFlags];
if (mods & NSNumericPadKeyMask) {
flags = mods & NSDeviceIndependentModifierFlagsMask;
if (mods & NSEventModifierFlagNumericPad) {
flags = mods & NSEventModifierFlagDeviceIndependentFlagsMask;
keyCode = [currentEvent keyCode];
}
+14
View File
@@ -41,10 +41,24 @@
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
// Deprecated constants in 10.12 SDK
# define NSAlertStyleWarning NSWarningAlertStyle
# define NSCompositingOperationSourceOver NSCompositeSourceOver
# define NSControlSizeRegular NSRegularControlSize
# define NSEventModifierFlagCapsLock NSAlphaShiftKeyMask
# define NSEventModifierFlagCommand NSCommandKeyMask
# define NSEventModifierFlagControl NSControlKeyMask
# define NSEventModifierFlagDeviceIndependentFlagsMask NSDeviceIndependentModifierFlagsMask
# define NSEventModifierFlagHelp NSHelpKeyMask
# define NSEventModifierFlagNumericPad NSNumericPadKeyMask
# define NSEventModifierFlagOption NSAlternateKeyMask
# define NSEventModifierFlagShift NSShiftKeyMask
# define NSEventTypeApplicationDefined NSApplicationDefined
# define NSEventTypeKeyDown NSKeyDown
# define NSEventTypeKeyUp NSKeyUp
# define NSEventTypeLeftMouseUp NSLeftMouseUp
# define NSEventTypeMouseEntered NSMouseEntered
# define NSEventTypeMouseExited NSMouseExited
# define NSEventTypeRightMouseDown NSRightMouseDown
# define NSWindowStyleMaskBorderless NSBorderlessWindowMask
# define NSWindowStyleMaskClosable NSClosableWindowMask
# define NSWindowStyleMaskFullScreen NSFullScreenWindowMask
# define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
+3 -3
View File
@@ -2247,11 +2247,11 @@ static int vimModMaskToEventModifierFlags(int mods)
int flags = 0;
if (mods & MOD_MASK_SHIFT)
flags |= NSShiftKeyMask;
flags |= NSEventModifierFlagShift;
if (mods & MOD_MASK_CTRL)
flags |= NSControlKeyMask;
flags |= NSEventModifierFlagControl;
if (mods & MOD_MASK_ALT)
flags |= NSAlternateKeyMask;
flags |= NSEventModifierFlagOption;
if (mods & MOD_MASK_CMD)
flags |= NSEventModifierFlagCommand;