Skip to content

Commit

Permalink
chore: Fix the rest of warnings (appium#438)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Dec 15, 2020
1 parent 7af7b79 commit f529938
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 22 deletions.
104 changes: 104 additions & 0 deletions WebDriverAgent.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3487,6 +3487,31 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TARGETED_DEVICE_FAMILY = 3;
WARNING_CFLAGS = (
"$(inherited)",
"-Weverything",
"-Wno-objc-missing-property-synthesis",
"-Wno-unused-macros",
"-Wno-disabled-macro-expansion",
"-Wno-gnu-statement-expression",
"-Wno-language-extension-token",
"-Wno-overriding-method-mismatch",
"-Wno-missing-variable-declarations",
"-Rno-module-build",
"-Wno-auto-import",
"-Wno-objc-interface-ivars",
"-Wno-documentation-unknown-command",
"-Wno-reserved-id-macro",
"-Wno-unused-parameter",
"-Wno-gnu-conditional-omitted-operand",
"-Wno-explicit-ownership-type",
"-Wno-date-time",
"-Wno-cast-align",
"-Wno-cstring-format-directive",
"-Wno-double-promotion",
"-Wno-partial-availability",
"-Wno-cast-qual",
);
};
name = Debug;
};
Expand Down Expand Up @@ -3517,6 +3542,31 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TARGETED_DEVICE_FAMILY = 3;
WARNING_CFLAGS = (
"$(inherited)",
"-Weverything",
"-Wno-objc-missing-property-synthesis",
"-Wno-unused-macros",
"-Wno-disabled-macro-expansion",
"-Wno-gnu-statement-expression",
"-Wno-language-extension-token",
"-Wno-overriding-method-mismatch",
"-Wno-missing-variable-declarations",
"-Rno-module-build",
"-Wno-auto-import",
"-Wno-objc-interface-ivars",
"-Wno-documentation-unknown-command",
"-Wno-reserved-id-macro",
"-Wno-unused-parameter",
"-Wno-gnu-conditional-omitted-operand",
"-Wno-explicit-ownership-type",
"-Wno-date-time",
"-Wno-cast-align",
"-Wno-cstring-format-directive",
"-Wno-double-promotion",
"-Wno-partial-availability",
"-Wno-cast-qual",
);
};
name = Release;
};
Expand Down Expand Up @@ -3575,6 +3625,7 @@
"-Wno-partial-availability",
"-Wno-objc-messaging-id",
"-Wno-direct-ivar-access",
"-Wno-cast-qual",
);
};
name = Debug;
Expand Down Expand Up @@ -3635,6 +3686,7 @@
"-Wno-partial-availability",
"-Wno-objc-messaging-id",
"-Wno-direct-ivar-access",
"-Wno-cast-qual",
);
};
name = Release;
Expand Down Expand Up @@ -3876,6 +3928,7 @@
"-Wno-partial-availability",
"-Wno-objc-messaging-id",
"-Wno-direct-ivar-access",
"-Wno-cast-qual",
);
};
name = Debug;
Expand Down Expand Up @@ -3934,6 +3987,7 @@
"-Wno-partial-availability",
"-Wno-objc-messaging-id",
"-Wno-direct-ivar-access",
"-Wno-cast-qual",
);
};
name = Release;
Expand Down Expand Up @@ -4140,6 +4194,31 @@
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.WebDriverAgentRunner;
PRODUCT_NAME = "$(TARGET_NAME)";
USES_XCTRUNNER = YES;
WARNING_CFLAGS = (
"$(inherited)",
"-Weverything",
"-Wno-objc-missing-property-synthesis",
"-Wno-unused-macros",
"-Wno-disabled-macro-expansion",
"-Wno-gnu-statement-expression",
"-Wno-language-extension-token",
"-Wno-overriding-method-mismatch",
"-Wno-missing-variable-declarations",
"-Rno-module-build",
"-Wno-auto-import",
"-Wno-objc-interface-ivars",
"-Wno-documentation-unknown-command",
"-Wno-reserved-id-macro",
"-Wno-unused-parameter",
"-Wno-gnu-conditional-omitted-operand",
"-Wno-explicit-ownership-type",
"-Wno-date-time",
"-Wno-cast-align",
"-Wno-cstring-format-directive",
"-Wno-double-promotion",
"-Wno-partial-availability",
"-Wno-cast-qual",
);
};
name = Debug;
};
Expand All @@ -4163,6 +4242,31 @@
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.WebDriverAgentRunner;
PRODUCT_NAME = "$(TARGET_NAME)";
USES_XCTRUNNER = YES;
WARNING_CFLAGS = (
"$(inherited)",
"-Weverything",
"-Wno-objc-missing-property-synthesis",
"-Wno-unused-macros",
"-Wno-disabled-macro-expansion",
"-Wno-gnu-statement-expression",
"-Wno-language-extension-token",
"-Wno-overriding-method-mismatch",
"-Wno-missing-variable-declarations",
"-Rno-module-build",
"-Wno-auto-import",
"-Wno-objc-interface-ivars",
"-Wno-documentation-unknown-command",
"-Wno-reserved-id-macro",
"-Wno-unused-parameter",
"-Wno-gnu-conditional-omitted-operand",
"-Wno-explicit-ownership-type",
"-Wno-date-time",
"-Wno-cast-align",
"-Wno-cstring-format-directive",
"-Wno-double-promotion",
"-Wno-partial-availability",
"-Wno-cast-qual",
);
};
name = Release;
};
Expand Down
17 changes: 13 additions & 4 deletions WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncSocket.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
#import <sys/un.h>
#import <unistd.h>

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"

