Skip to content

Commit

Permalink
Fix compilation warnings #trivial (TextureGroup#1132)
Browse files Browse the repository at this point in the history
* Apply recommended warnings

* Squelch designated initializer warning in ASViewController

* Remove unused compiler flag

clang: warning: argument unused during compilation: '-fno-objc-arc-exceptions' [-Wunused-command-line-argument]

* Fix warning about overriding an instance variable within a category

Instance method 'methodOverrides' in category from _ASDisplayView.o overrides method from class in ASDisplayNode.o
  • Loading branch information
ejensen authored and mikezucc committed Oct 2, 2018
1 parent 70da8ea commit 87ec9e1
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 21 deletions.
14 changes: 10 additions & 4 deletions AsyncDisplayKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2128,7 +2128,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = AS;
LastUpgradeCheck = 0820;
LastUpgradeCheck = 0940;
ORGANIZATIONNAME = Pinterest;
TargetAttributes = {
057D02BE1AC0A66700C7AC3C = {
Expand Down Expand Up @@ -2586,6 +2586,7 @@
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
Expand Down Expand Up @@ -2618,7 +2619,9 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
ONLY_ACTIVE_ARCH = YES;
Expand All @@ -2640,6 +2643,7 @@
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
Expand All @@ -2662,7 +2666,9 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -2741,7 +2747,6 @@
OTHER_CFLAGS = (
"-Wundef",
"-fno-exceptions",
"-fno-objc-arc-exceptions",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = AsyncDisplayKit;
Expand Down Expand Up @@ -2774,7 +2779,6 @@
OTHER_CFLAGS = (
"-Wundef",
"-fno-exceptions",
"-fno-objc-arc-exceptions",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = AsyncDisplayKit;
Expand All @@ -2797,6 +2801,7 @@
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
Expand All @@ -2819,7 +2824,9 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNKNOWN_PRAGMAS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_LABEL = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -2892,7 +2899,6 @@
OTHER_CFLAGS = (
"-Wundef",
"-fno-exceptions",
"-fno-objc-arc-exceptions",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = AsyncDisplayKit;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0940"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
5 changes: 5 additions & 0 deletions Source/ASDisplayNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,11 @@ - (void)setLayerBlock:(ASDisplayNodeLayerBlock)layerBlock
setFlag(Synchronous, YES);
}

- (ASDisplayNodeMethodOverrides)methodOverrides
{
return _methodOverrides;
}

- (void)onDidLoad:(ASDisplayNodeDidLoadBlock)body
{
ASDN::MutexLocker l(__instanceLock__);
Expand Down
5 changes: 5 additions & 0 deletions Source/ASViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ @implementation ASViewController
UIEdgeInsets _fallbackAdditionalSafeAreaInsets;
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-designated-initializers"

- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
if (!(self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
Expand All @@ -49,6 +52,8 @@ - (instancetype)initWithCoder:(NSCoder *)aDecoder
return self;
}

#pragma clang diagnostic pop

- (instancetype)initWithNode:(ASDisplayNode *)node
{
if (!(self = [super initWithNibName:nil bundle:nil])) {
Expand Down
14 changes: 0 additions & 14 deletions Source/Details/_ASDisplayView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,6 @@
#import <AsyncDisplayKit/ASObjectDescriptionHelpers.h>
#import <AsyncDisplayKit/ASViewController.h>

#pragma mark - ASDisplayNode

/**
* Open access to the method overrides struct for ASDisplayView
*/
@implementation ASDisplayNode (ASDisplayNodeMethodOverrides_ASDisplayView)

- (ASDisplayNodeMethodOverrides)methodOverrides
{
return _methodOverrides;
}

@end

#pragma mark - _ASDisplayViewMethodOverrides

typedef NS_OPTIONS(NSUInteger, _ASDisplayViewMethodOverrides)
Expand Down
2 changes: 1 addition & 1 deletion Source/Private/ASDisplayNodeInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ AS_EXTERN NSString * const ASRenderingEngineDidDisplayNodesScheduledBeforeTimest
@property (nullable, nonatomic, readonly) _ASDisplayLayer *asyncLayer;

/// Bitmask to check which methods an object overrides.
@property (nonatomic, readonly) ASDisplayNodeMethodOverrides methodOverrides;
- (ASDisplayNodeMethodOverrides)methodOverrides;

/**
* Invoked before a call to setNeedsLayout to the underlying view
Expand Down
2 changes: 1 addition & 1 deletion Texture.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |spec|

# Subspecs
spec.subspec 'Core' do |core|
core.compiler_flags = '-fno-exceptions -fno-objc-arc-exceptions'
core.compiler_flags = '-fno-exceptions'
core.public_header_files = [
'Source/*.h',
'Source/Details/**/*.h',
Expand Down

0 comments on commit 87ec9e1

Please sign in to comment.