Permalink
Browse files

Silence some BS compiler warnings

  • Loading branch information...
1 parent 287bcb2 commit 719fef19437ba7ec8d8383e8460297a93ba8797f @gnachman committed Dec 21, 2016
@@ -1008,7 +1008,7 @@ static NSUInteger rkl_setCachedRegexToString(RKLCachedRegex *cachedRegex, const
RKLCDelayedAssert(cachedRegex->setToString != NULL, exception, exitNow);
cachedRegex->setToUniChar = CFStringGetCharactersPtr(cachedRegex->setToString);
cachedRegex->setToNeedsConversion = (cachedRegex->setToUniChar == NULL) ? 1U : 0U;
- cachedRegex->setToIsImmutable = (rkl_CFStringIsMutable(cachedRegex->setToString) == YES) ? 0U : 1U; // If RKL_FAST_MUTABLE_CHECK is not defined then setToIsImmutable will always be set to '0', or in other words mutable..
+ cachedRegex->setToIsImmutable = (rkl_CFStringIsMutable(cachedRegex->setToString) == /* DISABLES CODE */ (YES)) ? 0U : 1U; // If RKL_FAST_MUTABLE_CHECK is not defined then setToIsImmutable will always be set to '0', or in other words mutable..
cachedRegex->setToHash = CFHash((CFTypeRef)cachedRegex->setToString);
cachedRegex->setToRange = NSNotFoundRange;
cachedRegex->setToLength = matchLength;
@@ -1866,7 +1866,10 @@ - (id)initWithRegex:(NSString *)initRegexString options:(RKLRegexOptions)initOpt
if((buffer.uniChar = (UniChar *)CFStringGetCharactersPtr(buffer.string)) == NULL) {
rkl_dtrace_addLookupFlag(lookupResultFlags, RKLConversionRequiredLookupFlag);
if(RKL_EXPECTED((buffer.uniChar = (RKL_STRONG_REF UniChar * RKL_GC_VOLATILE)rkl_realloc((RKL_STRONG_REF void ** RKL_GC_VOLATILE)&buffer.uniChar, ((size_t)buffer.length * sizeof(UniChar)), 0UL)) == NULL, 0L)) { goto errorExit; } // Resize the buffer.
- needToFreeBufferUniChar = rkl_collectingEnabled() ? 0U : 1U;
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunreachable-code"
+ needToFreeBufferUniChar = rkl_collectingEnabled() ? 0U : 1U;
+#pragma clang diagnostic pop
CFStringGetCharacters(buffer.string, CFMakeRange(0L, buffer.length), (UniChar *)buffer.uniChar); // Convert to a UTF16 string.
}
@@ -44,6 +44,7 @@
#import "NSColor+iTerm.h"
#import "NSData+iTerm.h"
#import "NSDictionary+iTerm.h"
+#import "NSFont+iTerm.h"
#import "NSImage+iTerm.h"
#import "NSPasteboard+iTerm.h"
#import "NSStringITerm.h"
@@ -3920,8 +3921,8 @@ - (void)changeFontSizeDirection:(int)dir {
// Move this bookmark into the sessions model.
NSString* guid = [self divorceAddressBookEntryFromPreferences];
- [self setSessionSpecificProfileValues:@{ KEY_NORMAL_FONT: [ITAddressBookMgr descFromFont:font],
- KEY_NON_ASCII_FONT: [ITAddressBookMgr descFromFont:nonAsciiFont] }];
+ [self setSessionSpecificProfileValues:@{ KEY_NORMAL_FONT: [font stringValue],
+ KEY_NON_ASCII_FONT: [nonAsciiFont stringValue] }];
// Set the font in the bookmark dictionary
// Update the model's copy of the bookmark.
View
@@ -11,6 +11,7 @@
#import "iTermProfilePreferences.h"
#import "MovePaneController.h"
#import "NSColor+iTerm.h"
+#import "NSFont+iTerm.h"
#import "NSView+iTerm.h"
#import "NSView+RecursiveDescription.h"
#import "NSWindow+PSM.h"
@@ -2797,10 +2798,10 @@ + (void)setTmuxFont:(NSFont *)font
nonAsciiFont:(NSFont *)nonAsciiFont
hSpacing:(double)hs
vSpacing:(double)vs {
- [[ProfileModel sharedInstance] setObject:[ITAddressBookMgr descFromFont:font]
+ [[ProfileModel sharedInstance] setObject:[font stringValue]
forKey:KEY_NORMAL_FONT
inBookmark:[PTYTab tmuxBookmark]];
- [[ProfileModel sharedInstance] setObject:[ITAddressBookMgr descFromFont:nonAsciiFont]
+ [[ProfileModel sharedInstance] setObject:[nonAsciiFont stringValue]
forKey:KEY_NON_ASCII_FONT
inBookmark:[PTYTab tmuxBookmark]];
[[ProfileModel sharedInstance] setObject:[NSNumber numberWithDouble:hs]
@@ -140,5 +140,6 @@ extern NSString *const kTmuxControllerSessionWasRenamed;
- (void)toggleZoomForPane:(int)pane;
- (void)setPartialWindowIdOrder:(NSArray *)partialOrder;
- (void)setCurrentWindow:(int)windowId;
+- (void)checkForUTF8;
@end
@@ -1041,10 +1041,13 @@ - (void)selectFont:(NSFont *)font inContext:(CGContextRef)ctx {
// This method is really slow so avoid doing it when it's not
// necessary. It is also deprecated but CoreText is extremely slow so
// we'll keep using until Apple fixes that.
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
CGContextSelectFont(ctx,
[[font fontName] UTF8String],
[font pointSize],
kCGEncodingMacRoman);
+#pragma clang diagnostic pop
[_selectedFont release];
_selectedFont = [font retain];
}

0 comments on commit 719fef1

Please sign in to comment.