Skip to content

[gardening] Fix typos. Remove double spaces. Remove tabs in C++ code. #2100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Basic/Platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ StringRef swift::getPlatformNameForTriple(const llvm::Triple &triple) {

if (triple.isOSFreeBSD())
return "freebsd";

if (triple.isOSWindows())
return "windows";

Expand Down
4 changes: 2 additions & 2 deletions lib/ClangImporter/CFTypeInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include "llvm/ADT/PointerUnion.h"

namespace clang {
class RecordDecl;
class TypedefNameDecl;
class RecordDecl;
class TypedefNameDecl;
}

namespace swift {
Expand Down
4 changes: 2 additions & 2 deletions lib/IRGen/GenCast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ void irgen::emitScalarCheckedCast(IRGenFunction &IGF,
if (auto sourceOptObjectType =
sourceType.getAnyOptionalObjectType(*IGF.IGM.SILMod, optKind)) {

// Translate the value from an enum represention to a possibly-null
// Translate the value from an enum representation to a possibly-null
// representation. Note that we assume that this projection is safe
// for the particular case of an optional class-reference or metatype
// value.
Expand Down Expand Up @@ -820,4 +820,4 @@ void irgen::emitScalarCheckedCast(IRGenFunction &IGF,

llvm::Value *result = emitClassDowncast(IGF, instance, targetType, mode);
out.add(result);
}
}
2 changes: 1 addition & 1 deletion lib/Option/SanitizerOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ SanitizerKind swift::parseSanitizerArgValues(const llvm::opt::Arg *A,
Triple.getTriple());
}
// Thread Sanitizer only works on OS X and the simulators. It's only supported
// on 64 bit arcitectures.
// on 64 bit architectures.
if (kind == SanitizerKind::Thread &&
(!(Triple.isMacOSX() || tripleIsAnySimulator(Triple)) ||
!Triple.isArch64Bit())) {
Expand Down
2 changes: 1 addition & 1 deletion lib/SIL/SILGlobalVariable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SILGlobalVariable::SILGlobalVariable(SILModule &Module, SILLinkage Linkage,
Location(Loc),
Linkage(unsigned(Linkage)),
Fragile(IsFragile),
VDecl(Decl) {
VDecl(Decl) {
IsDeclaration = isAvailableExternally(Linkage);
setLet(Decl ? Decl->isLet() : false);
InitializerF = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/Arrays.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ extension ${Self} : RangeReplaceableCollection, _ArrayProtocol {
_buffer = ${Self}._allocateBufferUninitialized(minimumCapacity: count)
_buffer.count = count
}
// Cant store count here because the buffer might be pointing to the
// Can't store count here because the buffer might be pointing to the
// shared empty array.
}

Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/stubs/Stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,13 @@ __muloti4(ti_int a, ti_int b, int* overflow)
if (a == MIN)
{
if (b != 0 && b != 1)
*overflow = 1;
return result;
*overflow = 1;
return result;
}
if (b == MIN)
{
if (a != 0 && a != 1)
*overflow = 1;
*overflow = 1;
return result;
}
ti_int sa = a >> (N - 1);
Expand Down
18 changes: 9 additions & 9 deletions test/1_stdlib/Inputs/DictionaryKeyValueTypesObjC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Foundation

// FIXME: Should go into the standard library.
public extension _ObjectiveCBridgeable {
static func _unconditionallyBridgeFromObjectiveC(_ source: _ObjectiveCType?)
static func _unconditionallyBridgeFromObjectiveC(_ source: _ObjectiveCType?)
-> Self {
var result: Self? = nil
_forceBridgeFromObjectiveC(source!, result: &result)
Expand Down Expand Up @@ -101,7 +101,7 @@ class TestObjCKeyTy : NSObject, NSCopying {
return value.description
}

override func isEqual(_ object: AnyObject!) -> Bool {
override func isEqual(_ object: AnyObject!) -> Bool {
if let other = object {
if let otherObjcKey = other as? TestObjCKeyTy {
return self.value == otherObjcKey.value
Expand Down Expand Up @@ -182,7 +182,7 @@ class TestObjCEquatableValueTy : NSObject {
serial = -serial
}

override func isEqual(_ object: AnyObject!) -> Bool {
override func isEqual(_ object: AnyObject!) -> Bool {
if let other = object {
if let otherObjcKey = other as? TestObjCEquatableValueTy {
return self.value == otherObjcKey.value
Expand Down Expand Up @@ -242,15 +242,15 @@ struct TestBridgedKeyTy
return TestObjCKeyTy(value)
}

static func _forceBridgeFromObjectiveC(
static func _forceBridgeFromObjectiveC(
_ x: TestObjCKeyTy,
result: inout TestBridgedKeyTy?
) {
_bridgedKeyBridgeOperations.fetchAndAdd(1)
result = TestBridgedKeyTy(x.value)
}

static func _conditionallyBridgeFromObjectiveC(
static func _conditionallyBridgeFromObjectiveC(
_ x: TestObjCKeyTy,
result: inout TestBridgedKeyTy?
) -> Bool {
Expand Down Expand Up @@ -303,15 +303,15 @@ struct TestBridgedValueTy : CustomStringConvertible, _ObjectiveCBridgeable {
return TestObjCValueTy(value)
}

static func _forceBridgeFromObjectiveC(
static func _forceBridgeFromObjectiveC(
_ x: TestObjCValueTy,
result: inout TestBridgedValueTy?
) {
TestBridgedValueTy.bridgeOperations += 1
result = TestBridgedValueTy(x.value)
}

static func _conditionallyBridgeFromObjectiveC(
static func _conditionallyBridgeFromObjectiveC(
_ x: TestObjCValueTy,
result: inout TestBridgedValueTy?
) -> Bool {
Expand Down Expand Up @@ -357,15 +357,15 @@ struct TestBridgedEquatableValueTy
return TestObjCEquatableValueTy(value)
}

static func _forceBridgeFromObjectiveC(
static func _forceBridgeFromObjectiveC(
_ x: TestObjCEquatableValueTy,
result: inout TestBridgedEquatableValueTy?
) {
_bridgedEquatableValueBridgeOperations.fetchAndAdd(1)
result = TestBridgedEquatableValueTy(x.value)
}

static func _conditionallyBridgeFromObjectiveC(
static func _conditionallyBridgeFromObjectiveC(
_ x: TestObjCEquatableValueTy,
result: inout TestBridgedEquatableValueTy?
) -> Bool {
Expand Down
6 changes: 3 additions & 3 deletions test/ClangModules/Inputs/enum-error.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
@class NSString;
extern NSString *const TestErrorDomain;
typedef NS_ERROR_ENUM(int, TestError, TestErrorDomain) {
TENone,
TEOne,
TETwo,
TENone,
TEOne,
TETwo,
};

TestError getErr();
2 changes: 1 addition & 1 deletion test/IDE/Inputs/custom-modules/InferImportAsMember.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ static void IAMStruct1DoSomething(struct IAMMutableStruct1 iamStruct1);

typedef struct TDStruct TDStruct;
struct TDStruct {
double x;
double x;
};
// FIXME: the below doesn't appear in the output
const TDStruct TDStructCreateWithFloat(float Float);
Expand Down
2 changes: 1 addition & 1 deletion test/IDE/Inputs/mock-sdk/Bar.framework/Headers/Bar.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ enum BarForwardDeclaredEnum {
#define BAR_MACRO_1 0

typedef struct {
int count;
int count;
} SomeItemSet;

typedef SomeItemSet SomeEnvironment;
2 changes: 1 addition & 1 deletion test/IRGen/Inputs/StaticInline.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#import <Foundation/Foundation.h>

static inline NSString *staticInlineFun() {
return [[NSLocale currentLocale] localeIdentifier];
return [[NSLocale currentLocale] localeIdentifier];
}
30 changes: 15 additions & 15 deletions test/Inputs/clang-importer-sdk/usr/include/Foundation.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,19 +397,19 @@ typedef NS_ENUM(NSUInteger, NSPostingStyle) {
};

typedef NS_ENUM(NSUInteger, NSXMLNodeKind) {
NSXMLInvalidKind = 0,
NSXMLDocumentKind,
NSXMLElementKind,
NSXMLAttributeKind,
NSXMLNamespaceKind,
NSXMLProcessingInstructionKind,
NSXMLCommentKind,
NSXMLTextKind,
NSXMLDTDKind __attribute__((swift_name("DTDKind"))),
NSXMLEntityDeclarationKind,
NSXMLAttributeDeclarationKind,
NSXMLElementDeclarationKind,
NSXMLNotationDeclarationKind
NSXMLInvalidKind = 0,
NSXMLDocumentKind,
NSXMLElementKind,
NSXMLAttributeKind,
NSXMLNamespaceKind,
NSXMLProcessingInstructionKind,
NSXMLCommentKind,
NSXMLTextKind,
NSXMLDTDKind __attribute__((swift_name("DTDKind"))),
NSXMLEntityDeclarationKind,
NSXMLAttributeDeclarationKind,
NSXMLElementDeclarationKind,
NSXMLNotationDeclarationKind
};

// From CoreFoundation
Expand Down Expand Up @@ -566,7 +566,7 @@ typedef NS_OPTIONS(NSInteger, AlertBuzzes) {
typedef NS_OPTIONS(NSUInteger, NSBitmapFormat) {
NSAlphaFirstBitmapFormat = 1 << 0, // 0 means is alpha last (RGBA, CMYKA, etc.)
NSAlphaNonpremultipliedBitmapFormat = 1 << 1, // 0 means is premultiplied
NSFloatingPointSamplesBitmapFormat = 1 << 2, // 0 is integer
NSFloatingPointSamplesBitmapFormat = 1 << 2, // 0 is integer

NS16BitLittleEndianBitmapFormat /*NS_ENUM_AVAILABLE_MAC(10_51)*/ = (1 << 8),
NS32BitLittleEndianBitmapFormat /*NS_ENUM_AVAILABLE_MAC(10_51)*/ = (1 << 9),
Expand All @@ -582,7 +582,7 @@ typedef NS_OPTIONS(NSUInteger, NSBitmapFormatReversed) {

NSAlphaFirstBitmapFormatR = 1 << 0, // 0 means is alpha last (RGBA, CMYKA, etc.)
NSAlphaNonpremultipliedBitmapFormatR = 1 << 1, // 0 means is premultiplied
NSFloatingPointSamplesBitmapFormatR = 1 << 2, // 0 is integer
NSFloatingPointSamplesBitmapFormatR = 1 << 2, // 0 is integer
};

typedef NS_OPTIONS(NSUInteger, NSBitmapFormat2) {
Expand Down
2 changes: 1 addition & 1 deletion test/Inputs/clang-importer-sdk/usr/include/user_objc.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typedef CF_OPTIONS(UInt32, AudioComponentInstantiationOptions) {
typedef CF_OPTIONS(UInt32, AudioComponentFlags) {
kAudioComponentFlag_Unsearchable = 1,
kAudioComponentFlag_SandboxSafe = 2,
kAudioComponentFlag_IsV3AudioUnit = 4
kAudioComponentFlag_IsV3AudioUnit = 4
};

// ...and this one has both complications.
Expand Down
2 changes: 1 addition & 1 deletion test/SIL/Parser/nonatomic_reference_counting.sil
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %target-swift-frontend %s -emit-silgen | FileCheck %s

// Check that all refernce counting instructions can take the [nonatomic]
// Check that all reference counting instructions can take the [nonatomic]
// attribute. SIL parser should be able to parse this attribute and
// SIL printer should properly print it.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ enum BarForwardDeclaredEnum {
#define BAR_MACRO_1 0

typedef struct {
int count;
int count;
} SomeItemSet;

typedef SomeItemSet SomeEnvironment;
4 changes: 2 additions & 2 deletions test/SourceKit/InterfaceGen/Inputs/header2.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

typedef struct {
long width;
long height;
long width;
long height;
} NUPixelSize;
2 changes: 1 addition & 1 deletion tools/SourceKit/lib/SwiftLang/SwiftInterfaceGenContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace SourceKit {
typedef IntrusiveRefCntPtr<ASTUnit> ASTUnitRef;

class SwiftInterfaceGenContext :
public swift::ThreadSafeRefCountedBase<SwiftInterfaceGenContext> {
public swift::ThreadSafeRefCountedBase<SwiftInterfaceGenContext> {
public:
static SwiftInterfaceGenContextRef create(StringRef DocumentName,
bool IsModule,
Expand Down
2 changes: 1 addition & 1 deletion tools/sil-opt/SILOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Passes(llvm::cl::desc("Passes:"),
llvm::cl::values(
#define PASS(ID, NAME, DESCRIPTION) clEnumValN(PassKind::ID, NAME, DESCRIPTION),
#include "swift/SILOptimizer/PassManager/Passes.def"
clEnumValEnd));
clEnumValEnd));

static llvm::cl::opt<bool>
PrintStats("print-stats", llvm::cl::desc("Print various statistics"));
Expand Down
2 changes: 1 addition & 1 deletion utils/swift_build_support/tests/test_toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_clang_available_on_this_platform(self):

class HostToolchainTestCase(unittest.TestCase):
def test_found_executables_match(self):
# Test that the raw incovation of _first_common_executables
# Test that the raw invocation of _first_common_executables
# either returns None or matching paths.
suffixes = ['', '-3.8', '-3.7', '-3.6']
toolchain = host_toolchain(suffixes=suffixes)
Expand Down