Skip to content

Commit 26f3e2e

Browse files
committed
Adding Stronger Type Check before Swift 4.0
(Void) -> ==> () -> :Bool = withExtended … { () in ===> :Bool = withExtended … { () -> Bool
1 parent 1c6ad35 commit 26f3e2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+168
-168
lines changed

Sources/PerfectTensorFlow/APILoader.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ public class TFLib {
747747
///
748748
/// The data in the buffer will be the serialized OpList proto for ops registered
749749
/// in this address space.
750-
public static var GetAllOpList: @convention(c) (Void) -> UnsafeMutablePointer<TF_Buffer>? = { return nil }
750+
public static var GetAllOpList: @convention(c) () -> UnsafeMutablePointer<TF_Buffer>? = { return nil }
751751

752752
/// Bootstrap of tensorflow library open, **MUST BE CALL BEFORE ANY OPERATIONS**
753753
/// - parameters

Sources/PerfectTensorFlow/pb.api_objects.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ extension ThirdParty_Tensorflow_Tools_Api_TFAPIObject: SwiftProtobuf._MessageImp
403403

404404
public func _protobuf_generated_isEqualTo(other: ThirdParty_Tensorflow_Tools_Api_TFAPIObject) -> Bool {
405405
if _storage !== other._storage {
406-
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
406+
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) -> Bool in
407407
if _storage._path != other_storage._path {return false}
408408
if _storage._tfModule != other_storage._tfModule {return false}
409409
if _storage._tfClass != other_storage._tfClass {return false}

Sources/PerfectTensorFlow/pb.attr_value.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ extension Tensorflow_AttrValue: SwiftProtobuf._MessageImplementationBase, SwiftP
460460

461461
public func _protobuf_generated_isEqualTo(other: Tensorflow_AttrValue) -> Bool {
462462
if _storage !== other._storage {
463-
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
463+
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) -> Bool in
464464
if _storage._value != other_storage._value {return false}
465465
return true
466466
}

Sources/PerfectTensorFlow/pb.compare_test.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ extension CompareTest_Large: SwiftProtobuf._MessageImplementationBase, SwiftProt
617617

618618
public func _protobuf_generated_isEqualTo(other: CompareTest_Large) -> Bool {
619619
if _storage !== other._storage {
620-
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
620+
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) -> Bool in
621621
if _storage._string_ != other_storage._string_ {return false}
622622
if _storage._int64_ != other_storage._int64_ {return false}
623623
if _storage._float_ != other_storage._float_ {return false}

Sources/PerfectTensorFlow/pb.config.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ extension Tensorflow_GraphOptions: SwiftProtobuf._MessageImplementationBase, Swi
10551055

10561056
public func _protobuf_generated_isEqualTo(other: Tensorflow_GraphOptions) -> Bool {
10571057
if _storage !== other._storage {
1058-
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
1058+
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) -> Bool in
10591059
if _storage._enableRecvScheduling != other_storage._enableRecvScheduling {return false}
10601060
if _storage._optimizerOptions != other_storage._optimizerOptions {return false}
10611061
if _storage._buildCostModel != other_storage._buildCostModel {return false}
@@ -1163,7 +1163,7 @@ extension Tensorflow_ConfigProto: SwiftProtobuf._MessageImplementationBase, Swif
11631163

11641164
public func _protobuf_generated_isEqualTo(other: Tensorflow_ConfigProto) -> Bool {
11651165
if _storage !== other._storage {
1166-
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
1166+
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) -> Bool in
11671167
if _storage._deviceCount != other_storage._deviceCount {return false}
11681168
if _storage._intraOpParallelismThreads != other_storage._intraOpParallelismThreads {return false}
11691169
if _storage._interOpParallelismThreads != other_storage._interOpParallelismThreads {return false}
@@ -1225,7 +1225,7 @@ extension Tensorflow_RunOptions: SwiftProtobuf._MessageImplementationBase, Swift
12251225

12261226
public func _protobuf_generated_isEqualTo(other: Tensorflow_RunOptions) -> Bool {
12271227
if _storage !== other._storage {
1228-
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
1228+
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) -> Bool in
12291229
if _storage._traceLevel != other_storage._traceLevel {return false}
12301230
if _storage._timeoutInMs != other_storage._timeoutInMs {return false}
12311231
if _storage._interOpThreadPool != other_storage._interOpThreadPool {return false}
@@ -1281,7 +1281,7 @@ extension Tensorflow_RunMetadata: SwiftProtobuf._MessageImplementationBase, Swif
12811281

12821282
public func _protobuf_generated_isEqualTo(other: Tensorflow_RunMetadata) -> Bool {
12831283
if _storage !== other._storage {
1284-
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
1284+
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) -> Bool in
12851285
if _storage._stepStats != other_storage._stepStats {return false}
12861286
if _storage._costGraph != other_storage._costGraph {return false}
12871287
if _storage._partitionGraphs != other_storage._partitionGraphs {return false}

Sources/PerfectTensorFlow/pb.control_flow.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ extension Tensorflow_CondContextDef: SwiftProtobuf._MessageImplementationBase, S
348348

349349
public func _protobuf_generated_isEqualTo(other: Tensorflow_CondContextDef) -> Bool {
350350
if _storage !== other._storage {
351-
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
351+
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) -> Bool in
352352
if _storage._contextName != other_storage._contextName {return false}
353353
if _storage._predName != other_storage._predName {return false}
354354
if _storage._pivotName != other_storage._pivotName {return false}
@@ -416,7 +416,7 @@ extension Tensorflow_WhileContextDef: SwiftProtobuf._MessageImplementationBase,
416416

417417
public func _protobuf_generated_isEqualTo(other: Tensorflow_WhileContextDef) -> Bool {
418418
if _storage !== other._storage {
419-
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
419+
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) -> Bool in
420420
if _storage._contextName != other_storage._contextName {return false}
421421
if _storage._parallelIterations != other_storage._parallelIterations {return false}
422422
if _storage._backProp != other_storage._backProp {return false}

Sources/PerfectTensorFlow/pb.cost_graph.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ extension Tensorflow_CostGraphDef.Node.OutputInfo: SwiftProtobuf._MessageImpleme
411411

412412
public func _protobuf_generated_isEqualTo(other: Tensorflow_CostGraphDef.Node.OutputInfo) -> Bool {
413413
if _storage !== other._storage {
414-
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
414+
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) -> Bool in
415415
if _storage._size != other_storage._size {return false}
416416
if _storage._aliasInputPort != other_storage._aliasInputPort {return false}
417417
if _storage._shape != other_storage._shape {return false}

Sources/PerfectTensorFlow/pb.cpp_shape_inference.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ extension Tensorflow_CppShapeInferenceResult: SwiftProtobuf._MessageImplementati
165165

166166
public func _protobuf_generated_isEqualTo(other: Tensorflow_CppShapeInferenceResult) -> Bool {
167167
if _storage !== other._storage {
168-
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
168+
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) -> Bool in
169169
if _storage._shape != other_storage._shape {return false}
170170
if _storage._handleShape != other_storage._handleShape {return false}
171171
if _storage._handleDtype != other_storage._handleDtype {return false}

Sources/PerfectTensorFlow/pb.device_attributes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ extension Tensorflow_DeviceAttributes: SwiftProtobuf._MessageImplementationBase,
213213

214214
public func _protobuf_generated_isEqualTo(other: Tensorflow_DeviceAttributes) -> Bool {
215215
if _storage !== other._storage {
216-
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
216+
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) -> Bool in
217217
if _storage._name != other_storage._name {return false}
218218
if _storage._deviceType != other_storage._deviceType {return false}
219219
if _storage._memoryLimit != other_storage._memoryLimit {return false}

Sources/PerfectTensorFlow/pb.event.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ extension Tensorflow_Event: SwiftProtobuf._MessageImplementationBase, SwiftProto
500500

501501
public func _protobuf_generated_isEqualTo(other: Tensorflow_Event) -> Bool {
502502
if _storage !== other._storage {
503-
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) in
503+
let storagesAreEqual: Bool = withExtendedLifetime((_storage, other._storage)) { (_storage, other_storage) -> Bool in
504504
if _storage._wallTime != other_storage._wallTime {return false}
505505
if _storage._step != other_storage._step {return false}
506506
if _storage._what != other_storage._what {return false}

0 commit comments

Comments
 (0)