Skip to content

Commit 9c41054

Browse files
committed
Change pointer() to $memoryAddress
1 parent cbfb56d commit 9c41054

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

Sources/JExtractSwiftLib/JNI/JNISwift2JavaGenerator+JavaBindingsPrinting.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ extension JNISwift2JavaGenerator {
212212

213213
printer.print(
214214
"""
215-
long selfPointer = this.pointer();
215+
long self$ = this.$memoryAddress();
216216
\(returnKeyword)\(translatedDecl.parentName).$\(translatedDecl.name)(\(arguments.joined(separator: ", ")));
217217
"""
218218
)

Tests/JExtractSwiftTests/JNI/JNIClassTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ struct JNIClassTests {
7070
"""
7171
@Override
7272
protected Runnable $createDestroyFunction() {
73-
long $selfPointer = this.pointer();
73+
long $self = this.$memoryAddress();
7474
return new Runnable() {
7575
@Override
7676
public void run() {
77-
MyClass.$destroy($selfPointer);
77+
MyClass.$destroy($self);
7878
}
7979
};
8080
}
@@ -224,8 +224,8 @@ struct JNIClassTests {
224224
* }
225225
*/
226226
public void doSomething(long x) {
227-
long selfPointer = this.pointer();
228-
MyClass.$doSomething(x, selfPointer);
227+
long self$ = this.$memoryAddress();
228+
MyClass.$doSomething(x, self$);
229229
}
230230
""",
231231
"""

Tests/JExtractSwiftTests/JNI/JNIVariablesTests.swift

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ struct JNIVariablesTests {
4848
* }
4949
*/
5050
public long getConstant() {
51-
long selfPointer = this.pointer();
52-
return MyClass.$getConstant(selfPointer);
51+
long self$ = this.$memoryAddress();
52+
return MyClass.$getConstant(self$);
5353
}
5454
""",
5555
"""
@@ -94,8 +94,8 @@ struct JNIVariablesTests {
9494
* }
9595
*/
9696
public long getMutable() {
97-
long selfPointer = this.pointer();
98-
return MyClass.$getMutable(selfPointer);
97+
long self$ = this.$memoryAddress();
98+
return MyClass.$getMutable(self$);
9999
}
100100
""",
101101
"""
@@ -106,8 +106,8 @@ struct JNIVariablesTests {
106106
* }
107107
*/
108108
public void setMutable(long newValue) {
109-
long selfPointer = this.pointer();
110-
MyClass.$setMutable(newValue, selfPointer);
109+
long self$ = this.$memoryAddress();
110+
MyClass.$setMutable(newValue, self$);
111111
}
112112
""",
113113
"""
@@ -163,8 +163,8 @@ struct JNIVariablesTests {
163163
* }
164164
*/
165165
public long getComputed() {
166-
long selfPointer = this.pointer();
167-
return MyClass.$getComputed(selfPointer);
166+
long self$ = this.$memoryAddress();
167+
return MyClass.$getComputed(self$);
168168
}
169169
""",
170170
"""
@@ -210,8 +210,8 @@ struct JNIVariablesTests {
210210
* }
211211
*/
212212
public long getComputedThrowing() throws Exception {
213-
long selfPointer = this.pointer();
214-
return MyClass.$getComputedThrowing(selfPointer);
213+
long self$ = this.$memoryAddress();
214+
return MyClass.$getComputedThrowing(self$);
215215
}
216216
""",
217217
"""
@@ -262,8 +262,8 @@ struct JNIVariablesTests {
262262
* }
263263
*/
264264
public long getGetterAndSetter() {
265-
long selfPointer = this.pointer();
266-
return MyClass.$getGetterAndSetter(selfPointer);
265+
long self$ = this.$memoryAddress();
266+
return MyClass.$getGetterAndSetter(self$);
267267
}
268268
""",
269269
"""
@@ -274,8 +274,8 @@ struct JNIVariablesTests {
274274
* }
275275
*/
276276
public void setGetterAndSetter(long newValue) {
277-
long selfPointer = this.pointer();
278-
MyClass.$setGetterAndSetter(newValue, selfPointer);
277+
long self$ = this.$memoryAddress();
278+
MyClass.$setGetterAndSetter(newValue, self$);
279279
}
280280
""",
281281
"""
@@ -331,8 +331,8 @@ struct JNIVariablesTests {
331331
* }
332332
*/
333333
public boolean isSomeBoolean() {
334-
long selfPointer = this.pointer();
335-
return MyClass.$isSomeBoolean(selfPointer);
334+
long self$ = this.$memoryAddress();
335+
return MyClass.$isSomeBoolean(self$);
336336
}
337337
""",
338338
"""
@@ -343,8 +343,8 @@ struct JNIVariablesTests {
343343
* }
344344
*/
345345
public void setSomeBoolean(boolean newValue) {
346-
long selfPointer = this.pointer();
347-
MyClass.$setSomeBoolean(newValue, selfPointer);
346+
long self$ = this.$memoryAddress();
347+
MyClass.$setSomeBoolean(newValue, self$);
348348
}
349349
""",
350350
"""

0 commit comments

Comments
 (0)