aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-03 16:06:47 +0200
committerSven Gothel <[email protected]>2014-07-03 16:06:47 +0200
commitdf9ff7f340a5ab4e07efc613f5f264eeae63d4c7 (patch)
tree239ae276b82024b140428e6c0fe5d739fdd686a4 /src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java
parenteb47aaba63e3b1bf55f274a0f338f1010a017ae4 (diff)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
Diffstat (limited to 'src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java')
-rw-r--r--src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java
index 49ff4fc..351e0cd 100644
--- a/src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java
+++ b/src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java
@@ -55,8 +55,8 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter {
private static final String procAddressJavaTypeName = JavaType.createForClass(Long.TYPE).jniTypeName();
private ProcAddressEmitter emitter;
- public ProcAddressCMethodBindingEmitter(CMethodBindingEmitter methodToWrap, final boolean callThroughProcAddress,
- boolean needsLocalTypedef, String localTypedefCallingConvention, ProcAddressEmitter emitter) {
+ public ProcAddressCMethodBindingEmitter(final CMethodBindingEmitter methodToWrap, final boolean callThroughProcAddress,
+ final boolean needsLocalTypedef, final String localTypedefCallingConvention, final ProcAddressEmitter emitter) {
super(
new MethodBinding(methodToWrap.getBinding()) {
@@ -97,7 +97,7 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter {
}
@Override
- protected int emitArguments(PrintWriter writer) {
+ protected int emitArguments(final PrintWriter writer) {
int numEmitted = super.emitArguments(writer);
if (callThroughProcAddress) {
if (numEmitted > 0) {
@@ -112,11 +112,11 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter {
}
@Override
- protected void emitBodyVariableDeclarations(PrintWriter writer) {
+ protected void emitBodyVariableDeclarations(final PrintWriter writer) {
if (callThroughProcAddress) {
// create variable for the function pointer with the right type, and set
// it to the value of the passed-in proc address
- FunctionSymbol cSym = getBinding().getCSymbol();
+ final FunctionSymbol cSym = getBinding().getCSymbol();
String funcPointerTypedefName =
emitter.getFunctionPointerTypedefName(cSym);
@@ -124,7 +124,7 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter {
// We (probably) didn't get a typedef for this function
// pointer type in the header file; the user requested that we
// forcibly generate one. Here we force the emission of one.
- PointerType funcPtrType = new PointerType(null, cSym.getType(), 0);
+ final PointerType funcPtrType = new PointerType(null, cSym.getType(), 0);
// Just for safety, emit this name slightly differently than
// the mangling would otherwise produce
funcPointerTypedefName = "_local_" + funcPointerTypedefName;
@@ -145,18 +145,18 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter {
}
@Override
- protected void emitBodyVariablePreCallSetup(PrintWriter writer) {
+ protected void emitBodyVariablePreCallSetup(final PrintWriter writer) {
super.emitBodyVariablePreCallSetup(writer);
if (callThroughProcAddress) {
// set the function pointer to the value of the passed-in procAddress
- FunctionSymbol cSym = getBinding().getCSymbol();
+ final FunctionSymbol cSym = getBinding().getCSymbol();
String funcPointerTypedefName = emitter.getFunctionPointerTypedefName(cSym);
if (needsLocalTypedef) {
funcPointerTypedefName = "_local_" + funcPointerTypedefName;
}
- String ptrVarName = "ptr_" + cSym.getName();
+ final String ptrVarName = "ptr_" + cSym.getName();
writer.print(" ");
writer.print(ptrVarName);
@@ -169,7 +169,7 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter {
}
@Override
- protected void emitBodyCallCFunction(PrintWriter writer) {
+ protected void emitBodyCallCFunction(final PrintWriter writer) {
if (!callThroughProcAddress) {
super.emitBodyCallCFunction(writer);
} else {
@@ -178,12 +178,12 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter {
// WARNING: this code assumes that the return type has already been
// typedef-resolved.
- Type cReturnType = binding.getCReturnType();
+ final Type cReturnType = binding.getCReturnType();
if (!cReturnType.isVoid()) {
writer.print("_res = ");
}
- MethodBinding mBinding = getBinding();
+ final MethodBinding mBinding = getBinding();
if (mBinding.hasContainingType()) {
// FIXME: this can and should be handled and unified with the
// associated code in the CMethodBindingEmitter
@@ -201,8 +201,8 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter {
}
@Override
- protected String jniMangle(MethodBinding binding) {
- StringBuilder buf = new StringBuilder(super.jniMangle(binding));
+ protected String jniMangle(final MethodBinding binding) {
+ final StringBuilder buf = new StringBuilder(super.jniMangle(binding));
if (callThroughProcAddress) {
jniMangle(Long.TYPE, buf, false); // to account for the additional _addr_ parameter
}