Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Fix warnings #118

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
43 changes: 30 additions & 13 deletions FBTweak.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@
18EFE466189EBA4900DA6A5D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
LastUpgradeCheck = 0920;
ORGANIZATIONNAME = Facebook;
};
buildConfigurationList = 18EFE469189EBA4900DA6A5D /* Build configuration list for PBXProject "FBTweak" */;
Expand Down Expand Up @@ -465,17 +465,29 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Expand All @@ -489,7 +501,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INSTALL_PATH = "$(SYMROOT)/Headers";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
PUBLIC_HEADERS_FOLDER_PATH = "../Headers/$(TARGET_NAME)";
SDKROOT = iphoneos;
Expand All @@ -505,25 +517,36 @@
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INSTALL_PATH = "$(SYMROOT)/Headers";
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
PUBLIC_HEADERS_FOLDER_PATH = "../Headers/$(TARGET_NAME)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
Expand Down Expand Up @@ -558,18 +581,15 @@
18EFE495189EBA4900DA6A5D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
FRAMEWORK_SEARCH_PATHS = "";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "FBTweak/FBTweak-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = "FBTweakTests/FBTweakTests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = xctest;
};
Expand All @@ -578,14 +598,11 @@
18EFE496189EBA4900DA6A5D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
FRAMEWORK_SEARCH_PATHS = "";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "FBTweak/FBTweak-Prefix.pch";
INFOPLIST_FILE = "FBTweakTests/FBTweakTests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = xctest;
};
Expand Down
15 changes: 10 additions & 5 deletions FBTweak.xcodeproj/xcshareddata/xcschemes/FBTweak.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0630"
LastUpgradeVersion = "0920"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -37,10 +37,11 @@
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -62,15 +63,19 @@
ReferencedContainer = "container:FBTweak.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
Expand All @@ -85,10 +90,10 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
Expand Down
4 changes: 2 additions & 2 deletions FBTweak/FBTweak.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ typedef id FBTweakValue;

/**
@abstract If this tweak is an action, with a block value.
@param If YES, {@ref currentValue} should not be set and
@discussion If YES, {@ref currentValue} should not be set and
{@ref defaultValue} is a block rather than a value object.
*/
@property (nonatomic, readonly, assign, getter = isAction) BOOL action;
Expand Down Expand Up @@ -132,7 +132,7 @@ typedef id FBTweakValue;

/**
@abstract Adds an observer to the tweak.
@param object The observer. Must not be nil.
@param observer The observer. Must not be nil.
@discussion A weak reference is taken on the observer.
*/
- (void)addObserver:(id<FBTweakObserver>)observer;
Expand Down
2 changes: 1 addition & 1 deletion FBTweak/FBTweakViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extern NSString *const FBTweakShakeViewControllerDidDismissNotification;
/**
@abstract Create a tweak view controller drilled-down to a specific category
@param store The tweak store to show. Usually +[FBTweakStore sharedInstance].
@param name The tweak category to drill down to. Use nil to show all categories
@param categoryName The tweak category to drill down to. Use nil to show all categories
@discussion The designated initializer.
*/
- (instancetype)initWithStore:(FBTweakStore *)store category:(NSString *)categoryName;
Expand Down
13 changes: 7 additions & 6 deletions FBTweak/_FBColorUtils.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ extern RGB _FBHSB2RGB(HSB hsb)
double t = hsb.brightness * (1 - (1 - f) * hsb.saturation);

switch (i % 6){
case 0: r = hsb.brightness, g = t, b = p; break;
case 1: r = q, g = hsb.brightness, b = p; break;
case 2: r = p, g = hsb.brightness, b = t; break;
case 3: r = p, g = q, b = hsb.brightness; break;
case 4: r = t, g = p, b = hsb.brightness; break;
case 5: r = hsb.brightness, g = p, b = q; break;
case 0: r = hsb.brightness; g = t; b = p; break;
case 1: r = q; g = hsb.brightness; b = p; break;
case 2: r = p; g = hsb.brightness; b = t; break;
case 3: r = p; g = q; b = hsb.brightness; break;
case 4: r = t; g = p; b = hsb.brightness; break;
case 5: r = hsb.brightness; g = p; b = q; break;
default: r = g = b = 0; break;
}

Expand All @@ -71,6 +71,7 @@ extern RGB _FBRGBColorComponents(UIColor *color)
RGB result;
CGColorSpaceModel colorSpaceModel = CGColorSpaceGetModel(CGColorGetColorSpace(color.CGColor));
if (colorSpaceModel != kCGColorSpaceModelRGB && colorSpaceModel != kCGColorSpaceModelMonochrome) {
result.red = result.green = result.blue = result.alpha = 0;
return result;
}
const CGFloat *components = CGColorGetComponents(color.CGColor);
Expand Down
2 changes: 1 addition & 1 deletion FBTweak/_FBKeyboardManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ - (void)_keyboardFrameChanged:(NSNotification *)notification
NSTimeInterval duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue];
UIViewAnimationCurve curve = [userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue];

void (^animations)() = ^{
void (^animations)(void) = ^{
UIEdgeInsets contentInset = _scrollView.contentInset;
contentInset.bottom = (contentView.bounds.size.height - CGRectGetMinY(endFrame));
_scrollView.contentInset = contentInset;
Expand Down
2 changes: 1 addition & 1 deletion FBTweak/_FBTweakCollectionViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@
*/
- (void)tweakCollectionViewControllerSelectedDone:(_FBTweakCollectionViewController *)viewController;

@end
@end
19 changes: 16 additions & 3 deletions FBTweakExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
isa = PBXProject;
attributes = {
CLASSPREFIX = FB;
LastUpgradeCheck = 0510;
LastUpgradeCheck = 0820;
ORGANIZATIONNAME = Facebook;
};
buildConfigurationList = 18EFE4E3189F02F800DA6A5D /* Build configuration list for PBXProject "FBTweakExample" */;
Expand Down Expand Up @@ -199,13 +199,19 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Expand All @@ -222,7 +228,7 @@
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
);
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -242,13 +248,18 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand All @@ -259,7 +270,7 @@
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
);
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
Expand All @@ -275,6 +286,7 @@
GCC_PREFIX_HEADER = "FBTweakExample/FBTweakExample-Prefix.pch";
INFOPLIST_FILE = "FBTweakExample/FBTweakExample-Info.plist";
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -289,6 +301,7 @@
GCC_PREFIX_HEADER = "FBTweakExample/FBTweakExample-Prefix.pch";
INFOPLIST_FILE = "FBTweakExample/FBTweakExample-Info.plist";
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand Down