Browse Source

Fix or silence various warnings

warnings
Tanner Bennett 4 years ago
parent
commit
0e85162c11

+ 1 - 1
Classes/GlobalStateExplorers/RuntimeBrowser/FLEXKBToolbarButton.h

@@ -23,7 +23,7 @@ typedef void (^FLEXKBToolbarAction)(NSString *buttonTitle, BOOL isSuggestion);
 /// Adds the event handler for the button.
 ///
 /// @param eventHandler The event handler block.
-/// @param controlEvent The type of event.
+/// @param controlEvents The type of event.
 - (void)addEventHandler:(FLEXKBToolbarAction)eventHandler forControlEvents:(UIControlEvents)controlEvents;
 
 @end

+ 4 - 2
Classes/ObjectExplorers/FLEXObjectExplorer.m

@@ -153,13 +153,15 @@
     
     _classHierarchy = [FLEXStaticMetadata classHierarchy:self.classHierarchyClasses];
     
+    NSArray<NSArray<FLEXProperty *> *> *properties = _allProperties;
+    
     // Potentially filter property-backing ivars
     if (hideBackingIvars) {
         NSArray<NSArray<FLEXIvar *> *> *ivars = _allIvars.copy;
         _allIvars = [ivars flex_mapped:^id(NSArray<FLEXIvar *> *list, NSUInteger idx) {
             // Get a set of all backing ivar names for the current class in the hierarchy
             NSSet *ivarNames = [NSSet setWithArray:({
-                [_allProperties[idx] flex_mapped:^id(FLEXProperty *p, NSUInteger idx) {
+                [properties[idx] flex_mapped:^id(FLEXProperty *p, NSUInteger idx) {
                     // Nil if no ivar, and array is flatted
                     return p.attributes.backingIvar;
                 }];
@@ -178,7 +180,7 @@
         _allMethods = [methods flex_mapped:^id(NSArray<FLEXMethod *> *list, NSUInteger idx) {
             // Get a set of all property method names for the current class in the hierarchy
             NSSet *methodNames = [NSSet setWithArray:({
-                [_allProperties[idx] flex_flatmapped:^NSArray *(FLEXProperty *p, NSUInteger idx) {
+                [properties[idx] flex_flatmapped:^NSArray *(FLEXProperty *p, NSUInteger idx) {
                     if (p.likelyGetterExists) {
                         if (p.likelySetterExists) {
                             return @[p.likelyGetterString, p.likelySetterString];

+ 1 - 1
Classes/Utility/Categories/NSTimer+Blocks.h

@@ -7,7 +7,7 @@
 
 #import <Foundation/Foundation.h>
 
-typedef void (^VoidBlock)();
+typedef void (^VoidBlock)(void);
 @interface NSTimer (Blocks)
 
 + (instancetype)fireSecondsFromNow:(NSTimeInterval)delay block:(VoidBlock)block;

+ 1 - 1
Classes/Utility/Categories/NSTimer+Blocks.m

@@ -16,7 +16,7 @@
 
 + (instancetype)fireSecondsFromNow:(NSTimeInterval)delay block:(VoidBlock)block {
     if (@available(iOS 10, *)) {
-        return [self scheduledTimerWithTimeInterval:delay repeats:NO block:block];
+        return [self scheduledTimerWithTimeInterval:delay repeats:NO block:(id)block];
     } else {
         return [self scheduledTimerWithTimeInterval:delay target:block selector:@selector(invoke) userInfo:nil repeats:NO];
     }

+ 2 - 2
Classes/Utility/Runtime/FLEXBlockDescription.m

@@ -44,10 +44,10 @@ struct block_object {
 @implementation FLEXBlockDescription
 
 + (instancetype)describing:(id)block {
-    return [[self alloc] initWithBlock:block];
+    return [[self alloc] initWithObjcBlock:block];
 }
 
-- (id)initWithBlock:(id)block {
+- (id)initWithObjcBlock:(id)block {
     self = [super init];
     if (self) {
         _block = block;

+ 5 - 2
Classes/Utility/Runtime/FLEXTypeEncodingParser.m

@@ -52,7 +52,8 @@ static inline FLEXTypeInfo FLEXTypeInfoMakeU(ssize_t size, ssize_t align, BOOL f
 }
 
 BOOL FLEXGetSizeAndAlignment(const char *type, NSUInteger *sizep, NSUInteger *alignp) {
-    NSInteger size = 0, align = 0;
+    NSInteger size = 0;
+    ssize_t align = 0;
     size = [FLEXTypeEncodingParser sizeForTypeEncoding:@(type) alignment:&align];
     
     if (size == -1) {
@@ -137,7 +138,9 @@ BOOL FLEXGetSizeAndAlignment(const char *type, NSUInteger *sizep, NSUInteger *al
     for (NSUInteger i = 0; i < idx; i++) {
         if (![parser scanPastArg]) {
             [NSException raise:NSRangeException
-                        format:@"Index %lu out of bounds for type encoding '%@'", idx, typeEncoding];
+                format:@"Index %@ out of bounds for type encoding '%@'", 
+                @(idx), typeEncoding
+            ];
         }
     }
 

+ 2 - 2
Classes/Utility/Runtime/Objc/FLEXRuntimeSafety.h

@@ -11,8 +11,8 @@
 #pragma mark - Classes
 
 extern NSUInteger const kFLEXKnownUnsafeClassCount;
-extern const Class * FLEXKnownUnsafeClassList();
-extern NSSet * FLEXKnownUnsafeClassNames();
+extern const Class * FLEXKnownUnsafeClassList(void);
+extern NSSet * FLEXKnownUnsafeClassNames(void);
 extern CFSetRef FLEXKnownUnsafeClasses;
 
 static inline BOOL FLEXClassIsSafe(Class cls) {

+ 1 - 1
FLEX.podspec

@@ -35,6 +35,6 @@ Pod::Spec.new do |spec|
   spec.frameworks       = [ "Foundation", "UIKit", "CoreGraphics", "ImageIO", "QuartzCore", "WebKit", "Security" ]
   spec.libraries        = [ "z", "sqlite3" ]
   spec.requires_arc     = true
-  spec.compiler_flags   = "-Wno-unsupported-availability-guard"
+  spec.compiler_flags   = "-Wno-unsupported-availability-guard -Wno-strict-prototypes"
   spec.public_header_files = [ "Classes/**/FLEXManager.h", "Classes/FLEX.h" ]
 end