Skip to content

Commit

Permalink
[gardening] Fix trailing whitespace in *.cfg.in, *.html, *.mm and *.s…
Browse files Browse the repository at this point in the history
…il files
  • Loading branch information
practicalswift committed Oct 29, 2016
1 parent 7e68e02 commit f44686d
Show file tree
Hide file tree
Showing 114 changed files with 1,487 additions and 1,487 deletions.
510 changes: 255 additions & 255 deletions docs/archive/LangRef.html

Large diffs are not rendered by default.

1,002 changes: 501 additions & 501 deletions docs/doxygen.cfg.in

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/proposals/containers_value_type.html
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ <h2>
forKey: UDefaults::StrKey(UDefaults::kShowTabView).PassNSString()];

[result addEntriesFromDictionary: [TBrowserContainerController defaultContainerStateForNode: inTarget]];

return result;
}
</pre></blockquote>
Expand Down Expand Up @@ -332,7 +332,7 @@ <h2>
<p>
Such code is typically used as a private function and called from only
one or two places. Note that here is an example that the human reader
is greatly depending on really good names to make the semantics clear:
is greatly depending on really good names to make the semantics clear:
<code>andAddToArray</code>. In Swift such code is easily translated to
something like:
</p>
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/SDK/Dispatch/Dispatch.mm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static void _dispatch_overlay_constructor() {

#include "swift/Runtime/Config.h"

SWIFT_CC(swift) DISPATCH_RUNTIME_STDLIB_INTERFACE
SWIFT_CC(swift) DISPATCH_RUNTIME_STDLIB_INTERFACE
extern "C" dispatch_queue_attr_t
_swift_dispatch_queue_concurrent(void) {
return DISPATCH_QUEUE_CONCURRENT;
Expand Down
14 changes: 7 additions & 7 deletions stdlib/public/SDK/XCTest/XCTestCaseAdditions.mm
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,18 @@ @implementation XCTestCase (SwiftAdditions)
- (NSString *)className
{
NSString *className = [super className];

char *modulePart;
char *classPart;
bool ok = demangleSimpleClass([className UTF8String],
&modulePart, &classPart);
if (ok) {
className = [NSString stringWithUTF8String:classPart];

free(modulePart);
free(classPart);
}

return className;
}

Expand All @@ -138,12 +138,12 @@ - (NSString *)className
NSDictionary *_XCTRunThrowableBlockBridge(void (^block)())
{
NSDictionary *result;

@try {
block();
result = @{};
}

@catch (NSException *exception) {
result = @{
@"type": @"objc",
Expand All @@ -152,13 +152,13 @@ - (NSString *)className
@"reason": exception.reason,
};
}

@catch (...) {
result = @{
@"type": @"unknown",
};
}

Block_release(block);
return [result retain];
}
34 changes: 17 additions & 17 deletions stdlib/public/runtime/ErrorObject.mm
Original file line number Diff line number Diff line change
Expand Up @@ -164,20 +164,20 @@ static Class getSwiftNativeNSErrorClass() {
auto TheSwiftNativeNSError = getSwiftNativeNSErrorClass();
assert(class_getInstanceSize(TheSwiftNativeNSError) == sizeof(SwiftErrorHeader)
&& "NSError layout changed!");

// Determine the extra allocated space necessary to carry the value.
// TODO: If the error type is a simple enum with no associated values, we
// could emplace it in the "code" slot of the NSError and save ourselves
// some work.

unsigned size = type->getValueWitnesses()->getSize();
unsigned alignMask = type->getValueWitnesses()->getAlignmentMask();

size_t alignmentPadding = -sizeof(SwiftError) & alignMask;
size_t totalExtraSize = sizeof(SwiftError) - sizeof(SwiftErrorHeader)
+ alignmentPadding + size;
size_t valueOffset = alignmentPadding + sizeof(SwiftError);

// Allocate the instance as if it were a CFError. We won't really initialize
// the CFError parts until forced to though.
auto instance
Expand All @@ -194,15 +194,15 @@ static Class getSwiftNativeNSErrorClass() {

auto valueBytePtr = reinterpret_cast<char*>(instance) + valueOffset;
auto valuePtr = reinterpret_cast<OpaqueValue*>(valueBytePtr);

// If an initial value was given, copy or take it in.
if (initialValue) {
if (isTake)
type->vw_initializeWithTake(valuePtr, initialValue);
else
type->vw_initializeWithCopy(valuePtr, initialValue);
}

// Return the SwiftError reference and a pointer to the uninitialized value
// inside.
return BoxPair{reinterpret_cast<HeapObject*>(instance), valuePtr};
Expand Down Expand Up @@ -241,13 +241,13 @@ static Class getSwiftNativeNSErrorClass() {
// The witness table lives in the Foundation overlay, but it should be safe
// to assume that that's been linked in if a user is using NSError in their
// Swift source.

auto TheWitnessTable = SWIFT_LAZY_CONSTANT(dlsym(RTLD_DEFAULT,
"_TWPCSo7CFErrors5Error10Foundation"));
assert(TheWitnessTable &&
"Foundation overlay not loaded, or 'CFError : Error' conformance "
"not available");

return reinterpret_cast<const WitnessTable *>(TheWitnessTable);
}

Expand Down Expand Up @@ -342,15 +342,15 @@ static Class getSwiftNativeNSErrorClass() {
if (errorObject->isPureNSError()) {
// Return a pointer to the scratch buffer.
auto asError = (NSError*)errorObject;

*scratch = (void*)errorObject;
out->value = (const OpaqueValue *)scratch;
out->type = swift_getObjCClassMetadata((ClassMetadata*)[asError class]);

out->errorConformance = getNSErrorConformanceToError();
return;
}

out->value = errorObject->getValue();
out->type = errorObject->type;
out->errorConformance = errorObject->errorConformance;
Expand Down Expand Up @@ -424,13 +424,13 @@ static id _swift_bridgeErrorToNSError_(SwiftError *errorObject) {
if (errorObject->domain.load(std::memory_order_acquire) &&
errorObject->userInfo.load(std::memory_order_acquire))
return ns;

// Otherwise, calculate the domain and code (TODO: and user info), and
// initialize the NSError.
auto value = SwiftError::getIndirectValue(&errorObject);
auto type = errorObject->getType();
auto witness = errorObject->getErrorConformance();

NSString *domain = swift_stdlib_getErrorDomainNSString(value, type, witness);
NSInteger code = swift_stdlib_getErrorCode(value, type, witness);
NSDictionary *userInfo =
Expand Down Expand Up @@ -464,7 +464,7 @@ static id _swift_bridgeErrorToNSError_(SwiftError *errorObject) {
(CFStringRef)domain,
std::memory_order_acq_rel))
objc_release(domain);

return ns;
}

Expand All @@ -483,7 +483,7 @@ static id _swift_bridgeErrorToNSError_(SwiftError *errorObject) {
const Metadata *destType,
DynamicCastFlags flags) {
Class NSErrorClass = getNSErrorClass();

auto CFErrorTypeID = SWIFT_LAZY_CONSTANT(CFErrorGetTypeID());
// @_silgen_name("swift_stdlib_bridgeNSErrorToError")
// public func _stdlib_bridgeNSErrorToError<
Expand All @@ -503,7 +503,7 @@ bool BridgeFn(NSError *, OpaqueValue*, const Metadata *,
// If the Foundation overlay isn't loaded, then NSErrors can't be bridged.
if (!bridgeNSErrorToError || !TheObjectiveCBridgeableError)
return false;

// Is the input type an NSError?
switch (srcType->getKind()) {
case MetadataKind::Class:
Expand Down Expand Up @@ -541,14 +541,14 @@ bool BridgeFn(NSError *, OpaqueValue*, const Metadata *,
case MetadataKind::Tuple:
return false;
}

// Is the target type a bridgeable error?
auto witness = swift_conformsToProtocol(destType,
TheObjectiveCBridgeableError);

if (!witness)
return false;

// If so, attempt the bridge.
NSError *srcInstance = *reinterpret_cast<NSError * const*>(src);
objc_retain(srcInstance);
Expand Down
Loading

0 comments on commit f44686d

Please sign in to comment.