Skip to content

Commit 12ca4d3

Browse files
authored
Fixed Xcode 9 compiler warnings. (#649)
1 parent dd97317 commit 12ca4d3

File tree

13 files changed

+35
-23
lines changed

13 files changed

+35
-23
lines changed

Branch-SDK/Branch-SDK/BNCDebug.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ extern "C" {
6161

6262

6363
///@return Returns true if the app is currently attached to a debugger.
64-
extern BOOL BNCDebuggerIsAttached();
64+
extern BOOL BNCDebuggerIsAttached(void);
6565

6666

6767
///@param object An obj-c instance, class, or meta-class.
@@ -71,7 +71,7 @@ extern NSString* _Nonnull BNCDebugStringFromObject(id _Nullable object);
7171

7272

7373
///@return Returns the names of all loaded classes as an array of NSStrings.
74-
extern NSArray<NSString*> * _Nonnull BNCDebugArrayOfReqisteredClasses();
74+
extern NSArray<NSString*> * _Nonnull BNCDebugArrayOfReqisteredClasses(void);
7575

7676

7777
///@return Returns an NSString indicating the name of the enclosing method.

Branch-SDK/Branch-SDK/BNCDeviceInfo.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ + (NSString*) systemBuildVersion {
116116
+ (NSString*) userAgentString {
117117

118118
static NSString* browserUserAgentString = nil;
119-
void (^setBrowserUserAgent)() = ^() {
119+
void (^setBrowserUserAgent)(void) = ^() {
120120
if (!browserUserAgentString) {
121121
browserUserAgentString =
122122
[[[UIWebView alloc]

Branch-SDK/Branch-SDK/BNCLog.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ typedef NS_ENUM(NSInteger, BNCLogLevel) {
4444
/*!
4545
* @return Returns the current log severity display level.
4646
*/
47-
extern BNCLogLevel BNCLogDisplayLevel();
47+
extern BNCLogLevel BNCLogDisplayLevel(void);
4848

4949
/*!
5050
* @param level Sets the current display level for log messages.
@@ -67,14 +67,14 @@ extern void BNCLogSetSynchronizeMessages(BOOL enable);
6767

6868
/*!@return Returns YES if log messages are synchronized between threads.
6969
*/
70-
extern BOOL BNCLogSynchronizeMessages();
70+
extern BOOL BNCLogSynchronizeMessages(void);
7171

7272

7373
#pragma mark - Programmatic Breakpoints
7474

7575

7676
///@return Returns 'YES' if programmatic breakpoints are enabled.
77-
extern BOOL BNCLogBreakPointsAreEnabled();
77+
extern BOOL BNCLogBreakPointsAreEnabled(void);
7878

7979
///@param enabled Sets programmatic breakpoints enabled or disabled.
8080
extern void BNCLogSetBreakPointsEnabled(BOOL enabled);
@@ -96,10 +96,10 @@ extern void BNCLogFunctionOutputToStdErr(NSDate*_Nonnull timestamp, BNCLogLevel
9696
extern void BNCLogSetOutputFunction(BNCLogOutputFunctionPtr _Nullable functionPtr);
9797

9898
///@return Returns the current logging function.
99-
extern BNCLogOutputFunctionPtr _Nullable BNCLogOutputFunction();
99+
extern BNCLogOutputFunctionPtr _Nullable BNCLogOutputFunction(void);
100100

101101
/// If a predefined log handler is being used, the function closes the output file.
102-
extern void BNCLogCloseLogFile();
102+
extern void BNCLogCloseLogFile(void);
103103

104104
///@param URL Sets the log output function to a function that writes messages to the file at URL.
105105
extern void BNCLogSetOutputToURL(NSURL *_Nullable URL);
@@ -112,15 +112,15 @@ extern void BNCLogSetOutputToURLRecordWrap(NSURL *_Nullable URL, long maxRecords
112112
///@param maxBytes Wraps the file at `maxBytes` bytes. Must be an even number of bytes.
113113
extern void BNCLogSetOutputToURLByteWrap(NSURL *_Nullable URL, long maxBytes);
114114

115-
typedef void (*BNCLogFlushFunctionPtr)();
115+
typedef void (*BNCLogFlushFunctionPtr)(void);
116116

117117
///@param flushFunction The logging functions use `flushFunction` to flush the outstanding log
118118
/// messages to the output function. For instance, this function may call
119119
/// `fsync` to assure that the log messages are written to disk.
120120
extern void BNCLogSetFlushFunction(BNCLogFlushFunctionPtr _Nullable flushFunction);
121121

122122
///@return Returns the current flush function.
123-
extern BNCLogFlushFunctionPtr _Nullable BNCLogFlushFunction();
123+
extern BNCLogFlushFunctionPtr _Nullable BNCLogFlushFunction(void);
124124

125125

126126
#pragma mark - BNCLogWriteMessage
@@ -145,7 +145,7 @@ extern void BNCLogWriteMessage(
145145

146146
/// This function synchronizes all outstanding log messages and writes them to the logging function
147147
/// set by BNCLogSetOutputFunction.
148-
extern void BNCLogFlushMessages();
148+
extern void BNCLogFlushMessages(void);
149149

150150

151151
#pragma mark - Logging

Branch-SDK/Branch-SDK/BNCLog.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,8 @@ void BNCLogFlushMessages() {
583583

584584
#pragma mark - BNCLogInitialize
585585

586-
void BNCLogInitialize() __attribute__((constructor));
587-
void BNCLogInitialize() {
586+
void BNCLogInitialize(void) __attribute__((constructor));
587+
void BNCLogInitialize(void) {
588588
static dispatch_once_t onceToken = 0;
589589
dispatch_once(&onceToken, ^ {
590590
bnc_LogQueue = dispatch_queue_create("io.branch.log", DISPATCH_QUEUE_SERIAL);

Branch-SDK/Branch-SDK/BNCPreferenceHelper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define FILE_NAME [[NSString stringWithUTF8String:__FILE__] lastPathComponent]
1212
#define LINE_NUM __LINE__
1313

14-
NSURL* /* _Nonnull */ BNCURLForBranchDirectory();
14+
NSURL* /* _Nonnull */ BNCURLForBranchDirectory(void);
1515

1616
@interface BNCPreferenceHelper : NSObject
1717

Branch-SDK/Branch-SDK/Branch.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@
7373

7474
#pragma mark - Load Categories
7575

76-
void ForceCategoriesToLoad();
77-
void ForceCategoriesToLoad() {
76+
void ForceCategoriesToLoad(void);
77+
void ForceCategoriesToLoad(void) {
7878
ForceNSMutableDictionaryToLoad();
7979
}
8080

Branch-SDK/Branch-SDK/NSMutableDictionary+Branch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#import <Foundation/Foundation.h>
1111

1212

13-
void ForceNSMutableDictionaryToLoad();
13+
void ForceNSMutableDictionaryToLoad(void);
1414

1515

1616
@interface NSMutableDictionary (Branch)

Branch-SDK/Branch-SDK/NSMutableDictionary+Branch.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ - (void) bnc_safeAddEntriesFromDictionary:(NSDictionary<id<NSCopying>,id> *)othe
3131
@end
3232

3333

34-
void ForceNSMutableDictionaryToLoad() {
34+
void ForceNSMutableDictionaryToLoad(void) {
3535
// Does nothing. But will force the linker to include this category.
3636
}

Branch-SDK/Branch-SDK/NSString+Branch.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#import "NSString+Branch.h"
1717

1818

19-
void BNCForceNSStringCategoryToLoad() __attribute__((constructor));
19+
void BNCForceNSStringCategoryToLoad(void) __attribute__((constructor));
2020
void BNCForceNSStringCategoryToLoad() {
2121
// Nothing here, but forces linker to load the category.
2222
}

Branch-TestBed/Branch-TestBed.xcodeproj/project.pbxproj

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@
753753
670016581940F51400A9E103 /* Project object */ = {
754754
isa = PBXProject;
755755
attributes = {
756-
LastUpgradeCheck = 0830;
756+
LastUpgradeCheck = 0900;
757757
ORGANIZATIONNAME = "Branch Metrics";
758758
TargetAttributes = {
759759
466B58371B17773000A69EDE = {
@@ -1049,14 +1049,20 @@
10491049
CLANG_CXX_LIBRARY = "libc++";
10501050
CLANG_ENABLE_MODULES = NO;
10511051
CLANG_ENABLE_OBJC_ARC = YES;
1052+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
10521053
CLANG_WARN_BOOL_CONVERSION = YES;
1054+
CLANG_WARN_COMMA = YES;
10531055
CLANG_WARN_CONSTANT_CONVERSION = YES;
10541056
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
10551057
CLANG_WARN_EMPTY_BODY = YES;
10561058
CLANG_WARN_ENUM_CONVERSION = YES;
10571059
CLANG_WARN_INFINITE_RECURSION = YES;
10581060
CLANG_WARN_INT_CONVERSION = YES;
1061+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
1062+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
10591063
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
1064+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
1065+
CLANG_WARN_STRICT_PROTOTYPES = YES;
10601066
CLANG_WARN_SUSPICIOUS_MOVE = YES;
10611067
CLANG_WARN_UNREACHABLE_CODE = YES;
10621068
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -1094,14 +1100,20 @@
10941100
CLANG_CXX_LIBRARY = "libc++";
10951101
CLANG_ENABLE_MODULES = NO;
10961102
CLANG_ENABLE_OBJC_ARC = YES;
1103+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
10971104
CLANG_WARN_BOOL_CONVERSION = YES;
1105+
CLANG_WARN_COMMA = YES;
10981106
CLANG_WARN_CONSTANT_CONVERSION = YES;
10991107
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
11001108
CLANG_WARN_EMPTY_BODY = YES;
11011109
CLANG_WARN_ENUM_CONVERSION = YES;
11021110
CLANG_WARN_INFINITE_RECURSION = YES;
11031111
CLANG_WARN_INT_CONVERSION = YES;
1112+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
1113+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
11041114
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
1115+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
1116+
CLANG_WARN_STRICT_PROTOTYPES = YES;
11051117
CLANG_WARN_SUSPICIOUS_MOVE = YES;
11061118
CLANG_WARN_UNREACHABLE_CODE = YES;
11071119
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;

0 commit comments

Comments
 (0)