#if ! __has_feature(objc_arc)
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
// For more information see: https://github.com/robbiehanson/CocoaAsyncSocket/wiki/ARC
Expand Down Expand Up @@ -7722,7 +7725,9 @@ + (void)unscheduleCFStreams:(GCDAsyncSocket *)asyncSocket
static void CFReadStreamCallback (CFReadStreamRef stream, CFStreamEventType type, void *pInfo)
{
GCDAsyncSocket *asyncSocket = (__bridge GCDAsyncSocket *)pInfo;


#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wswitch-enum"
switch(type)
{
case kCFStreamEventHasBytesAvailable:
Expand Down Expand Up @@ -7783,13 +7788,15 @@ static void CFReadStreamCallback (CFReadStreamRef stream, CFStreamEventType type
break;
}
}
#pragma clang diagnostic pop
}

static void CFWriteStreamCallback (CFWriteStreamRef stream, CFStreamEventType type, void *pInfo)
{
GCDAsyncSocket *asyncSocket = (__bridge GCDAsyncSocket *)pInfo;


#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wswitch-enum"
switch(type)
{
case kCFStreamEventCanAcceptBytes:
Expand Down Expand Up @@ -7850,7 +7857,7 @@ static void CFWriteStreamCallback (CFWriteStreamRef stream, CFStreamEventType ty
break;
}
}
#pragma clang diagnostic pop
}

- (BOOL)createReadAndWriteStream
Expand Down Expand Up @@ -8524,3 +8531,5 @@ + (NSData *)ZeroData
}

@end

#pragma clang diagnostic pop
14 changes: 12 additions & 2 deletions WebDriverAgentLib/Vendor/CocoaAsyncSocket/GCDAsyncUdpSocket.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#import <sys/socket.h>
#import <sys/types.h>

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"

#if 0

Expand Down Expand Up @@ -4932,7 +4934,9 @@ static void CFReadStreamCallback(CFReadStreamRef stream, CFStreamEventType type,
{
@autoreleasepool {
GCDAsyncUdpSocket *asyncUdpSocket = (__bridge GCDAsyncUdpSocket *)pInfo;


#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wswitch-enum"
switch(type)
{
case kCFStreamEventOpenCompleted:
Expand Down Expand Up @@ -4977,14 +4981,17 @@ static void CFReadStreamCallback(CFReadStreamRef stream, CFStreamEventType type,
LogCError(@"CFReadStreamCallback - UnknownType: %i", (int)type);
}
}
#pragma clang diagnostic pop
}
}

static void CFWriteStreamCallback(CFWriteStreamRef stream, CFStreamEventType type, void *pInfo)
{
@autoreleasepool {
GCDAsyncUdpSocket *asyncUdpSocket = (__bridge GCDAsyncUdpSocket *)pInfo;


#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wswitch-enum"
switch(type)
{
case kCFStreamEventOpenCompleted:
Expand Down Expand Up @@ -5029,6 +5036,7 @@ static void CFWriteStreamCallback(CFWriteStreamRef stream, CFStreamEventType typ
LogCError(@"CFWriteStreamCallback - UnknownType: %i", (int)type);
}
}
#pragma clang diagnostic pop
}
}

Expand Down Expand Up @@ -5630,3 +5638,5 @@ + (BOOL)getHost:(NSString **)hostPtr port:(uint16_t *)portPtr family:(int *)afPt
}

