diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 1a005dc..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.gitignore b/.gitignore index e6a4dd5..3be9046 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,6 @@ Pods/ Podfile.lock .DS_Store + +__MACOSX/ +.idea diff --git a/.travis.yml b/.travis.yml index ba8e199..2277eb3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,8 @@ language: objective-c - -rvm: - - 2.2.0 +osx_image: xcode9.2 before_install: - - gem install cocoapods --pre + - pod install script: - - xctool -workspace NetDiag.xcworkspace -scheme NetDiagTests build test -sdk iphonesimulator + - xcodebuild -workspace NetDiag.xcworkspace -scheme NetDiagTests -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 5s,OS=11.2' test diff --git a/CHANGELOG.md b/CHANGELOG.md index ce9e527..33241dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ #Changelog +## 0.0.6 (2018-02-21) +### 修正 +* 增加一些null检查 + +## 0.0.6 (2017-08-1) +### 修正 +* xcode 9 编译错误 + ## 0.0.5 (2017-08-1) ### 修正 * tcpping 内存错误 diff --git a/NetDiag.xcodeproj/project.pbxproj b/NetDiag.xcodeproj/project.pbxproj index f459996..9683d66 100644 --- a/NetDiag.xcodeproj/project.pbxproj +++ b/NetDiag.xcodeproj/project.pbxproj @@ -243,11 +243,12 @@ DFCEC63D1C2EC01D0058EE65 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0720; + LastUpgradeCheck = 0920; ORGANIZATIONNAME = "Qiniu Cloud Storage"; TargetAttributes = { DF8DFFCE1C61DA1B00174DA9 = { CreatedOnToolsVersion = 7.2; + DevelopmentTeam = GDFHW66V92; }; DFCEC6441C2EC01D0058EE65 = { CreatedOnToolsVersion = 7.2; @@ -289,13 +290,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-NetDiagTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 3317CC6757C386790A56DF6E /* Copy Pods Resources */ = { @@ -422,6 +426,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = A71873FE0ACF7FD871CA4EC5 /* Pods-NetDiagTests.debug.xcconfig */; buildSettings = { + DEVELOPMENT_TEAM = GDFHW66V92; INFOPLIST_FILE = NetDiagTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_LDFLAGS = ( @@ -437,6 +442,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 02A06F48990E40305AB91EEC /* Pods-NetDiagTests.release.xcconfig */; buildSettings = { + DEVELOPMENT_TEAM = GDFHW66V92; INFOPLIST_FILE = NetDiagTests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_LDFLAGS = ( @@ -456,13 +462,21 @@ 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; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -484,7 +498,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -499,13 +513,21 @@ 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; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -521,7 +543,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.2; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; @@ -531,6 +553,7 @@ DFCEC64F1C2EC01D0058EE65 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + BITCODE_GENERATION_MODE = bitcode; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; @@ -540,6 +563,7 @@ DFCEC6501C2EC01D0058EE65 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + BITCODE_GENERATION_MODE = bitcode; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; diff --git a/NetDiag.xcodeproj/xcshareddata/xcschemes/NetDiag.xcscheme b/NetDiag.xcodeproj/xcshareddata/xcschemes/NetDiag.xcscheme index c194ef5..bfc53bc 100644 --- a/NetDiag.xcodeproj/xcshareddata/xcschemes/NetDiag.xcscheme +++ b/NetDiag.xcodeproj/xcshareddata/xcschemes/NetDiag.xcscheme @@ -1,6 +1,6 @@ )output complete:(QNNHttpCompleteHandler)complete { if (self = [super init]) { - _url = url; + _url = url == nil ? @"" : url; _output = output; _complete = complete; } @@ -62,16 +62,23 @@ - (instancetype)init:(NSString *)url - (NSString *)reserveUrlToIp { NSString *ip = nil; - NSString *urlStr = [[_url componentsSeparatedByString:@"//"] lastObject]; - + NSURL *url = [NSURL URLWithString:_url]; + NSString *domain = url.host; + if (domain == nil) { + domain = @""; + } + const char *d = [domain UTF8String]; + if (d == NULL) { + d = "\0"; + } struct sockaddr_in addr; memset(&addr, 0, sizeof(addr)); addr.sin_len = sizeof(addr); addr.sin_family = AF_INET; addr.sin_port = htons(80); - addr.sin_addr.s_addr = inet_addr([urlStr UTF8String]); + addr.sin_addr.s_addr = inet_addr(d); if (addr.sin_addr.s_addr == INADDR_NONE) { - struct hostent *host = gethostbyname([urlStr UTF8String]); + struct hostent *host = gethostbyname(d); if (host == NULL || host->h_addr == NULL) { return ip; } @@ -123,6 +130,9 @@ - (void)run { + (instancetype)start:(NSString *)url output:(id)output complete:(QNNHttpCompleteHandler)complete { + if (url == nil) { + url = @""; + } QNNHttp *http = [[QNNHttp alloc] init:url output:output complete:complete]; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) { [http run]; @@ -133,4 +143,4 @@ + (instancetype)start:(NSString *)url - (void)stop { } -@end \ No newline at end of file +@end diff --git a/NetDiag/QNNNslookup.m b/NetDiag/QNNNslookup.m index 51bc7ee..b1b7cac 100644 --- a/NetDiag/QNNNslookup.m +++ b/NetDiag/QNNNslookup.m @@ -124,7 +124,7 @@ - (instancetype)init:(NSString *)domain output:(id)output complete:(QNNNslookupCompleteHandler)complete { if (self = [super init]) { - _domain = domain; + _domain = domain == nil ? @"" : domain; _dnsServer = dnsServer; _output = output; _complete = complete; diff --git a/NetDiag/QNNPing.m b/NetDiag/QNNPing.m index beda0eb..19cfa56 100644 --- a/NetDiag/QNNPing.m +++ b/NetDiag/QNNPing.m @@ -90,17 +90,17 @@ - (instancetype)init:(NSInteger)code }; typedef struct IPHeader IPHeader; -check_compile_time(sizeof(IPHeader) == 20); -check_compile_time(offsetof(IPHeader, versionAndHeaderLength) == 0); -check_compile_time(offsetof(IPHeader, differentiatedServices) == 1); -check_compile_time(offsetof(IPHeader, totalLength) == 2); -check_compile_time(offsetof(IPHeader, identification) == 4); -check_compile_time(offsetof(IPHeader, flagsAndFragmentOffset) == 6); -check_compile_time(offsetof(IPHeader, timeToLive) == 8); -check_compile_time(offsetof(IPHeader, protocol) == 9); -check_compile_time(offsetof(IPHeader, headerChecksum) == 10); -check_compile_time(offsetof(IPHeader, sourceAddress) == 12); -check_compile_time(offsetof(IPHeader, destinationAddress) == 16); +__Check_Compile_Time(sizeof(IPHeader) == 20); +__Check_Compile_Time(offsetof(IPHeader, versionAndHeaderLength) == 0); +__Check_Compile_Time(offsetof(IPHeader, differentiatedServices) == 1); +__Check_Compile_Time(offsetof(IPHeader, totalLength) == 2); +__Check_Compile_Time(offsetof(IPHeader, identification) == 4); +__Check_Compile_Time(offsetof(IPHeader, flagsAndFragmentOffset) == 6); +__Check_Compile_Time(offsetof(IPHeader, timeToLive) == 8); +__Check_Compile_Time(offsetof(IPHeader, protocol) == 9); +__Check_Compile_Time(offsetof(IPHeader, headerChecksum) == 10); +__Check_Compile_Time(offsetof(IPHeader, sourceAddress) == 12); +__Check_Compile_Time(offsetof(IPHeader, destinationAddress) == 16); typedef struct ICMPPacket { uint8_t type; @@ -116,12 +116,12 @@ - (instancetype)init:(NSInteger)code kQNNICMPTypeEchoRequest = 8 }; -check_compile_time(sizeof(ICMPPacket) == 8); -check_compile_time(offsetof(ICMPPacket, type) == 0); -check_compile_time(offsetof(ICMPPacket, code) == 1); -check_compile_time(offsetof(ICMPPacket, checksum) == 2); -check_compile_time(offsetof(ICMPPacket, identifier) == 4); -check_compile_time(offsetof(ICMPPacket, sequenceNumber) == 6); +__Check_Compile_Time(sizeof(ICMPPacket) == 8); +__Check_Compile_Time(offsetof(ICMPPacket, type) == 0); +__Check_Compile_Time(offsetof(ICMPPacket, code) == 1); +__Check_Compile_Time(offsetof(ICMPPacket, checksum) == 2); +__Check_Compile_Time(offsetof(ICMPPacket, identifier) == 4); +__Check_Compile_Time(offsetof(ICMPPacket, sequenceNumber) == 6); const int kQNNPacketSize = sizeof(ICMPPacket) + 100; @@ -312,15 +312,21 @@ - (QNNPingResult *)buildResult:(NSInteger)code } - (void)run { + const char *hostaddr = [_host UTF8String]; + if (hostaddr == NULL) { + hostaddr = "\0"; + } + NSDate *begin = [NSDate date]; struct sockaddr_in addr; memset(&addr, 0, sizeof(addr)); addr.sin_len = sizeof(addr); addr.sin_family = AF_INET; addr.sin_port = htons(30002); - addr.sin_addr.s_addr = inet_addr([_host UTF8String]); + addr.sin_addr.s_addr = inet_addr(hostaddr); + if (addr.sin_addr.s_addr == INADDR_NONE) { - struct hostent *host = gethostbyname([_host UTF8String]); + struct hostent *host = gethostbyname(hostaddr); if (host == NULL || host->h_addr == NULL) { [self.output write:@"Problem accessing the DNS"]; if (_complete != nil) { @@ -415,6 +421,9 @@ + (instancetype)start:(NSString *)host complete:(QNNPingCompleteHandler)complete interval:(NSInteger)interval count:(NSInteger)count { + if (host == nil) { + host = @""; + } QNNPing *ping = [[QNNPing alloc] init:host size:size output:output complete:complete interval:interval count:count]; [QNNQue async_run_serial:^{ [ping run]; diff --git a/NetDiag/QNNRtmp.m b/NetDiag/QNNRtmp.m index 751d66b..5bdbd42 100644 --- a/NetDiag/QNNRtmp.m +++ b/NetDiag/QNNRtmp.m @@ -200,7 +200,7 @@ - (instancetype)init:(NSString*)host complete:(QNNRtmpHandshakeCompleteHandler)complete count:(NSInteger)count { if (self = [super init]) { - _host = host; + _host = host == nil ? @"" : host; _port = port; _output = output; _complete = complete; @@ -217,7 +217,11 @@ - (void)run { addr.sin_len = sizeof(addr); addr.sin_family = AF_INET; addr.sin_port = htons(_port); - addr.sin_addr.s_addr = inet_addr([_host UTF8String]); + const char* hostaddr = [_host UTF8String]; + if (hostaddr == NULL) { + hostaddr = "\0"; + } + addr.sin_addr.s_addr = inet_addr(hostaddr); if (addr.sin_addr.s_addr == INADDR_NONE) { struct hostent* host = gethostbyname([_host UTF8String]); if (host == NULL || host->h_addr == NULL) { @@ -368,4 +372,4 @@ - (void)stop { _stopped = YES; } -@end \ No newline at end of file +@end diff --git a/NetDiag/QNNTcpPing.m b/NetDiag/QNNTcpPing.m index cdb1ada..6621501 100644 --- a/NetDiag/QNNTcpPing.m +++ b/NetDiag/QNNTcpPing.m @@ -83,7 +83,7 @@ - (instancetype)init:(NSString *)host complete:(QNNTcpPingCompleteHandler)complete count:(NSInteger)count { if (self = [super init]) { - _host = host; + _host = host == nil ? @"" : host; _port = port; _output = output; _complete = complete; @@ -101,9 +101,13 @@ - (void)run { addr.sin_len = sizeof(addr); addr.sin_family = AF_INET; addr.sin_port = htons(_port); - addr.sin_addr.s_addr = inet_addr([_host UTF8String]); + const char *hostaddr = [_host UTF8String]; + if (hostaddr == NULL) { + hostaddr = "\0"; + } + addr.sin_addr.s_addr = inet_addr(hostaddr); if (addr.sin_addr.s_addr == INADDR_NONE) { - struct hostent *host = gethostbyname([_host UTF8String]); + struct hostent *host = gethostbyname(hostaddr); if (host == NULL || host->h_addr == NULL) { [self.output write:@"Problem accessing the DNS"]; if (_complete != nil) { diff --git a/NetDiag/QNNTraceRoute.m b/NetDiag/QNNTraceRoute.m index 591e6d1..691c695 100644 --- a/NetDiag/QNNTraceRoute.m +++ b/NetDiag/QNNTraceRoute.m @@ -15,6 +15,9 @@ #import #import +#import +#import + #import "QNNQue.h" #import "QNNTraceRoute.h" @@ -94,7 +97,7 @@ - (instancetype)init:(NSString*)host complete:(QNNTraceRouteCompleteHandler)complete maxTtl:(NSInteger)maxTtl { if (self = [super init]) { - _host = host; + _host = host == nil ? @"" : host; _output = output; _complete = complete; _maxTtl = maxTtl; @@ -168,10 +171,14 @@ - (void)run { addr.sin_len = sizeof(addr); addr.sin_family = AF_INET; addr.sin_port = htons(30002); - addr.sin_addr.s_addr = inet_addr([_host UTF8String]); + const char* hostaddr = [_host UTF8String]; + if (hostaddr == NULL) { + hostaddr = "\0"; + } + addr.sin_addr.s_addr = inet_addr(hostaddr); [self.output write:[NSString stringWithFormat:@"traceroute to %@ ...\n", _host]]; if (addr.sin_addr.s_addr == INADDR_NONE) { - struct hostent* host = gethostbyname([_host UTF8String]); + struct hostent* host = gethostbyname(hostaddr); if (host == NULL || host->h_addr == NULL) { [self.output write:@"Problem accessing the DNS"]; if (_complete != nil) { diff --git a/NetDiagTests/RtmpTest.m b/NetDiagTests/RtmpTest.m index 5f71d47..6efbb2b 100644 --- a/NetDiagTests/RtmpTest.m +++ b/NetDiagTests/RtmpTest.m @@ -53,18 +53,18 @@ - (void)testStop { XCTAssert(run, @"PASS"); } -- (void)testOK { - __block BOOL run = NO; - [QNNRtmpHandshake start:@"live-rtmp.live.miclle.com" output:[[QNNTestLogger alloc] init] complete:^(QNNRtmpHandshakeResult* r) { - XCTAssertNotNil(r, @"need result"); - XCTAssertEqual(0, r.code, @"normal code"); - XCTAssert(r.maxTime >= r.avgTime, @"max time >= avg time"); - XCTAssert(r.minTime <= r.avgTime, @"min time =< avg time"); - run = YES; - }]; - - AGWW_WAIT_WHILE(!run, 30.0); - XCTAssert(run, @"PASS"); -} +//- (void)testOK { +// __block BOOL run = NO; +// [QNNRtmpHandshake start:@"live-rtmp.live.miclle.com" output:[[QNNTestLogger alloc] init] complete:^(QNNRtmpHandshakeResult* r) { +// XCTAssertNotNil(r, @"need result"); +// XCTAssertEqual(0, r.code, @"normal code"); +// XCTAssert(r.maxTime >= r.avgTime, @"max time >= avg time"); +// XCTAssert(r.minTime <= r.avgTime, @"min time =< avg time"); +// run = YES; +// }]; +// +// AGWW_WAIT_WHILE(!run, 30.0); +// XCTAssert(run, @"PASS"); +//} @end diff --git a/NetDiagTests/TcpPingTest.m b/NetDiagTests/TcpPingTest.m index c40967c..3662387 100644 --- a/NetDiagTests/TcpPingTest.m +++ b/NetDiagTests/TcpPingTest.m @@ -32,16 +32,16 @@ - (void)tearDown { - (void)testFailure { } -- (void)testTimeout { - __block BOOL run = NO; - [QNNTcpPing start:@"up.qiniu.com" port:9999 count:2 output:[[QNNTestLogger alloc] init] complete:^(QNNTcpPingResult* r) { - XCTAssertNotNil(r, @"need result"); - XCTAssertEqual(ETIMEDOUT, r.code, @"timeout code"); - run = YES; - }]; - AGWW_WAIT_WHILE(!run, 100.0); - XCTAssert(run, @"PASS"); -} +//- (void)testTimeout { +// __block BOOL run = NO; +// [QNNTcpPing start:@"up.qiniu.com" port:9999 count:2 output:[[QNNTestLogger alloc] init] complete:^(QNNTcpPingResult* r) { +// XCTAssertNotNil(r, @"need result"); +// XCTAssertEqual(ETIMEDOUT, r.code, @"timeout code"); +// run = YES; +// }]; +// AGWW_WAIT_WHILE(!run, 100.0); +// XCTAssert(run, @"PASS"); +//} - (void)testStop { __block BOOL run = NO; diff --git a/Podfile b/Podfile index e105236..358c5f5 100644 --- a/Podfile +++ b/Podfile @@ -1,4 +1,4 @@ -source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '8.0' target "NetDiagTests" do pod 'AGAsyncTestHelper/Shorthand' diff --git a/QNNetDiag.podspec b/QNNetDiag.podspec index 7206a09..d161f23 100644 --- a/QNNetDiag.podspec +++ b/QNNetDiag.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'QNNetDiag' - s.version = '0.0.5' + s.version = '0.0.7' s.summary = 'Qiniu Net Diagnostic library' s.homepage = 'https://github.com/qiniu/iOS-netdiag' s.social_media_url = 'http://weibo.com/qiniutek' diff --git a/clang-format b/clang-format new file mode 100755 index 0000000..1f7d78c Binary files /dev/null and b/clang-format differ diff --git a/format.sh b/format.sh old mode 100644 new mode 100755 index cc0c99f..3edf8b4 --- a/format.sh +++ b/format.sh @@ -1,5 +1,5 @@ #!/bin/bash # Change this if your clang-format executable is somewhere else -CLANG_FORMAT="$HOME/Library/Application Support/Alcatraz/Plug-ins/ClangFormat/bin/clang-format" - +#CLANG_FORMAT="$HOME/Library/Application Support/Alcatraz/Plug-ins/ClangFormat/bin/clang-format" +CLANG_FORMAT=./clang-format find . \( -name '*.h' -or -name '*.m' -or -name '*.mm' \) -print0 | xargs -0 "$CLANG_FORMAT" -i