summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-06-16 01:10:46 +0200
committerSven Gothel <[email protected]>2023-06-16 01:10:46 +0200
commit0a9105dd3ebbcf4b98664e50333334bff677031c (patch)
treef88ee400fa386e6f98b1336c2428f8ebcd6a3c72 /src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java
parentf1678c4ac8b85c85d11b737d08dcfe31b388e021 (diff)
GlueGen Struct [3]: Adopt to CodeUnit Abstraction (replacing plain PrintWriter...)
Diffstat (limited to 'src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java')
-rw-r--r--src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java
index 5298a8d..0d5de1c 100644
--- a/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java
+++ b/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2010-2023 JogAmp Community. All rights reserved.
* Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -90,15 +91,15 @@ public class ProcAddressJavaMethodBindingEmitter extends JavaMethodBindingEmitte
}
@Override
- protected int emitArguments(final PrintWriter writer) {
- int numEmitted = super.emitArguments(writer);
+ protected int emitArguments() {
+ int numEmitted = super.emitArguments();
if (callThroughProcAddress) {
if (changeNameAndArguments) {
if (numEmitted > 0) {
- writer.print(", ");
+ unit.emit(", ");
}
- writer.print("long procAddress");
+ unit.emit("long procAddress");
++numEmitted;
}
}
@@ -116,27 +117,27 @@ public class ProcAddressJavaMethodBindingEmitter extends JavaMethodBindingEmitte
}
@Override
- protected void emitPreCallSetup(final MethodBinding binding, final PrintWriter writer) {
- super.emitPreCallSetup(binding, writer);
+ protected void emitPreCallSetup(final MethodBinding binding) {
+ super.emitPreCallSetup(binding);
if (callThroughProcAddress) {
final String procAddressVariable = ProcAddressEmitter.PROCADDRESS_VAR_PREFIX + binding.getNativeName();
- writer.println(" final long __addr_ = " + getProcAddressTableExpr + "." + procAddressVariable + ";");
- writer.println(" if (__addr_ == 0) {");
- writer.format(" throw new %s(String.format(\"Method \\\"%%s\\\" not available\", \"%s\"));%n",
+ unit.emitln(" final long __addr_ = " + getProcAddressTableExpr + "." + procAddressVariable + ";");
+ unit.emitln(" if (__addr_ == 0) {");
+ unit.emitf(" throw new %s(String.format(\"Method \\\"%%s\\\" not available\", \"%s\"));%n",
emitter.unsupportedExceptionType(), binding.getName());
- writer.println(" }");
+ unit.emitln(" }");
}
}
@Override
- protected int emitCallArguments(final MethodBinding binding, final PrintWriter writer) {
- int numEmitted = super.emitCallArguments(binding, writer);
+ protected int emitCallArguments(final MethodBinding binding) {
+ int numEmitted = super.emitCallArguments(binding);
if (callThroughProcAddress) {
if (numEmitted > 0) {
- writer.print(", ");
+ unit.emit(", ");
}
- writer.print("__addr_");
+ unit.emit("__addr_");
++numEmitted;
}