Skip to content

Commit 6e30409

Browse files
committed
Swift: Autoformat.
1 parent 234f17b commit 6e30409

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

swift/ql/lib/codeql/swift/frameworks/StandardLibrary/PointerTypes.qll

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,22 @@ class PointerType extends Type {
2626
* `UnsafeMutablePointer` or `UnsafeBufferPointer`.
2727
*/
2828
class UnsafeTypedPointerType extends BoundGenericType {
29-
UnsafeTypedPointerType() {
30-
this.getName().regexpMatch("Unsafe(Mutable|)(Buffer|)Pointer<.*")
31-
}
29+
UnsafeTypedPointerType() { this.getName().regexpMatch("Unsafe(Mutable|)(Buffer|)Pointer<.*") }
3230
}
3331

3432
/**
3533
* A Swift unsafe raw pointer type such as `UnsafeRawPointer`,
3634
* `UnsafeMutableRawPointer` or `UnsafeRawBufferPointer`.
3735
*/
3836
class UnsafeRawPointerType extends NominalType {
39-
UnsafeRawPointerType() {
40-
this.getName().regexpMatch("Unsafe(Mutable|)Raw(Buffer|)Pointer")
41-
}
37+
UnsafeRawPointerType() { this.getName().regexpMatch("Unsafe(Mutable|)Raw(Buffer|)Pointer") }
4238
}
4339

4440
/**
4541
* A Swift `OpaquePointer`.
4642
*/
4743
class OpaquePointerType extends NominalType {
48-
OpaquePointerType() {
49-
this.getName() = "OpaquePointer"
50-
}
44+
OpaquePointerType() { this.getName() = "OpaquePointer" }
5145
}
5246

5347
/**
@@ -63,25 +57,19 @@ class AutoreleasingUnsafeMutablePointerType extends BoundGenericType {
6357
* A Swift `Unmanaged` object reference.
6458
*/
6559
class UnmanagedType extends BoundGenericType {
66-
UnmanagedType() {
67-
this.getName().matches("Unmanaged<%")
68-
}
60+
UnmanagedType() { this.getName().matches("Unmanaged<%") }
6961
}
7062

7163
/**
7264
* A Swift `CVaListPointer`.
7365
*/
7466
class CVaListPointerType extends NominalType {
75-
CVaListPointerType() {
76-
this.getName() = "CVaListPointer"
77-
}
67+
CVaListPointerType() { this.getName() = "CVaListPointer" }
7868
}
7969

8070
/**
8171
* A Swift `ManagedBufferPointer`.
8272
*/
8373
class ManagedBufferPointerType extends BoundGenericType {
84-
ManagedBufferPointerType() {
85-
this.getName().matches("ManagedBufferPointer<%")
86-
}
74+
ManagedBufferPointerType() { this.getName().matches("ManagedBufferPointer<%") }
8775
}

swift/ql/test/library-tests/elements/type/pointertypes/pointertypes.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ string describe(Type t) {
1212
or
1313
t instanceof OpaquePointerType and result = "OpaquePointerType"
1414
or
15-
t instanceof AutoreleasingUnsafeMutablePointerType and result = "AutoreleasingUnsafeMutablePointerType"
15+
t instanceof AutoreleasingUnsafeMutablePointerType and
16+
result = "AutoreleasingUnsafeMutablePointerType"
1617
or
1718
t instanceof UnmanagedType and result = "UnmanagedType"
1819
or

0 commit comments

Comments
 (0)