From 9822411a0fcbd5f507e017bc638a54054b503ff4 Mon Sep 17 00:00:00 2001 From: Sergio Campama Date: Wed, 29 Mar 2017 17:35:51 -0400 Subject: Remove trailing whitespaces --- Foundation/GTMFileSystemKQueue.h | 4 +-- Foundation/GTMGeometryUtils.m | 22 +++++++------- Foundation/GTMLightweightProxy.h | 4 +-- Foundation/GTMLightweightProxy.m | 4 +-- Foundation/GTMLocalizedString.h | 46 +++++++++++++++--------------- Foundation/GTMLoggerRingBufferWriter.h | 10 +++---- Foundation/GTMLoggerRingBufferWriter.m | 18 ++++++------ Foundation/GTMNSArray+Merge.h | 4 +-- Foundation/GTMNSDictionary+URLArguments.h | 4 +-- Foundation/GTMNSFileManager+Carbon.h | 10 +++---- Foundation/GTMNSFileManager+Carbon.m | 38 ++++++++++++------------ Foundation/GTMNSObject+KeyValueObserving.h | 20 ++++++------- Foundation/GTMNSScanner+JSON.h | 4 +-- Foundation/GTMNSString+FindFolder.h | 16 +++++------ Foundation/GTMNSString+FindFolder.m | 24 ++++++++-------- Foundation/GTMNSString+HTML.h | 10 +++---- Foundation/GTMNSString+Replace.h | 4 +-- Foundation/GTMNSString+Replace.m | 8 +++--- Foundation/GTMNSString+ReplaceTest.m | 18 ++++++------ Foundation/GTMNSString+URLArguments.h | 4 +-- Foundation/GTMNSString+XML.h | 4 +-- Foundation/GTMNSString+XML.m | 32 ++++++++++----------- Foundation/GTMPath.h | 18 ++++++------ Foundation/GTMRegex.h | 6 ++-- Foundation/GTMScriptRunner.h | 32 ++++++++++----------- Foundation/GTMSignalHandler.h | 4 +-- Foundation/GTMSignalHandler.m | 26 ++++++++--------- Foundation/GTMSystemVersion.h | 4 +-- 28 files changed, 199 insertions(+), 199 deletions(-) (limited to 'Foundation') diff --git a/Foundation/GTMFileSystemKQueue.h b/Foundation/GTMFileSystemKQueue.h index c167eea..a829154 100644 --- a/Foundation/GTMFileSystemKQueue.h +++ b/Foundation/GTMFileSystemKQueue.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the diff --git a/Foundation/GTMGeometryUtils.m b/Foundation/GTMGeometryUtils.m index 07de80c..c6cf97b 100644 --- a/Foundation/GTMGeometryUtils.m +++ b/Foundation/GTMGeometryUtils.m @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -31,12 +31,12 @@ CGRect GTMCGAlignRectangles(CGRect alignee, CGRect aligner, GTMRectAlignment ali alignee.origin.x = aligner.origin.x + (CGRectGetWidth(aligner) * .5f - CGRectGetWidth(alignee) * .5f); alignee.origin.y = aligner.origin.y + CGRectGetHeight(aligner) - CGRectGetHeight(alignee); break; - + case GTMRectAlignTopLeft: alignee.origin.x = aligner.origin.x; alignee.origin.y = aligner.origin.y + CGRectGetHeight(aligner) - CGRectGetHeight(alignee); break; - + case GTMRectAlignTopRight: alignee.origin.x = aligner.origin.x + CGRectGetWidth(aligner) - CGRectGetWidth(alignee); alignee.origin.y = aligner.origin.y + CGRectGetHeight(aligner) - CGRectGetHeight(alignee); @@ -46,7 +46,7 @@ CGRect GTMCGAlignRectangles(CGRect alignee, CGRect aligner, GTMRectAlignment ali alignee.origin.x = aligner.origin.x; alignee.origin.y = aligner.origin.y + (CGRectGetHeight(aligner) * .5f - CGRectGetHeight(alignee) * .5f); break; - + case GTMRectAlignBottomLeft: alignee.origin.x = aligner.origin.x; alignee.origin.y = aligner.origin.y; @@ -61,12 +61,12 @@ CGRect GTMCGAlignRectangles(CGRect alignee, CGRect aligner, GTMRectAlignment ali alignee.origin.x = aligner.origin.x + CGRectGetWidth(aligner) - CGRectGetWidth(alignee); alignee.origin.y = aligner.origin.y; break; - + case GTMRectAlignRight: alignee.origin.x = aligner.origin.x + CGRectGetWidth(aligner) - CGRectGetWidth(alignee); alignee.origin.y = aligner.origin.y + (CGRectGetHeight(aligner) * .5f - CGRectGetHeight(alignee) * .5f); break; - + default: case GTMRectAlignCenter: alignee.origin.x = aligner.origin.x + (CGRectGetWidth(aligner) * .5f - CGRectGetWidth(alignee) * .5f); @@ -78,12 +78,12 @@ CGRect GTMCGAlignRectangles(CGRect alignee, CGRect aligner, GTMRectAlignment ali CGRect GTMCGScaleRectangleToSize(CGRect scalee, CGSize size, GTMScaling scaling) { switch (scaling) { - + case GTMScaleToFillProportionally: case GTMScaleProportionally: { CGFloat height = CGRectGetHeight(scalee); CGFloat width = CGRectGetWidth(scalee); - if (isnormal(height) && isnormal(width) && + if (isnormal(height) && isnormal(width) && (height > size.height || width > size.width)) { CGFloat horiz = size.width / width; CGFloat vert = size.height / height; @@ -94,11 +94,11 @@ CGRect GTMCGScaleRectangleToSize(CGRect scalee, CGSize size, GTMScaling scaling) } break; } - + case GTMScaleToFit: scalee.size = size; break; - + case GTMScaleNone: default: // Do nothing diff --git a/Foundation/GTMLightweightProxy.h b/Foundation/GTMLightweightProxy.h index 76ef66b..31eba9a 100644 --- a/Foundation/GTMLightweightProxy.h +++ b/Foundation/GTMLightweightProxy.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the diff --git a/Foundation/GTMLightweightProxy.m b/Foundation/GTMLightweightProxy.m index dc89807..aa2d1a1 100644 --- a/Foundation/GTMLightweightProxy.m +++ b/Foundation/GTMLightweightProxy.m @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the diff --git a/Foundation/GTMLocalizedString.h b/Foundation/GTMLocalizedString.h index cbfbec1..c49b8a9 100644 --- a/Foundation/GTMLocalizedString.h +++ b/Foundation/GTMLocalizedString.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -20,19 +20,19 @@ #import "GTMDefines.h" // The NSLocalizedString macros do not have NS_FORMAT_ARGUMENT modifiers put -// on them which means you get warnings on Snow Leopard with when +// on them which means you get warnings on Snow Leopard with when // GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES and you do things like: -// NSString *foo +// NSString *foo // = [NSString stringWithFormat:NSLocalizedString(@"blah %@", nil), @"bar"]; // The GTMLocalizedString functions fix that for you so you can do: -// NSString *foo +// NSString *foo // = [NSString stringWithFormat:GTMLocalizedString(@"blah %@", nil), @"bar"]; // and you will compile cleanly. -// If you use genstrings you can call it with +// If you use genstrings you can call it with // genstrings -s GTMLocalizedString ... // and it should work as expected. // You can override how GTM gets its localized strings (if you are using -// something other than NSLocalizedString) by redefining +// something other than NSLocalizedString) by redefining // GTMLocalizedStringWithDefaultValueInternal. #ifndef GTMLocalizedStringWithDefaultValueInternal @@ -42,38 +42,38 @@ GTM_INLINE NS_FORMAT_ARGUMENT(1) NSString *GTMLocalizedString( NSString *key, NSString *comment) { - return GTMLocalizedStringWithDefaultValueInternal(key, - nil, - [NSBundle mainBundle], - @"", + return GTMLocalizedStringWithDefaultValueInternal(key, + nil, + [NSBundle mainBundle], + @"", comment); } GTM_INLINE NS_FORMAT_ARGUMENT(1) NSString *GTMLocalizedStringFromTable( NSString *key, NSString *tableName, NSString *comment) { - return GTMLocalizedStringWithDefaultValueInternal(key, - tableName, - [NSBundle mainBundle], - @"", + return GTMLocalizedStringWithDefaultValueInternal(key, + tableName, + [NSBundle mainBundle], + @"", comment); } GTM_INLINE NS_FORMAT_ARGUMENT(1) NSString *GTMLocalizedStringFromTableInBundle( NSString *key, NSString *tableName, NSBundle *bundle, NSString *comment) { - return GTMLocalizedStringWithDefaultValueInternal(key, - tableName, - bundle, - @"", + return GTMLocalizedStringWithDefaultValueInternal(key, + tableName, + bundle, + @"", comment); } GTM_INLINE NS_FORMAT_ARGUMENT(1) NSString *GTMLocalizedStringWithDefaultValue( NSString *key, NSString *tableName, NSBundle *bundle, NSString *value, NSString *comment) { - return GTMLocalizedStringWithDefaultValueInternal(key, - tableName, - bundle, - value, + return GTMLocalizedStringWithDefaultValueInternal(key, + tableName, + bundle, + value, comment); } diff --git a/Foundation/GTMLoggerRingBufferWriter.h b/Foundation/GTMLoggerRingBufferWriter.h index 30e58ff..a7c3a1e 100644 --- a/Foundation/GTMLoggerRingBufferWriter.h +++ b/Foundation/GTMLoggerRingBufferWriter.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -49,7 +49,7 @@ typedef struct GTMRingBufferPair GTMRingBufferPair; // along all the messages. // @interface GTMLoggerRingBufferWriter : NSObject { - @private + @private id writer_; GTMRingBufferPair *buffer_; NSUInteger capacity_; @@ -57,12 +57,12 @@ typedef struct GTMRingBufferPair GTMRingBufferPair; NSUInteger totalLogged_; // This > 0 and |nextIndex_| == 0 means we've wrapped. } -// Returns an autoreleased ring buffer writer. If |writer| is nil, +// Returns an autoreleased ring buffer writer. If |writer| is nil, // then nil is returned. + (id)ringBufferWriterWithCapacity:(NSUInteger)capacity writer:(id)loggerWriter; -// Designated initializer. If |writer| is nil, then nil is returned. +// Designated initializer. If |writer| is nil, then nil is returned. // If you just use -init, nil will be returned. - (id)initWithCapacity:(NSUInteger)capacity writer:(id)loggerWriter; diff --git a/Foundation/GTMLoggerRingBufferWriter.m b/Foundation/GTMLoggerRingBufferWriter.m index 20f2795..46e3ef6 100644 --- a/Foundation/GTMLoggerRingBufferWriter.m +++ b/Foundation/GTMLoggerRingBufferWriter.m @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -96,7 +96,7 @@ typedef void (GTMRingBufferPairCallback)(GTMLoggerRingBufferWriter *rbw, if (buffer_) free(buffer_); [super dealloc]; - + } // dealloc @@ -129,7 +129,7 @@ typedef void (GTMRingBufferPairCallback)(GTMLoggerRingBufferWriter *rbw, - (NSUInteger)droppedLogCount { NSUInteger droppedCount = 0; - + @synchronized(self) { if (capacity_ > totalLogged_) { droppedCount = 0; @@ -137,7 +137,7 @@ typedef void (GTMRingBufferPairCallback)(GTMLoggerRingBufferWriter *rbw, droppedCount = totalLogged_ - capacity_; } } - + return droppedCount; } // droppedLogCount @@ -218,9 +218,9 @@ static void PrintContentsCallback(GTMLoggerRingBufferWriter *rbw, - (void)addMessage:(NSString *)message level:(GTMLoggerLevel)level { NSUInteger newIndex = nextIndex_; nextIndex_ = (nextIndex_ + 1) % capacity_; - + ++totalLogged_; - + // Now store the goodies. GTMRingBufferPair *pair = buffer_ + newIndex; if (pair->logMessage_) { @@ -231,7 +231,7 @@ static void PrintContentsCallback(GTMLoggerRingBufferWriter *rbw, pair->logMessage_ = CFStringCreateCopy(kCFAllocatorDefault, (CFStringRef)message); } pair->level_ = level; - + } // addMessage @@ -239,7 +239,7 @@ static void PrintContentsCallback(GTMLoggerRingBufferWriter *rbw, - (void)logMessage:(NSString *)message level:(GTMLoggerLevel)level { @synchronized(self) { [self addMessage:(NSString*)message level:level]; - + if (level >= kGTMLoggerLevelError) { [self dumpContents]; [self reset]; diff --git a/Foundation/GTMNSArray+Merge.h b/Foundation/GTMNSArray+Merge.h index 8140f80..ef8787b 100644 --- a/Foundation/GTMNSArray+Merge.h +++ b/Foundation/GTMNSArray+Merge.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the diff --git a/Foundation/GTMNSDictionary+URLArguments.h b/Foundation/GTMNSDictionary+URLArguments.h index b2f0564..734edea 100644 --- a/Foundation/GTMNSDictionary+URLArguments.h +++ b/Foundation/GTMNSDictionary+URLArguments.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the diff --git a/Foundation/GTMNSFileManager+Carbon.h b/Foundation/GTMNSFileManager+Carbon.h index 63f8b3c..02bff65 100644 --- a/Foundation/GTMNSFileManager+Carbon.h +++ b/Foundation/GTMNSFileManager+Carbon.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -49,10 +49,10 @@ // Returns: // The path. Nil on failure. // -- (NSString *)gtm_pathFromAliasData:(NSData *)alias - resolve:(BOOL)resolve +- (NSString *)gtm_pathFromAliasData:(NSData *)alias + resolve:(BOOL)resolve withUI:(BOOL)withUI; - + // Converts a path to an FSRef * // Args: // path - the path to convert diff --git a/Foundation/GTMNSFileManager+Carbon.m b/Foundation/GTMNSFileManager+Carbon.m index 8c51f66..d829cd9 100644 --- a/Foundation/GTMNSFileManager+Carbon.m +++ b/Foundation/GTMNSFileManager+Carbon.m @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -23,48 +23,48 @@ @implementation NSFileManager (GTMFileManagerCarbonAdditions) -- (NSData *)gtm_aliasDataForPath:(NSString *)path { +- (NSData *)gtm_aliasDataForPath:(NSString *)path { NSData *data = nil; FSRef ref; AliasHandle alias = NULL; require_quiet([path length], CantUseParams); - require_noerr(FSPathMakeRef((UInt8 *)[path fileSystemRepresentation], - &ref, NULL), CantMakeRef); + require_noerr(FSPathMakeRef((UInt8 *)[path fileSystemRepresentation], + &ref, NULL), CantMakeRef); require_noerr(FSNewAlias(NULL, &ref, &alias), CantMakeAlias); Size length = GetAliasSize(alias); data = [NSData dataWithBytes:*alias length:length]; - + DisposeHandle((Handle)alias); -CantMakeAlias: +CantMakeAlias: CantMakeRef: CantUseParams: - return data; -} + return data; +} - (NSString *)gtm_pathFromAliasData:(NSData *)data { return [self gtm_pathFromAliasData:data resolve:YES withUI:YES]; -} +} -- (NSString *)gtm_pathFromAliasData:(NSData *)data - resolve:(BOOL)resolve +- (NSString *)gtm_pathFromAliasData:(NSData *)data + resolve:(BOOL)resolve withUI:(BOOL)withUI { NSString *path = nil; require_quiet(data, CantUseParams); - + AliasHandle alias; const void *bytes = [data bytes]; NSUInteger length = [data length]; require_noerr(PtrToHand(bytes, (Handle *)&alias, length), CantMakeHandle); - + FSRef ref; Boolean wasChanged; // we don't use a require here because it is quite legitimate for an alias // resolve to fail. - if (resolve) { + if (resolve) { OSStatus err = FSResolveAliasWithMountFlags(NULL, alias, &ref, &wasChanged, withUI ? kResolveAliasFileNoUI : 0); @@ -91,7 +91,7 @@ CantUseParams: fsRef = (FSRef*)[fsRefData mutableBytes]; Boolean isDir = FALSE; const UInt8 *filePath = (const UInt8 *)[path fileSystemRepresentation]; - require_noerr_action(FSPathMakeRef(filePath, fsRef, &isDir), + require_noerr_action(FSPathMakeRef(filePath, fsRef, &isDir), CantMakeRef, fsRef = NULL); CantMakeRef: CantAllocateFSRef: @@ -102,15 +102,15 @@ CantUseParams: - (NSString *)gtm_pathFromFSRef:(FSRef *)fsRef { NSString *nsPath = nil; require_quiet(fsRef, CantUseParams); - + char path[MAXPATHLEN]; require_noerr(FSRefMakePath(fsRef, (UInt8 *)path, MAXPATHLEN), CantMakePath); nsPath = [self stringWithFileSystemRepresentation:path length:strlen(path)]; nsPath = [nsPath stringByStandardizingPath]; - + CantMakePath: CantUseParams: return nsPath; -} +} @end diff --git a/Foundation/GTMNSObject+KeyValueObserving.h b/Foundation/GTMNSObject+KeyValueObserving.h index 9aa1fbb..d36016c 100644 --- a/Foundation/GTMNSObject+KeyValueObserving.h +++ b/Foundation/GTMNSObject+KeyValueObserving.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -23,7 +23,7 @@ // Created by Michael Ash on 10/15/08. // -// This code is based on code by Michael Ash. +// This code is based on code by Michael Ash. // Please see his excellent writeup at // http://www.mikeash.com/?page=pyblog/key-value-observing-done-right.html // You may also be interested in this writeup: @@ -35,21 +35,21 @@ // If you read the articles above you will see that doing KVO correctly // is actually pretty tricky, and that Apple's documentation may not be // completely clear as to how things should be used. Use the methods below -// to make things a little easier instead of the stock addObserver, +// to make things a little easier instead of the stock addObserver, // removeObserver methods. // Selector should have the following signature: // - (void)observeNotification:(GTMKeyValueChangeNotification *)notification @interface NSObject (GTMKeyValueObservingAdditions) // Use this instead of [NSObject addObserver:forKeyPath:options:context:] -- (void)gtm_addObserver:(id)observer - forKeyPath:(NSString *)keyPath - selector:(SEL)selector - userInfo:(id)userInfo +- (void)gtm_addObserver:(id)observer + forKeyPath:(NSString *)keyPath + selector:(SEL)selector + userInfo:(id)userInfo options:(NSKeyValueObservingOptions)options; // Use this instead of [NSObject removeObserver:forKeyPath:] -- (void)gtm_removeObserver:(id)observer - forKeyPath:(NSString *)keyPath +- (void)gtm_removeObserver:(id)observer + forKeyPath:(NSString *)keyPath selector:(SEL)selector; // Use this to have |self| stop observing all keypaths on all objects. diff --git a/Foundation/GTMNSScanner+JSON.h b/Foundation/GTMNSScanner+JSON.h index 22446c1..0ff8e65 100644 --- a/Foundation/GTMNSScanner+JSON.h +++ b/Foundation/GTMNSScanner+JSON.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the diff --git a/Foundation/GTMNSString+FindFolder.h b/Foundation/GTMNSString+FindFolder.h index 1b4d362..69fc12e 100644 --- a/Foundation/GTMNSString+FindFolder.h +++ b/Foundation/GTMNSString+FindFolder.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -23,7 +23,7 @@ // Create a path to a folder located with FindFolder // // Args: -// theFolderType: one of the folder types in Folders.h +// theFolderType: one of the folder types in Folders.h // (kPreferencesFolderType, etc) // theDomain: one of the domains in Folders.h (kLocalDomain, kUserDomain, etc) // doCreate: create the folder if it does not already exist @@ -31,14 +31,14 @@ // Returns: // full path to folder, or nil if the folder doesn't exist or can't be created // -+ (NSString *)gtm_stringWithPathForFolder:(OSType)theFolderType - inDomain:(short)theDomain ++ (NSString *)gtm_stringWithPathForFolder:(OSType)theFolderType + inDomain:(short)theDomain doCreate:(BOOL)doCreate; // Create a path to a folder inside a folder located with FindFolder // // Args: -// theFolderType: one of the folder types in Folders.h +// theFolderType: one of the folder types in Folders.h // (kPreferencesFolderType, etc) // subfolderName: name of directory inside the Apple folder to be located or created // theDomain: one of the domains in Folders.h (kLocalDomain, kUserDomain, etc) @@ -47,9 +47,9 @@ // Returns: // full path to subdirectory, or nil if the folder doesn't exist or can't be created // -+ (NSString *)gtm_stringWithPathForFolder:(OSType)theFolderType ++ (NSString *)gtm_stringWithPathForFolder:(OSType)theFolderType subfolderName:(NSString *)subfolderName inDomain:(short)theDomain - doCreate:(BOOL)doCreate; + doCreate:(BOOL)doCreate; @end diff --git a/Foundation/GTMNSString+FindFolder.m b/Foundation/GTMNSString+FindFolder.m index 1e1b50a..c6734d6 100644 --- a/Foundation/GTMNSString+FindFolder.m +++ b/Foundation/GTMNSString+FindFolder.m @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,28 +21,28 @@ @implementation NSString (GTMStringFindFolderAdditions) -+ (NSString *)gtm_stringWithPathForFolder:(OSType)theFolderType ++ (NSString *)gtm_stringWithPathForFolder:(OSType)theFolderType inDomain:(short)theDomain doCreate:(BOOL)doCreate { - + NSString* folderPath = nil; FSRef folderRef; - + OSErr err = FSFindFolder(theDomain, theFolderType, doCreate, &folderRef); if (err == noErr) { - - CFURLRef folderURL = CFURLCreateFromFSRef(kCFAllocatorSystemDefault, + + CFURLRef folderURL = CFURLCreateFromFSRef(kCFAllocatorSystemDefault, &folderRef); if (folderURL) { - folderPath = GTMCFAutorelease(CFURLCopyFileSystemPath(folderURL, - kCFURLPOSIXPathStyle)); + folderPath = GTMCFAutorelease(CFURLCopyFileSystemPath(folderURL, + kCFURLPOSIXPathStyle)); CFRelease(folderURL); } } return folderPath; } -+ (NSString *)gtm_stringWithPathForFolder:(OSType)theFolderType ++ (NSString *)gtm_stringWithPathForFolder:(OSType)theFolderType subfolderName:(NSString *)subfolderName inDomain:(short)theDomain doCreate:(BOOL)doCreate { @@ -52,7 +52,7 @@ inDomain:theDomain doCreate:doCreate]; if (parentFolderPath) { - + // find the path to the subdirectory subdirPath = [parentFolderPath stringByAppendingPathComponent:subfolderName]; @@ -70,7 +70,7 @@ NSError *error = nil; attrs = [fileMgr attributesOfItemAtPath:parentFolderPath error:&error]; if (error) { - _GTMDevLog(@"Error %@ getting attributes of %@", + _GTMDevLog(@"Error %@ getting attributes of %@", error, parentFolderPath); } createdSubDir = [fileMgr createDirectoryAtPath:subdirPath diff --git a/Foundation/GTMNSString+HTML.h b/Foundation/GTMNSString+HTML.h index 1273cc3..6cfd35f 100644 --- a/Foundation/GTMNSString+HTML.h +++ b/Foundation/GTMNSString+HTML.h @@ -7,9 +7,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -22,7 +22,7 @@ /// Utilities for NSStrings containing HTML @interface NSString (GTMNSStringHTMLAdditions) -/// Get a string where internal characters that need escaping for HTML are escaped +/// Get a string where internal characters that need escaping for HTML are escaped // /// For example, '&' become '&'. This will only cover characters from table /// A.2.2 of http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_Special_characters @@ -37,7 +37,7 @@ // - (NSString *)gtm_stringByEscapingForHTML; -/// Get a string where internal characters that need escaping for HTML are escaped +/// Get a string where internal characters that need escaping for HTML are escaped // /// For example, '&' become '&' /// All non-mapped characters (unicode that don't have a &keyword; mapping) @@ -53,7 +53,7 @@ // - (NSString *)gtm_stringByEscapingForAsciiHTML; -/// Get a string where internal characters that are escaped for HTML are unescaped +/// Get a string where internal characters that are escaped for HTML are unescaped // /// For example, '&' becomes '&' /// Handles and 2 cases as well diff --git a/Foundation/GTMNSString+Replace.h b/Foundation/GTMNSString+Replace.h index 71a98c5..6512dfe 100644 --- a/Foundation/GTMNSString+Replace.h +++ b/Foundation/GTMNSString+Replace.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the diff --git a/Foundation/GTMNSString+Replace.m b/Foundation/GTMNSString+Replace.m index ddaad5e..1306a68 100644 --- a/Foundation/GTMNSString+Replace.m +++ b/Foundation/GTMNSString+Replace.m @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -34,12 +34,12 @@ // [s1 release]; // |s2| still needs to be valid after this line if (!target) return [[self retain] autorelease]; - + // If |replacement| is nil we want it to be treated as if @"" was specified // ... effectively removing |target| from self if (!replacement) replacement = @""; - + NSMutableString *result = [[self mutableCopy] autorelease]; [result replaceOccurrencesOfString:target withString:replacement diff --git a/Foundation/GTMNSString+ReplaceTest.m b/Foundation/GTMNSString+ReplaceTest.m index 4561af6..e56ab0e 100644 --- a/Foundation/GTMNSString+ReplaceTest.m +++ b/Foundation/GTMNSString+ReplaceTest.m @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -29,26 +29,26 @@ - (void)testStringByReplacingStringWithString { NSString *testString = @"a bc debc gh"; NSString *result; - + result = [testString gtm_stringByReplacingString:@"bc" withString:@"BC"]; STAssertEqualObjects(@"a BC deBC gh", result, @"'bc' wasn't replaced with 'BC'"); - + result = [testString gtm_stringByReplacingString:@"bc" withString:@""]; STAssertEqualObjects(@"a de gh", result, @"'bc' wasn't replaced with ''"); - + result = [testString gtm_stringByReplacingString:@"bc" withString:nil]; STAssertEqualObjects(@"a de gh", result, @"'bc' wasn't replaced with (nil)"); - + result = [testString gtm_stringByReplacingString:@" " withString:@"S"]; STAssertEqualObjects(@"aSbcSdebcSgh", result, @"' ' wasn't replaced with 'S'"); - + result = [testString gtm_stringByReplacingString:nil withString:@"blah"]; STAssertEqualObjects(testString, result, @"(nil) wasn't replaced with 'blah'"); - + result = [testString gtm_stringByReplacingString:nil withString:nil]; STAssertEqualObjects(testString, result, @"(nil) wasn't replaced with (nil)"); - + result = [testString gtm_stringByReplacingString:@"" withString:@"X"]; STAssertEqualObjects(testString, result, @"replacing '' with anything should yield the original string"); diff --git a/Foundation/GTMNSString+URLArguments.h b/Foundation/GTMNSString+URLArguments.h index b3a3e3e..0cb7f30 100644 --- a/Foundation/GTMNSString+URLArguments.h +++ b/Foundation/GTMNSString+URLArguments.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the diff --git a/Foundation/GTMNSString+XML.h b/Foundation/GTMNSString+XML.h index 6ef54d7..e2969c3 100644 --- a/Foundation/GTMNSString+XML.h +++ b/Foundation/GTMNSString+XML.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the diff --git a/Foundation/GTMNSString+XML.m b/Foundation/GTMNSString+XML.m index a9021ad..0ef41ae 100644 --- a/Foundation/GTMNSString+XML.m +++ b/Foundation/GTMNSString+XML.m @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -102,14 +102,14 @@ static NSString *AutoreleasedCloneForXML(NSString *src, BOOL escaping) { // it doesn't do anything about the chars that are actually invalid per the // xml spec. // - + // we can't use the CF call here because it leaves the invalid chars // in the string. NSUInteger length = [src length]; if (!length) { return src; } - + NSMutableString *finalString = [NSMutableString string]; // this block is common between GTMNSString+HTML and GTMNSString+XML but @@ -127,14 +127,14 @@ static NSString *AutoreleasedCloneForXML(NSString *src, BOOL escaping) { [src getCharacters:[data mutableBytes]]; buffer = [data bytes]; } - + const UniChar *goodRun = buffer; NSUInteger goodRunLength = 0; - + for (NSUInteger i = 0; i < length; ++i) { - + GTMXMLCharMode cMode = XMLModeForUnichar(buffer[i]); - + // valid chars go as is, and if we aren't doing entities, then // everything goes as is. if ((cMode == kGTMXMLCharModeValid) || @@ -143,30 +143,30 @@ static NSString *AutoreleasedCloneForXML(NSString *src, BOOL escaping) { goodRunLength += 1; } else { // it's something we have to encode or something invalid - + // start by adding what we already collected (if anything) if (goodRunLength) { - CFStringAppendCharacters((CFMutableStringRef)finalString, - goodRun, + CFStringAppendCharacters((CFMutableStringRef)finalString, + goodRun, goodRunLength); goodRunLength = 0; } - + // if it wasn't invalid, add the encoded version if (cMode != kGTMXMLCharModeInvalid) { // add this encoded [finalString appendString:gXMLEntityList[cMode]]; } - + // update goodRun to point to the next UniChar goodRun = buffer + i + 1; } } - + // anything left to add? if (goodRunLength) { - CFStringAppendCharacters((CFMutableStringRef)finalString, - goodRun, + CFStringAppendCharacters((CFMutableStringRef)finalString, + goodRun, goodRunLength); } return finalString; diff --git a/Foundation/GTMPath.h b/Foundation/GTMPath.h index 653baf0..ec6009a 100644 --- a/Foundation/GTMPath.h +++ b/Foundation/GTMPath.h @@ -53,12 +53,12 @@ // // GTMPath *library = [GTMPath pathWithFullPath:@"/Users/bob/Library"]; // ... -// +// // // 4. This sample creates a directory hierarchy, where each level has its own // mode. Notice that the return value from these -create* methods is the // GTMPath that was just created. This allows these creation calls to be -// chained together enabling easy creation of directory hierarchies. +// chained together enabling easy creation of directory hierarchies. // This is one of the big benefits of this class. // // GTMPath *tmp = [GTMPath pathWithFullPath:@"/tmp"]; @@ -81,7 +81,7 @@ - (id)initWithFullPath:(NSString *)fullPath; // Returns the name of this GTMPath instance. This is not the full path. It is -// just the component name of this GTMPath instance. This is equivalent to +// just the component name of this GTMPath instance. This is equivalent to // the Unix basename(3) function. - (NSString *)name; @@ -100,7 +100,7 @@ // instance. See -[NSFileManager fileAttributesAtPath:...] for details. - (NSDictionary *)attributes; -// Returns a string representation of the absolute path represented by this +// Returns a string representation of the absolute path represented by this // GTMPath instance. - (NSString *)fullPath; @@ -109,19 +109,19 @@ // Methods for creating files and directories inside a GTMPath instance. These // methods are only allowed to be called on GTMPath instances that represent -// directories. See the NSFileManager documentation for details about the +// directories. See the NSFileManager documentation for details about the // |attributes| parameters. @interface GTMPath (GTMPathGeneration) -// Creates a new directory with the specified mode or attributes inside the -// current GTMPath instance. If the creation is successful, a GTMPath for the +// Creates a new directory with the specified mode or attributes inside the +// current GTMPath instance. If the creation is successful, a GTMPath for the // newly created directory is returned. Otherwise, nil is returned. - (GTMPath *)createDirectoryName:(NSString *)name mode:(mode_t)mode; - (GTMPath *)createDirectoryName:(NSString *)name attributes:(NSDictionary *)attributes; -// Creates a new file with the specified mode or attributes inside the -// current GTMPath instance. If the creation is successful, a GTMPath for the +// Creates a new file with the specified mode or attributes inside the +// current GTMPath instance. If the creation is successful, a GTMPath for the // newly created file is returned. Otherwise, nil is returned. |data| is the // data to put in the file when created. - (GTMPath *)createFileName:(NSString *)name mode:(mode_t)mode; diff --git a/Foundation/GTMRegex.h b/Foundation/GTMRegex.h index 8cd1023..5ec778f 100644 --- a/Foundation/GTMRegex.h +++ b/Foundation/GTMRegex.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -57,7 +57,7 @@ typedef NSUInteger GTMRegexOptions; #undef _EXTERN #undef _INITIALIZE_AS #if GTMREGEX_DEFINE_GLOBALS -#define _EXTERN +#define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN GTM_EXTERN diff --git a/Foundation/GTMScriptRunner.h b/Foundation/GTMScriptRunner.h index 226d75b..088bd02 100644 --- a/Foundation/GTMScriptRunner.h +++ b/Foundation/GTMScriptRunner.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -25,15 +25,15 @@ // the "/bin/sh" interpreter is used, but others may be explicitly specified. // This can be a convenient way to run quick shell commands from Cocoa, or even // interact with other shell tools such as "bc", or even "gdb". -// -// It's important to note that by default commands and scripts will have their +// +// It's important to note that by default commands and scripts will have their // environments erased before execution. You can control the environment they // get with the -setEnvironment: method. // -// The best way to show what this class does is to show some examples. +// The best way to show what this class does is to show some examples. // // Examples: -// +// // GTMScriptRunner *sr = [GTMScriptRunner runner]; // NSString *output = [sr run:@"ls -l /dev/null"]; // /* output == "crw-rw-rw- 1 root wheel 3, 2 Mar 22 10:35 /dev/null" */ @@ -65,8 +65,8 @@ + (GTMScriptRunner *)runnerWithPython; // Returns an autoreleased GTMScriptRunner instance associated with the specified -// interpreter, and the given args. The specified args are the arguments that -// should be applied to the interpreter itself, not scripts run through the +// interpreter, and the given args. The specified args are the arguments that +// should be applied to the interpreter itself, not scripts run through the // interpreter. For example, to start an interpreter using "perl -w", you could // do: // [GTMScriptRunner runnerWithInterpreter:@"/usr/bin/perl" @@ -83,11 +83,11 @@ // specified interpreter. This method is the designated initializer. - (id)initWithInterpreter:(NSString *)interp withArgs:(NSArray *)args; -// Runs the specified command string by sending it through the interpreter's -// standard input. The standard output is returned. The standard error is +// Runs the specified command string by sending it through the interpreter's +// standard input. The standard output is returned. The standard error is // discarded. - (NSString *)run:(NSString *)cmds; -// Same as the previous method, except the standard error is returned in |err| +// Same as the previous method, except the standard error is returned in |err| // if specified. - (NSString *)run:(NSString *)cmds standardError:(NSString **)err; @@ -100,11 +100,11 @@ standardError:(NSString **)err; // Returns the environment dictionary to use for the inferior process that will -// run the interpreter. A return value of nil means that the interpreter's +// run the interpreter. A return value of nil means that the interpreter's // environment should be erased. - (NSDictionary *)environment; -// Sets the environment dictionary to use for the interpreter process. See +// Sets the environment dictionary to use for the interpreter process. See // NSTask's -setEnvironment: documentation for details about the dictionary. // Basically, it's just a dict of key/value pairs corresponding to environment // keys and values. Setting a value of nil means that the environment should be @@ -112,8 +112,8 @@ // // *** The default is nil. *** // -// By default, all interpreters will run with a clean environment. If you want -// the interpreter process to inherit your current environment you'll need to +// By default, all interpreters will run with a clean environment. If you want +// the interpreter process to inherit your current environment you'll need to // do the following: // // GTMScriptRunner *sr = [GTMScriptRunner runner]; @@ -122,7 +122,7 @@ // SECURITY NOTE: That said, in general you should NOT do this because an // attacker can modify the environment that would then get sent to your scripts. // And if your binary is suid, then you ABSOLUTELY should not do this. -// +// - (void)setEnvironment:(NSDictionary *)newEnv; // Sets (and returns) whether or not whitespace is automatically trimmed from diff --git a/Foundation/GTMSignalHandler.h b/Foundation/GTMSignalHandler.h index ec21507..5f4b028 100644 --- a/Foundation/GTMSignalHandler.h +++ b/Foundation/GTMSignalHandler.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the diff --git a/Foundation/GTMSignalHandler.m b/Foundation/GTMSignalHandler.m index 26a06f1..05ee826 100644 --- a/Foundation/GTMSignalHandler.m +++ b/Foundation/GTMSignalHandler.m @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -74,7 +74,7 @@ static CFSocketRef gRunLoopSocket = NULL; action_, @encode(int), NULL); - + // We're handling this signal via kqueue, so turn off the usual signal // handling. signal(signo_, SIG_IGN); @@ -101,7 +101,7 @@ static void SocketCallBack(CFSocketRef socketref, CFSocketCallBackType type, NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; struct kevent event; - + if (kevent(gSignalKQueueFileDescriptor, NULL, 0, &event, 1, NULL) == -1) { _GTMDevLog(@"could not pick up kqueue event. Errno %d", errno); // COV_NF_LINE } else { @@ -115,7 +115,7 @@ static void SocketCallBack(CFSocketRef socketref, CFSocketCallBackType type, // Cribbed from Advanced Mac OS X Programming - (void)addFileDescriptorMonitor:(int)fd { CFSocketContext context = { 0, NULL, NULL, NULL, NULL }; - + gRunLoopSocket = CFSocketCreateWithNative(kCFAllocatorDefault, fd, kCFSocketReadCallBack, @@ -125,25 +125,25 @@ static void SocketCallBack(CFSocketRef socketref, CFSocketCallBackType type, _GTMDevLog(@"could not CFSocketCreateWithNative"); // COV_NF_LINE goto bailout; // COV_NF_LINE } - + CFRunLoopSourceRef rls; rls = CFSocketCreateRunLoopSource(NULL, gRunLoopSocket, 0); if (rls == NULL) { _GTMDevLog(@"could not create a run loop source"); // COV_NF_LINE goto bailout; // COV_NF_LINE } - + CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode); CFRelease(rls); - + bailout: return; - + } - (void)registerWithKQueue { - + // Make sure we have our kqueue. if (gSignalKQueueFileDescriptor == 0) { gSignalKQueueFileDescriptor = kqueue(); @@ -156,7 +156,7 @@ static void SocketCallBack(CFSocketRef socketref, CFSocketCallBackType type, // Add the kqueue file descriptor to the runloop. [self addFileDescriptorMonitor:gSignalKQueueFileDescriptor]; } - + // Add a new event for the signal. struct kevent filter; EV_SET(&filter, signo_, EVFILT_SIGNAL, EV_ADD | EV_ENABLE | EV_CLEAR, @@ -166,7 +166,7 @@ static void SocketCallBack(CFSocketRef socketref, CFSocketCallBackType type, if (kevent(gSignalKQueueFileDescriptor, &filter, 1, NULL, 0, &noWait) != 0) { _GTMDevLog(@"could not add event for signal %d. Errno %d", signo_, errno); // COV_NF_LINE } - + } - (void)invalidate { @@ -181,7 +181,7 @@ static void SocketCallBack(CFSocketRef socketref, CFSocketCallBackType type, if (kevent(gSignalKQueueFileDescriptor, &filter, 1, NULL, 0, &noWait) != 0) { _GTMDevLog(@"could not remove event for signal %d. Errno %d", signo_, errno); // COV_NF_LINE } - + // Set action_ to nil so that if invalidate is called on us twice, // nothing happens. action_ = nil; diff --git a/Foundation/GTMSystemVersion.h b/Foundation/GTMSystemVersion.h index 4d2511e..2205e42 100644 --- a/Foundation/GTMSystemVersion.h +++ b/Foundation/GTMSystemVersion.h @@ -6,9 +6,9 @@ // Licensed under the Apache License, Version 2.0 (the "License"); you may not // use this file except in compliance with the License. You may obtain a copy // of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -- cgit v1.2.3