@end

#pragma clang diagnostic pop
2 changes: 1 addition & 1 deletion WebDriverAgentLib/Vendor/YYCache/YYDiskCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
Set `YES` to enable error logs for debug.
*/
@property BOOL errorLogsEnabled;
@property (atomic) BOOL errorLogsEnabled;

#pragma mark - Initializer
///=============================================================================
Expand Down
10 changes: 7 additions & 3 deletions WebDriverAgentLib/Vendor/YYCache/YYDiskCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#define Lock() dispatch_semaphore_wait(self->_lock, DISPATCH_TIME_FOREVER)
#define Unlock() dispatch_semaphore_signal(self->_lock)

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshadow"

static const int extended_data_key;

/// Free disk space in bytes.
Expand Down Expand Up @@ -164,7 +167,6 @@ - (void)dealloc {

- (instancetype)init {
@throw [NSException exceptionWithName:@"YYDiskCache init error" reason:@"YYDiskCache must be initialized with a path. Use 'initWithPath:' or 'initWithPath:inlineThreshold:' instead." userInfo:nil];
return [self initWithPath:@"" inlineThreshold:0];
}

- (instancetype)initWithPath:(NSString *)path {
Expand Down Expand Up @@ -241,7 +243,7 @@ - (void)containsObjectForKey:(NSString *)key withBlock:(void(^)(NSString *key, B
@try {
object = [NSKeyedUnarchiver unarchiveObjectWithData:item.value];
}
@catch (NSException *exception) {
@catch (NSException *) {
// nothing to do...
}
}
Expand Down Expand Up @@ -276,7 +278,7 @@ - (void)setObject:(id<NSCoding>)object forKey:(NSString *)key {
@try {
value = [NSKeyedArchiver archivedDataWithRootObject:object];
}
@catch (NSException *exception) {
@catch (NSException *) {
// nothing to do...
}
}
Expand Down Expand Up @@ -456,3 +458,5 @@ - (void)setErrorLogsEnabled:(BOOL)errorLogsEnabled {
}

@end

#pragma clang diagnostic pop
15 changes: 7 additions & 8 deletions WebDriverAgentLib/Vendor/YYCache/YYKVStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,6 @@ - (void)_reset {

- (instancetype)init {
@throw [NSException exceptionWithName:@"YYKVStorage init error" reason:@"Please use the designated initializer and pass the 'path' and 'type'." userInfo:nil];
return [self initWithPath:@"" type:YYKVStorageTypeFile];
}

- (instancetype)initWithPath:(NSString *)path type:(YYKVStorageType)type {
Expand Down Expand Up @@ -759,9 +758,9 @@ - (BOOL)saveItemWithKey:(NSString *)key value:(NSData *)value filename:(NSString
return YES;
} else {
if (_type != YYKVStorageTypeSQLite) {
NSString *filename = [self _dbGetFilenameWithKey:key];
if (filename) {
[self _fileDeleteWithName:filename];
NSString *fname = [self _dbGetFilenameWithKey:key];
if (fname) {
[self _fileDeleteWithName:fname];
}
}
return [self _dbSaveWithKey:key value:value fileName:nil extendedData:extendedData];
Expand All @@ -773,15 +772,15 @@ - (BOOL)removeItemForKey:(NSString *)key {
switch (_type) {
case YYKVStorageTypeSQLite: {
return [self _dbDeleteItemWithKey:key];
} break;
}
case YYKVStorageTypeFile:
case YYKVStorageTypeMixed: {
NSString *filename = [self _dbGetFilenameWithKey:key];
if (filename) {
[self _fileDeleteWithName:filename];
}
return [self _dbDeleteItemWithKey:key];
} break;
}
default: return NO;
}
}
Expand All @@ -791,15 +790,15 @@ - (BOOL)removeItemForKeys:(NSArray *)keys {
switch (_type) {
case YYKVStorageTypeSQLite: {
return [self _dbDeleteItemWithKeys:keys];
} break;
}
case YYKVStorageTypeFile:
case YYKVStorageTypeMixed: {
NSArray *filenames = [self _dbGetFilenameWithKeys:keys];
for (NSString *filename in filenames) {
[self _fileDeleteWithName:filename];
}
return [self _dbDeleteItemWithKeys:keys];
} break;
}
default: return NO;
}
}
Expand Down
Loading

0 comments on commit f529938

Please sign in to comment.