mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
@@ -30,7 +30,7 @@ func Ackermann(_ M: Int, _ N : Int) -> Int {
|
||||
return ackermann(M - 1, ackermann(M, N - 1))
|
||||
}
|
||||
|
||||
let ref_result = [5, 13, 29, 61, 125, 253, 509, 1021, 2045, 4093, 8189, 16381, 32765, 65533, 131069];
|
||||
let ref_result = [5, 13, 29, 61, 125, 253, 509, 1021, 2045, 4093, 8189, 16381, 32765, 65533, 131069]
|
||||
|
||||
@inline(never)
|
||||
public func run_Ackermann(_ N: Int) {
|
||||
|
||||
@@ -119,7 +119,7 @@ public func run_Dictionary(scale: Int) {
|
||||
for _ in 1...N {
|
||||
Dict = [:]
|
||||
for word in Input {
|
||||
Dict[word] = true;
|
||||
Dict[word] = true
|
||||
}
|
||||
}
|
||||
CheckResults(Dict.count == 270,
|
||||
@@ -272,7 +272,7 @@ public func run_DictionaryOfObjects(scale: Int) {
|
||||
for _ in 1...N {
|
||||
Dict = [:]
|
||||
for word in Input {
|
||||
Dict[Box(word)] = Box(true);
|
||||
Dict[Box(word)] = Box(true)
|
||||
}
|
||||
}
|
||||
CheckResults(Dict.count == 270,
|
||||
|
||||
@@ -110,5 +110,5 @@ let samples: [rrggbb_t] = [
|
||||
|
||||
@inline(never)
|
||||
public func run_Histogram(_ N: Int) {
|
||||
output_sorted_sparse_rgb_histogram(samples, N);
|
||||
output_sorted_sparse_rgb_histogram(samples, N)
|
||||
}
|
||||
|
||||
@@ -16,12 +16,12 @@ import TestsUtils
|
||||
// The program performs integration via Gaussian Quadrature
|
||||
|
||||
class Integrate {
|
||||
static let epsilon = 1.0e-9;
|
||||
static let epsilon = 1.0e-9
|
||||
|
||||
let fun: (Double) -> Double;
|
||||
let fun: (Double) -> Double
|
||||
|
||||
init (f: (Double) -> Double) {
|
||||
fun = f;
|
||||
fun = f
|
||||
}
|
||||
|
||||
private func recEval(_ l: Double, fl: Double, r: Double, fr: Double, a: Double) -> Double {
|
||||
@@ -50,7 +50,7 @@ class Integrate {
|
||||
|
||||
@inline(never)
|
||||
public func run_Integrate(_ N: Int) {
|
||||
let obj = Integrate(f: { x in (x*x + 1.0) * x});
|
||||
let obj = Integrate(f: { x in (x*x + 1.0) * x})
|
||||
let left = 0.0
|
||||
let right = 10.0
|
||||
let ref_result = 2550.0
|
||||
|
||||
@@ -19,7 +19,7 @@ class X<T : Comparable> {
|
||||
init(_ x : T) {elem = x}
|
||||
deinit {
|
||||
for _ in 1...deinitIters {
|
||||
if (elem > elem) { };
|
||||
if (elem > elem) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public func run_Phonebook(_ N: Int) {
|
||||
}
|
||||
}
|
||||
for _ in 1...N {
|
||||
var t = Names;
|
||||
var t = Names
|
||||
t.sort()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class B {
|
||||
public class A1 {
|
||||
let b: B1
|
||||
public init(b:B1) {
|
||||
self.b = b;
|
||||
self.b = b
|
||||
}
|
||||
public func run1() -> Int {
|
||||
return b.f1() + b.f2() + b.f3()
|
||||
|
||||
@@ -26,7 +26,7 @@ public func run_SetIsSubsetOf(_ N: Int) {
|
||||
otherSet.insert(Int(truncatingBitPattern: Random()))
|
||||
}
|
||||
|
||||
var isSubset = false;
|
||||
var isSubset = false
|
||||
for _ in 0 ..< N * 5000 {
|
||||
isSubset = set.isSubset(of: otherSet)
|
||||
if isSubset {
|
||||
@@ -137,7 +137,7 @@ public func run_SetIsSubsetOf_OfObjects(_ N: Int) {
|
||||
otherSet.insert(Box(Int(truncatingBitPattern: Random())))
|
||||
}
|
||||
|
||||
var isSubset = false;
|
||||
var isSubset = false
|
||||
for _ in 0 ..< N * 5000 {
|
||||
isSubset = set.isSubset(of: otherSet)
|
||||
if isSubset {
|
||||
|
||||
@@ -24,7 +24,7 @@ import Darwin
|
||||
let RequestInstanceKind = "k"
|
||||
let RequestInstanceAddress = "i"
|
||||
let RequestReflectionInfos = "r"
|
||||
let RequestReadBytes = "b";
|
||||
let RequestReadBytes = "b"
|
||||
let RequestSymbolAddress = "s"
|
||||
let RequestStringLength = "l"
|
||||
let RequestDone = "d"
|
||||
@@ -282,9 +282,9 @@ internal func reflect(instanceAddress: UInt, kind: InstanceKind) {
|
||||
case String(validatingUTF8: RequestStringLength)!:
|
||||
sendStringLength()
|
||||
case String(validatingUTF8: RequestPointerSize)!:
|
||||
sendPointerSize();
|
||||
sendPointerSize()
|
||||
case String(validatingUTF8: RequestDone)!:
|
||||
return;
|
||||
return
|
||||
default:
|
||||
fatalError("Unknown request received: '\(Array(command.utf8))'!")
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public struct DispatchData : RandomAccessCollection, _ObjectiveCBridgeable {
|
||||
body: @noescape (UnsafePointer<ContentType>) throws -> Result) rethrows -> Result
|
||||
{
|
||||
var ptr: UnsafePointer<Void>? = nil
|
||||
var size = 0;
|
||||
var size = 0
|
||||
let data = __dispatch_data_create_map(__wrapped, &ptr, &size)
|
||||
defer { _fixLifetime(data) }
|
||||
return try body(UnsafePointer<ContentType>(ptr!))
|
||||
@@ -247,7 +247,7 @@ public struct DispatchDataIterator : IteratorProtocol, Sequence {
|
||||
/// - Precondition: No preceding call to `self.next()` has returned `nil`.
|
||||
public mutating func next() -> DispatchData._Element? {
|
||||
if _position == _count { return nil }
|
||||
let element = _ptr[_position];
|
||||
let element = _ptr[_position]
|
||||
_position = _position + 1
|
||||
return element
|
||||
}
|
||||
|
||||
@@ -798,7 +798,7 @@ public func +=(lhs: inout ${mattype}, rhs: ${mattype}) -> Void {
|
||||
}
|
||||
|
||||
public func -=(lhs: inout ${mattype}, rhs: ${mattype}) -> Void {
|
||||
lhs = lhs - rhs;
|
||||
lhs = lhs - rhs
|
||||
}
|
||||
|
||||
/// Scalar-Matrix multiplication.
|
||||
|
||||
Reference in New Issue
Block a user