Skip to content

Commit ce99bc8

Browse files
committed
reformat
1 parent a7dc692 commit ce99bc8

51 files changed

Lines changed: 91 additions & 91 deletions

File tree

Some content is hidden

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

Package.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func getJavaHomeFromLibexecJavaHome() -> String? {
6464

6565
let pipe = Pipe()
6666
task.standardOutput = pipe
67-
task.standardError = pipe // Redirect standard error to the same pipe for simplicity
67+
task.standardError = pipe // Redirect standard error to the same pipe for simplicity
6868

6969
do {
7070
try task.run()
@@ -265,7 +265,7 @@ let package = Package(
265265
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.5.0"),
266266
.package(url: "https://github.com/apple/swift-system", from: "1.4.0"),
267267
.package(url: "https://github.com/apple/swift-log", from: "1.2.0"),
268-
.package(url: "https://github.com/apple/swift-collections", .upToNextMinor(from: "1.3.0")), // primarily for ordered collections
268+
.package(url: "https://github.com/apple/swift-collections", .upToNextMinor(from: "1.3.0")), // primarily for ordered collections
269269
.package(url: "https://github.com/swiftlang/swift-subprocess.git", from: "0.2.1", traits: ["SubprocessFoundation"]),
270270

271271
// Benchmarking
@@ -312,7 +312,7 @@ let package = Package(
312312
["-I\(javaIncludePath)", "-I\(javaPlatformIncludePath)"],
313313
.when(platforms: [.macOS, .linux, .windows])
314314
),
315-
.unsafeFlags(["-Xfrontend", "-sil-verify-none"], .when(configuration: .release)), // Workaround for https://github.com/swiftlang/swift/issues/84899
315+
.unsafeFlags(["-Xfrontend", "-sil-verify-none"], .when(configuration: .release)), // Workaround for https://github.com/swiftlang/swift/issues/84899
316316
],
317317
linkerSettings: [
318318
.unsafeFlags(

Plugins/JExtractSwiftPlugin/JExtractSwiftPlugin.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ struct JExtractSwiftBuildToolPlugin: SwiftJavaPluginProtocol, BuildToolPlugin {
184184
log("Forward environment: \(gradlewEnvironment)")
185185

186186
let gradleExecutable =
187-
findExecutable(name: "gradle") // try using installed 'gradle' if available in PATH
188-
?? swiftJavaDirectory.appending(path: "gradlew") // fallback to calling ./gradlew if gradle is not installed
187+
findExecutable(name: "gradle") // try using installed 'gradle' if available in PATH
188+
?? swiftJavaDirectory.appending(path: "gradlew") // fallback to calling ./gradlew if gradle is not installed
189189
log("Detected 'gradle' executable (or gradlew fallback): \(gradleExecutable)")
190190

191191
commands += [

Plugins/JavaCompilerPlugin/JavaCompilerPlugin.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ struct JavaCompilerBuildToolPlugin: BuildToolPlugin {
8282
.appending(path: javac),
8383
arguments: javaFiles.map { $0.path } + [
8484
"-d", javaClassFileURL.path,
85-
"-parameters", // keep parameter names, which allows us to emit them in generated Swift decls
85+
"-parameters", // keep parameter names, which allows us to emit them in generated Swift decls
8686
] + (config?.compilerVersionArgs ?? []),
8787
inputFiles: javaFiles,
88-
outputFiles: classFiles // FIXME: this is not quite enough, javac may generate more files for closures etc, which we don't know about unless we compile first
88+
outputFiles: classFiles // FIXME: this is not quite enough, javac may generate more files for closures etc, which we don't know about unless we compile first
8989
)
9090
]
9191
}

Samples/JavaDependencySampleApp/Sources/JavaDependencySample/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ print("-----------------------------------------------------------------------")
2626
print("Start Sample app...")
2727

2828
// TODO: locating the classpath is more complex, need to account for dependencies of our module
29-
let swiftJavaClasspath = findSwiftJavaClasspaths() // scans for .classpath files
29+
let swiftJavaClasspath = findSwiftJavaClasspaths() // scans for .classpath files
3030

3131
// 1) Start a JVM with appropriate classpath
3232
let jvm = try JavaVirtualMachine.shared(classpath: swiftJavaClasspath)

Samples/JavaSieve/Sources/JavaSieve/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ do {
2323
print("Found prime: \(prime.intValue())")
2424
}
2525

26-
_ = try JavaClass<RoundingMode>().HALF_UP // can import a Java enum value
26+
_ = try JavaClass<RoundingMode>().HALF_UP // can import a Java enum value
2727
} catch {
2828
print("Failure: \(error)")
2929
}

Sources/JExtractSwiftLib/Convenience/SwiftSyntax+Extensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ class TriviaSanitizingDescriptionVisitor: SyntaxVisitor {
290290
override func visit(_ node: TokenSyntax) -> SyntaxVisitorContinueKind {
291291
let tokenKind = node.tokenKind
292292
switch (prevTokenKind, tokenKind) {
293-
case // No whitespace after open parentheses.
293+
case // No whitespace after open parentheses.
294294
(.leftAngle, _), (.leftParen, _), (.leftSquare, _), (.endOfFile, _),
295295
// No whitespace before close parentheses.
296296
(_, .rightAngle), (_, .rightParen), (_, .rightSquare):

Sources/JExtractSwiftLib/FFM/CDeclLowering/FFMSwift2JavaGenerator+FunctionLowering.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ struct CdeclLowering {
797797
let resultName = "_result"
798798

799799
return LoweredResult(
800-
cdeclResultType: .void, // we call into the _result_initialize instead
800+
cdeclResultType: .void, // we call into the _result_initialize instead
801801
cdeclOutParameters: [
802802
SwiftParameter(
803803
convention: .byValue,
@@ -817,7 +817,7 @@ struct CdeclLowering {
817817
parameters: [.placeholder],
818818
result: .method(
819819
base: "\(outParameterName)_initialize",
820-
methodName: nil, // just `(...)` apply the closure
820+
methodName: nil, // just `(...)` apply the closure
821821
arguments: [
822822
.init(label: nil, argument: .member(.constant("_0"), member: "baseAddress!")),
823823
.init(label: nil, argument: .member(.constant("_0"), member: "count")),

Sources/JExtractSwiftLib/FFM/ConversionStep.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ enum ConversionStep: Equatable {
190190
if let methodName {
191191
".\(methodName)"
192192
} else {
193-
"" // this is equivalent to calling `base(...)`
193+
"" // this is equivalent to calling `base(...)`
194194
}
195195

196196
if let base {

Sources/JExtractSwiftLib/FFM/FFMSwift2JavaGenerator+JavaBindingsPrinting.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ extension FFMSwift2JavaGenerator {
4747
printJavaBindingDescriptorClass(&printer, cFunc) { printer in
4848
if let outCallback = translated.translatedSignature.result.outCallback {
4949
self.printUpcallParameterDescriptorClasses(&printer, outCallback)
50-
} else { // FIXME: not an "else"
50+
} else { // FIXME: not an "else"
5151
self.printParameterDescriptorClasses(&printer, cFunc)
5252
}
5353
}
@@ -120,7 +120,7 @@ extension FFMSwift2JavaGenerator {
120120
var params: [String] = []
121121
var args: [String] = []
122122
for param in cFunc.parameters {
123-
let name = param.name! // !-safe, because cdecl lowering guarantees the parameter named.
123+
let name = param.name! // !-safe, because cdecl lowering guarantees the parameter named.
124124

125125
let annotationsStr =
126126
if param.type.javaType.parameterAnnotations.isEmpty {
@@ -484,7 +484,7 @@ extension FFMSwift2JavaGenerator {
484484
let placeholderForDowncall: String?
485485

486486
if let outCallback = translatedSignature.result.outCallback {
487-
placeholder = "\(outCallback.name)" // the result will be read out from the _result_initialize java class
487+
placeholder = "\(outCallback.name)" // the result will be read out from the _result_initialize java class
488488
placeholderForDowncall = "\(downCall)"
489489
} else if translatedSignature.result.outParameters.isEmpty {
490490
placeholder = downCall
@@ -504,8 +504,8 @@ extension FFMSwift2JavaGenerator {
504504
if translatedSignature.result.javaResultType != .void {
505505
switch translatedSignature.result.conversion {
506506
case .initializeResultWithUpcall(_, let extractResult):
507-
printer.print("\(result);") // the result in the callback situation is a series of setup steps
508-
printer.print("return \(extractResult.render(&printer, placeholder));") // extract the actual result
507+
printer.print("\(result);") // the result in the callback situation is a series of setup steps
508+
printer.print("return \(extractResult.render(&printer, placeholder));") // extract the actual result
509509
default:
510510
printer.print("return \(result);")
511511
}
@@ -613,7 +613,7 @@ extension FFMSwift2JavaGenerator.JavaConversionStep {
613613
case .placeholderForSwiftThunkName:
614614
if let placeholderForDowncall {
615615
let downcall = "\(placeholderForDowncall)"
616-
return String(downcall[..<(downcall.firstIndex(of: ".") ?? downcall.endIndex)]) // . separates thunk name from the `.call`
616+
return String(downcall[..<(downcall.firstIndex(of: ".") ?? downcall.endIndex)]) // . separates thunk name from the `.call`
617617
} else {
618618
return "/*placeholderForDowncall undefined!*/"
619619
}

Sources/JExtractSwiftLib/FFM/FFMSwift2JavaGenerator+JavaTranslation.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ extension FFMSwift2JavaGenerator {
500500
.commaSeparated([.constant("ValueLayout.JAVA_BYTE"), .placeholder]),
501501
base: .temporaryArena,
502502
function: "allocateFrom",
503-
withArena: false // this would pass the arena as last argument, but instead we make a call on the arena
503+
withArena: false // this would pass the arena as last argument, but instead we make a call on the arena
504504
),
505505
.property(.placeholder, propertyName: "length"),
506506
])
@@ -654,7 +654,7 @@ extension FFMSwift2JavaGenerator {
654654
)
655655

656656
case .foundationData, .essentialsData:
657-
break // Implemented as wrapper
657+
break // Implemented as wrapper
658658

659659
case .unsafePointer, .unsafeMutablePointer:
660660
// FIXME: Implement
@@ -694,7 +694,7 @@ extension FFMSwift2JavaGenerator {
694694
javaResultType:
695695
.array(.byte),
696696
annotations: [.unsigned],
697-
outParameters: [], // no out parameters, but we do an "out" callback
697+
outParameters: [], // no out parameters, but we do an "out" callback
698698
outCallback: OutCallback(
699699
name: "$_result_initialize",
700700
members: [
@@ -733,7 +733,7 @@ extension FFMSwift2JavaGenerator {
733733
)
734734
),
735735
// .constant("var = new \(.placeholderForDowncallThunkName).."),
736-
.placeholderForDowncall, // perform the downcall here
736+
.placeholderForDowncall, // perform the downcall here
737737
],
738738
extractResult: .property(.constant("_result_initialize"), propertyName: "result")
739739
)
@@ -880,7 +880,7 @@ extension CType {
880880
case .integral(.signed(bits: 32)): return .int
881881
case .integral(.signed(bits: 64)): return .long
882882
case .integral(.unsigned(bits: 8)): return .byte
883-
case .integral(.unsigned(bits: 16)): return .char // char is Java's only unsigned primitive, we can use it!
883+
case .integral(.unsigned(bits: 16)): return .char // char is Java's only unsigned primitive, we can use it!
884884
case .integral(.unsigned(bits: 32)): return .int
885885
case .integral(.unsigned(bits: 64)): return .long
886886

0 commit comments

Comments
 (0)