diff options
Diffstat (limited to 'src/java/com/jogamp/gluegen')
56 files changed, 607 insertions, 607 deletions
diff --git a/src/java/com/jogamp/gluegen/ArrayTypes.java b/src/java/com/jogamp/gluegen/ArrayTypes.java index 78122f1..d15e170 100644 --- a/src/java/com/jogamp/gluegen/ArrayTypes.java +++ b/src/java/com/jogamp/gluegen/ArrayTypes.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java index 022cf53..7ae3192 100644 --- a/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java +++ b/src/java/com/jogamp/gluegen/CMethodBindingEmitter.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -57,7 +57,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { protected static final String arrayResLength = "_array_res_length"; protected static final String arrayRes = "_array_res"; protected static final String arrayIdx = "_array_idx"; - + protected MethodBinding binding; /** Name of the package in which the corresponding Java method resides.*/ @@ -99,13 +99,13 @@ public class CMethodBindingEmitter extends FunctionEmitter { * == false; */ private MessageFormat returnValueCapacityExpression = null; - + /** * Length of the returned array. Is ignored if * binding.getJavaReturnType().isArray() is false. */ private MessageFormat returnValueLengthExpression = null; - + protected static final String STRING_CHARS_PREFIX = "_strchars_"; // We need this in order to compute sizes of certain types @@ -119,7 +119,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { public CMethodBindingEmitter(MethodBinding binding, PrintWriter output, String javaPackageName, - String javaClassName, + String javaClassName, boolean isOverloadedBinding, boolean isJavaMethodStatic, boolean forImplementingMethodCall, @@ -131,7 +131,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { assert(binding != null); assert(javaClassName != null); assert(javaPackageName != null); - + this.binding = binding; this.packageName = javaPackageName; this.className = javaClassName; @@ -142,7 +142,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { this.forIndirectBufferAndArrayImplementation = forIndirectBufferAndArrayImplementation; this.machDesc = machDesc; - setCommentEmitter(defaultCommentEmitter); + setCommentEmitter(defaultCommentEmitter); } public final MethodBinding getBinding() { return binding; } @@ -177,12 +177,12 @@ public class CMethodBindingEmitter extends FunctionEmitter { */ public final void setReturnValueCapacityExpression(MessageFormat expression) { returnValueCapacityExpression = expression; - + if (!binding.getJavaReturnType().isNIOBuffer() && !binding.getJavaReturnType().isCompoundTypeWrapper()) { throw new IllegalArgumentException( "Cannot specify return value capacity for a method that does not " + - "return java.nio.Buffer or a compound type wrapper: \"" + binding + "\""); + "return java.nio.Buffer or a compound type wrapper: \"" + binding + "\""); } } @@ -210,12 +210,12 @@ public class CMethodBindingEmitter extends FunctionEmitter { */ public final void setReturnValueLengthExpression(MessageFormat expression) { returnValueLengthExpression = expression; - + if (!binding.getJavaReturnType().isArray() && !binding.getJavaReturnType().isArrayOfCompoundTypeWrappers()) { throw new IllegalArgumentException( "Cannot specify return value length for a method that does not " + - "return an array: \"" + binding + "\""); + "return an array: \"" + binding + "\""); } } @@ -291,7 +291,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { public final MachineDescription getMachineDescription() { return machDesc; } - protected void emitReturnType(PrintWriter writer) { + protected void emitReturnType(PrintWriter writer) { writer.print("JNIEXPORT "); writer.print(binding.getJavaReturnType().jniTypeName()); writer.print(" JNICALL"); @@ -336,7 +336,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { } writer.print(" _unused"); ++numEmitted; - + if (binding.hasContainingType()) { // "this" argument always comes down in argument 0 as direct buffer writer.print(", jobject " + JavaMethodBindingEmitter.javaThisArgumentName()); @@ -349,7 +349,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { // there's something wrong with our parsing of the headers. assert(binding.getNumArguments() == 1); continue; - } + } if (javaArgType.isJNIEnv() || binding.isArgumentThisPointer(i)) { continue; } @@ -366,21 +366,21 @@ public class CMethodBindingEmitter extends FunctionEmitter { writer.print(", jboolean " + isNIOArgName(i)); } } else if (javaArgType.isNIOBufferArray()) { - writer.print(", jintArray " + + writer.print(", jintArray " + byteOffsetArrayArgName(i)); } } return numEmitted; } - - protected void emitBody(PrintWriter writer) { + + protected void emitBody(PrintWriter writer) { writer.println(" {"); // writer.println("printf(\" - - - - "+ getName() + getImplSuffix() +" - - - -\\n\");"); emitBodyVariableDeclarations(writer); emitBodyUserVariableDeclarations(writer); emitBodyVariablePreCallSetup(writer); - emitBodyCallCFunction(writer); + emitBodyCallCFunction(writer); emitBodyUserVariableAssignments(writer); emitBodyVariablePostCallCleanup(writer); emitBodyReturnResult(writer); @@ -416,12 +416,12 @@ public class CMethodBindingEmitter extends FunctionEmitter { convName, javaArgName); if (needsDataCopy && !emittedDataCopyTemps) { // emit loop counter and array length variables used during data - // copy + // copy writer.println(" jobject _tmpObj;"); writer.println(" int _copyIndex;"); writer.println(" jsize _tmpArrayLen;"); - // Pointer to the data in the Buffer, taking the offset into account + // Pointer to the data in the Buffer, taking the offset into account writer.println(" int * _offsetHandle = NULL;"); emittedDataCopyTemps = true; @@ -437,7 +437,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { writer.print(binding.getArgumentName(i)); writer.println(" = NULL;"); } - + } // Emit declaration for return value if necessary @@ -467,7 +467,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { Class<?> componentType = javaReturnType.getJavaClass().getComponentType(); if (componentType.isArray()) { - throw new RuntimeException("Multi-dimensional arrays not supported yet"); + throw new RuntimeException("Multi-dimensional arrays not supported yet"); } String javaTypeName = componentType.getName(); @@ -478,7 +478,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { writer.print(arrayRes); writer.println(";"); } - } + } } /** Emits the user-defined C variable declarations from the @@ -563,7 +563,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { CMethodBindingEmitter.cThisArgumentName(), null); } - + // Convert all arrays to pointers, and get UTF-8 versions of jstring args for (int i = 0; i < binding.getNumArguments(); i++) { JavaType javaArgType = binding.getJavaArgumentType(i); @@ -598,9 +598,9 @@ public class CMethodBindingEmitter extends FunctionEmitter { if (javaArgType.isStringArray()) { // java-side type is String[] cArgTypeName = "jstring *"; - } + } writer.print(cArgTypeName); - writer.print(") ( JNI_TRUE == " + isNIOArgName(i) + " ? "); + writer.print(") ( JNI_TRUE == " + isNIOArgName(i) + " ? "); writer.print(" (*env)->GetDirectBufferAddress(env, " + javaArgName + ") : "); writer.print(" (*env)->GetPrimitiveArrayCritical(env, " + javaArgName + ", NULL) );"); } else { @@ -675,7 +675,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { writer.println(" /* get each element of the array argument \"" + javaArgName + "\" */"); writer.print(" _tmpObj = (*env)->GetObjectArrayElement(env, "); writer.print(javaArgName); - writer.println(", _copyIndex);"); + writer.println(", _copyIndex);"); if (javaArgType.isStringArray()) { writer.print(" "); @@ -722,20 +722,20 @@ public class CMethodBindingEmitter extends FunctionEmitter { throw new RuntimeException("Cannot yet handle type \"" + cArgType.getName() + "\"; need to add support for copying ptr-to-ptr-to-primitiveType subarrays"); } - + } writer.println(" }"); if (javaArgType.isNIOBufferArray()) { writer.println - (" (*env)->ReleasePrimitiveArrayCritical(env, " + - byteOffsetArrayArgName(i) + + (" (*env)->ReleasePrimitiveArrayCritical(env, " + + byteOffsetArrayArgName(i) + ", _offsetHandle, JNI_ABORT);"); } writer.println(); } // end of data copy - + writer.println(" }"); } else if (javaArgType.isString()) { @@ -747,7 +747,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { } } - + /** * Code to clean up any variables that were declared in * emitBodyVariableDeclarations(), AFTER calling the actual C function. @@ -775,7 +775,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { writer.println(" if ( JNI_FALSE == " + isNIOArgName(i) + " && NULL != " + javaArgName + " ) {"); // Release array - final String modeFlag = isConstPtr(cArgType) || isConstPtrPtr(cArgType) ? "JNI_ABORT" : "0" ; + final String modeFlag = isConstPtr(cArgType) || isConstPtrPtr(cArgType) ? "JNI_ABORT" : "0" ; writer.print(" (*env)->ReleasePrimitiveArrayCritical(env, " + javaArgName + ", " + convName + ", "+modeFlag+");"); } else { writer.println(" if ( NULL != " + javaArgName + " ) {"); @@ -790,7 +790,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { // FIXME: handle any cleanup from treatment of non-const args, // assuming they were treated differently in // emitBodyVariablePreCallSetup() (see the similar section in that - // method for details). + // method for details). if (javaArgType.isArrayOfCompoundTypeWrappers()) { // This is the only form of cleanup we handle right now writer.println(" _tmpArrayLen = (*env)->GetArrayLength(env, " + javaArgName + ");"); @@ -839,26 +839,26 @@ public class CMethodBindingEmitter extends FunctionEmitter { "Could not copy data for type \"" + cArgType + "\"; currently only pointer types supported."); } - + // process each element in the array writer.println(" for (_copyIndex = 0; _copyIndex < " + arrayLenName +"; ++_copyIndex) {"); // get each array element - writer.println(" /* free each element of " +convName +"_copy */"); + writer.println(" /* free each element of " +convName +"_copy */"); writer.print(" _tmpObj = (*env)->GetObjectArrayElement(env, "); writer.print(javaArgName); - writer.println(", _copyIndex);"); + writer.println(", _copyIndex);"); if (javaArgType.isStringArray()) { writer.print(" (*env)->ReleaseStringUTFChars(env, "); writer.print("(jstring) _tmpObj"); writer.print(", "); writer.print(convName+"_copy[_copyIndex]"); - writer.println(");"); + writer.println(");"); } else { if (true) throw new RuntimeException( "Cannot yet handle type \"" + cArgType.getName() + - "\"; need to add support for cleaning up copied ptr-to-ptr-to-primitiveType subarrays"); + "\"; need to add support for cleaning up copied ptr-to-ptr-to-primitiveType subarrays"); } writer.println(" }"); } @@ -903,20 +903,20 @@ public class CMethodBindingEmitter extends FunctionEmitter { // there's something wrong with our parsing of the headers. assert(binding.getNumArguments() == 1); continue; - } + } if (javaArgType.isJNIEnv()) { writer.print("env"); } else if (binding.isArgumentThisPointer(i)) { writer.print(CMethodBindingEmitter.cThisArgumentName()); } else { - writer.print("("); + writer.print("("); Type cArgType = binding.getCArgumentType(i); boolean needsDataCopy = javaArgTypeNeedsDataCopy(javaArgType); boolean needsArrayOffset = !needsDataCopy && ( javaArgType.isArray() || javaArgType.isArrayOfCompoundTypeWrappers() || - ( javaArgType.isNIOBuffer() && forIndirectBufferAndArrayImplementation ) ); + ( javaArgType.isNIOBuffer() && forIndirectBufferAndArrayImplementation ) ); if (isConstPtrPtr(cArgType)) { writer.print("const "); } @@ -939,7 +939,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { } } else { if (javaArgType.isString()) { writer.print(STRING_CHARS_PREFIX); } - writer.print(binding.getArgumentName(i)); + writer.print(binding.getArgumentName(i)); } } } @@ -967,7 +967,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { emitBodyPassCArguments(writer); writer.println(");"); } - + /** Emits the user-defined C variable assignments from the TemporaryCVariableAssignments directive in the .cfg file. */ protected void emitBodyUserVariableAssignments(PrintWriter writer) { @@ -1088,12 +1088,12 @@ public class CMethodBindingEmitter extends FunctionEmitter { throw new RuntimeException("Unhandled return type"); } } - } + } protected static String cThisArgumentName() { return "this0"; } - + // Mangle a class, package or function name protected String jniMangle(String name) { return name.replaceAll("_", "_1").replace('.', '_'); @@ -1123,7 +1123,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { Class<?> c = type.getJavaClass(); if (c != null) { jniMangle(c, buf, false); - // If Buffer offset arguments were added, we need to mangle the JNI for the + // If Buffer offset arguments were added, we need to mangle the JNI for the // extra arguments if (type.isNIOBuffer()) { jniMangle(Integer.TYPE, buf, false); @@ -1132,7 +1132,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { } } else if (type.isNIOBufferArray()) { int[] intArrayType = new int[0]; - c = intArrayType.getClass(); + c = intArrayType.getClass(); jniMangle(c , buf, true); } if (type.isPrimitiveArray()) { @@ -1235,7 +1235,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { writer.print(elementTypeString); writer.print(" *) malloc("); writer.print(numElementsExpression); - writer.print(" * sizeof("); + writer.print(" * sizeof("); writer.print(elementTypeString); writer.println("));"); // Catch memory allocation failure @@ -1274,7 +1274,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { writer.print(sourceVarName); writer.println(", (jboolean*)NULL);"); // Catch memory allocation failure in the event that the VM didn't pin - // the String and failed to allocate a copy + // the String and failed to allocate a copy emitOutOfMemoryCheck( writer, receivingVarName, "Failed to get UTF-8 chars for argument \\\""+sourceVarName+"\\\""); } else { // The UTF-16 case is basically Windows specific. Unix platforms @@ -1301,7 +1301,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { } else { writer.println(); } - } + } private void emitGetDirectBufferAddress(PrintWriter writer, String sourceVarName, @@ -1332,7 +1332,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { writer.println(); } } - + // Note: if the data in the Type needs to be converted from the Java memory // model to the C memory model prior to calling any C-side functions, then // an extra variable named XXX_copy (where XXX is the value of the @@ -1367,12 +1367,12 @@ public class CMethodBindingEmitter extends FunctionEmitter { } else { // type is pointer to pointer of some type we don't support (maybe // it's an array of pointers to structs?) - throw new RuntimeException("Unsupported pointer type: \"" + cType.getName() + "\""); + throw new RuntimeException("Unsupported pointer type: \"" + cType.getName() + "\""); } } else { // type is pointer to pointer of some type we don't support (maybe // it's an array of pointers to structs?) - throw new RuntimeException("Unsupported pointer type: \"" + cType.getName() + "\""); + throw new RuntimeException("Unsupported pointer type: \"" + cType.getName() + "\""); } } } else { @@ -1431,7 +1431,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { emitGetDirectBufferAddress(writer, incomingArgumentName, cType.getName(), - cVariableName, + cVariableName, byteOffsetVarName, false); } @@ -1443,7 +1443,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { protected String byteOffsetArgName(String s) { return s + "_byte_offset"; } - + protected String isNIOArgName(int i) { return isNIOArgName(binding.getArgumentName(i)); } @@ -1451,11 +1451,11 @@ public class CMethodBindingEmitter extends FunctionEmitter { protected String isNIOArgName(String s) { return s + "_is_nio"; } - + protected String byteOffsetArrayArgName(int i) { return binding.getArgumentName(i) + "_byte_offset_array"; } - + protected String[] argumentNameArray() { String[] argumentNames = new String[binding.getNumArguments()]; for (int i = 0; i < binding.getNumArguments(); i++) { @@ -1478,7 +1478,7 @@ public class CMethodBindingEmitter extends FunctionEmitter { * emitter java method. */ protected static class DefaultCommentEmitter implements CommentEmitter { - public void emit(FunctionEmitter emitter, PrintWriter writer) { + public void emit(FunctionEmitter emitter, PrintWriter writer) { emitBeginning((CMethodBindingEmitter)emitter, writer); emitEnding((CMethodBindingEmitter)emitter, writer); } diff --git a/src/java/com/jogamp/gluegen/CodeGenUtils.java b/src/java/com/jogamp/gluegen/CodeGenUtils.java index 1b28eb8..4c96915 100644 --- a/src/java/com/jogamp/gluegen/CodeGenUtils.java +++ b/src/java/com/jogamp/gluegen/CodeGenUtils.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/CommentEmitter.java b/src/java/com/jogamp/gluegen/CommentEmitter.java index 89db474..7968909 100644 --- a/src/java/com/jogamp/gluegen/CommentEmitter.java +++ b/src/java/com/jogamp/gluegen/CommentEmitter.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -46,6 +46,6 @@ public interface CommentEmitter { * Emit the body of a comment for the specified function; do NOT emit the * open (e.g., comment "/*") or close (e.g., "*\/") characters. */ - public void emit(FunctionEmitter funcEmitter, PrintWriter output); + public void emit(FunctionEmitter funcEmitter, PrintWriter output); } diff --git a/src/java/com/jogamp/gluegen/ConstantDefinition.java b/src/java/com/jogamp/gluegen/ConstantDefinition.java index 4971eda..9edb827 100644 --- a/src/java/com/jogamp/gluegen/ConstantDefinition.java +++ b/src/java/com/jogamp/gluegen/ConstantDefinition.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,7 +28,7 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * */ package com.jogamp.gluegen; @@ -96,12 +96,12 @@ public class ConstantDefinition { return aliasedNames; } - public String getOrigName() { - return origName; + public String getOrigName() { + return origName; } - public String getName() { - return name; + public String getName() { + return name; } public String getValue() { return value; } @@ -128,5 +128,5 @@ public class ConstantDefinition { + " aliasedNames " + aliasedNames + " aliases " + aliases + " enumName " + enumName + " isEnum " + isEnum + "]"; } - + } diff --git a/src/java/com/jogamp/gluegen/DebugEmitter.java b/src/java/com/jogamp/gluegen/DebugEmitter.java index 336cc8b..d5fab6e 100644 --- a/src/java/com/jogamp/gluegen/DebugEmitter.java +++ b/src/java/com/jogamp/gluegen/DebugEmitter.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -54,7 +54,7 @@ public class DebugEmitter implements GlueEmitter { System.out.println("----- BEGIN EMISSION OF GLUE CODE -----"); } - public void endEmission() { + public void endEmission() { System.out.println("----- END EMISSION OF GLUE CODE -----"); } @@ -67,7 +67,7 @@ public class DebugEmitter implements GlueEmitter { (optionalComment != null ? ("// " + optionalComment) : "")); } public void endDefines() {} - + public void beginFunctions(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map<Type, Type> canonMap) { @@ -77,7 +77,7 @@ public class DebugEmitter implements GlueEmitter { System.out.println("typedef " + value + " " + key + ";"); } } - + public Iterator<FunctionSymbol> emitFunctions(List<FunctionSymbol> originalCFunctions) throws Exception { for (FunctionSymbol sym : originalCFunctions) { emitSingleFunction(sym); diff --git a/src/java/com/jogamp/gluegen/FunctionEmitter.java b/src/java/com/jogamp/gluegen/FunctionEmitter.java index f9fbd21..8bb2ca5 100644 --- a/src/java/com/jogamp/gluegen/FunctionEmitter.java +++ b/src/java/com/jogamp/gluegen/FunctionEmitter.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -59,7 +59,7 @@ public abstract class FunctionEmitter { this.defaultOutput = defaultOutput; this.isInterfaceVal = isInterface; } - + /** * Makes this FunctionEmitter a copy of the passed one. */ @@ -133,7 +133,7 @@ public abstract class FunctionEmitter { * null, in which case no comment emitter has been set. */ public CommentEmitter getCommentEmitter() { return commentEmitter; } - + protected void emitDocComment(PrintWriter writer) { if (commentEmitter != null) { @@ -144,13 +144,13 @@ public abstract class FunctionEmitter { commentEmitter.emit(this, writer); writer.print(getBaseIndentString()); //indent - + writer.println(getCommentEndString()); } } - + protected void emitSignature(PrintWriter writer) { - + writer.print(getBaseIndentString()); // indent method int numEmitted = emitModifiers(writer); @@ -182,21 +182,21 @@ public abstract class FunctionEmitter { } protected String getBaseIndentString() { return ""; } - + protected String getCommentStartString() { return "/* "; } protected String getCommentEndString() { return " */"; } - + protected abstract void emitReturnType(PrintWriter writer); - protected abstract void emitName(PrintWriter writer); + protected abstract void emitName(PrintWriter writer); /** Returns the number of arguments emitted. */ - protected abstract int emitArguments(PrintWriter writer); + protected abstract int emitArguments(PrintWriter writer); protected abstract void emitBody(PrintWriter writer); - + public static class EmissionModifier { @Override public final String toString() { return emittedForm; } - + private String emittedForm; @Override @@ -213,7 +213,7 @@ public abstract class FunctionEmitter { return emittedForm.equals(((EmissionModifier) arg).emittedForm); } - protected EmissionModifier(String emittedForm) { this.emittedForm = emittedForm; } + protected EmissionModifier(String emittedForm) { this.emittedForm = emittedForm; } } } diff --git a/src/java/com/jogamp/gluegen/GlueEmitter.java b/src/java/com/jogamp/gluegen/GlueEmitter.java index c574d2e..bd5a7f3 100644 --- a/src/java/com/jogamp/gluegen/GlueEmitter.java +++ b/src/java/com/jogamp/gluegen/GlueEmitter.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -72,7 +72,7 @@ public interface GlueEmitter { */ public void emitDefine(ConstantDefinition def, String optionalComment) throws Exception; public void endDefines() throws Exception; - + public void beginFunctions(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map<Type, Type> canonMap) throws Exception; diff --git a/src/java/com/jogamp/gluegen/GlueEmitterControls.java b/src/java/com/jogamp/gluegen/GlueEmitterControls.java index 07b370d..e4d80b0 100644 --- a/src/java/com/jogamp/gluegen/GlueEmitterControls.java +++ b/src/java/com/jogamp/gluegen/GlueEmitterControls.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/GlueGen.java b/src/java/com/jogamp/gluegen/GlueGen.java index bc75be5..76eda1f 100644 --- a/src/java/com/jogamp/gluegen/GlueGen.java +++ b/src/java/com/jogamp/gluegen/GlueGen.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -51,7 +51,7 @@ import com.jogamp.gluegen.pcpp.*; import static java.lang.System.*; -/** +/** * Glue code generator for C functions and data structures.<br> */ public class GlueGen implements GlueEmitterControls { @@ -62,15 +62,15 @@ public class GlueGen implements GlueEmitterControls { private List<String> forcedStructNames = new ArrayList<String>(); private PCPP preprocessor; - + // State for SymbolFilters private List<ConstantDefinition> constants; private List<FunctionSymbol> functions; - + private static boolean debug = false; public static boolean debug() { return debug; } - + public void forceStructEmission(String typedefName) { forcedStructNames.add(typedefName); } @@ -91,7 +91,7 @@ public class GlueGen implements GlueEmitterControls { } } - + @SuppressWarnings("unchecked") public void run(final Reader reader, final String filename, Class<?> emitterClass, List<String> includePaths, List<String> cfgFiles, String outputRootDir, boolean copyPCPPOutput2Stderr) { diff --git a/src/java/com/jogamp/gluegen/JavaConfiguration.java b/src/java/com/jogamp/gluegen/JavaConfiguration.java index c3e2346..23db7b4 100644 --- a/src/java/com/jogamp/gluegen/JavaConfiguration.java +++ b/src/java/com/jogamp/gluegen/JavaConfiguration.java @@ -5,18 +5,18 @@ * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -64,7 +64,7 @@ public class JavaConfiguration { public static final boolean DEBUG_IGNORES = GlueGen.debug() || false; public static final boolean DEBUG_RENAMES = GlueGen.debug() || false; - + private int nestedReads; private String packageName; private String implPackageName; @@ -72,7 +72,7 @@ public class JavaConfiguration { private String implClassName; protected static final Logger LOG = Logger.getLogger(JavaConfiguration.class.getPackage().getName()); - + /** * Root directory for the hierarchy of generated java classes. Default is * working directory. @@ -178,7 +178,7 @@ public class JavaConfiguration { public final void read(String filename) throws IOException { read(filename, null); } - + /** Reads the specified file, treating each line as if it started with the specified string. @param filename path to file that should be read @@ -209,7 +209,7 @@ public class JavaConfiguration { // comment line continue; } - + StringTokenizer tok = new StringTokenizer(line); if (tok.hasMoreTokens()) { // always reset delimiters in case of CustomJavaCode, etc. @@ -466,7 +466,7 @@ public class JavaConfiguration { else if (c == Float.TYPE) jt = JavaType.createForCFloatPointer(); else if (c == Double.TYPE) jt = JavaType.createForCDoublePointer(); - if (jt != null) + if (jt != null) return new TypeInfo(info.name(), pd + numPointersStripped, jt); } @@ -474,7 +474,7 @@ public class JavaConfiguration { c = Array.newInstance(c, 0).getClass(); --diff; } - + return new TypeInfo(info.name(), numPointersStripped, JavaType.createForClass(c)); @@ -522,7 +522,7 @@ public class JavaConfiguration { /** Returns true if the given function should only create a java.nio variant, and no array variants, for <code>void*</code> and other C primitive pointers. NIO direct only does only allow direct Buffers. - Implies useNIOOnly ! + Implies useNIOOnly ! */ public boolean useNIODirectOnly(String functionName) { return forceUseNIODirectOnly4All || useNIODirectOnly.contains(functionName); @@ -671,20 +671,20 @@ public class JavaConfiguration { } } private static boolean dumpedRenames = false; - + public void dumpRenames() { System.err.println("Symbol Renames: "); for (String key : javaSymbolRenames.keySet()) { System.err.println("\t"+key+" -> "+javaSymbolRenames.get(key)); } - + System.err.println("Symbol Aliasing (through renaming): "); for(String newName : javaSymbolRenames.values()) { Set<String> origNames = javaRenamedSymbols.get(newName); if(null!=origNames) { System.err.println("\t"+newName+" <- "+origNames); } - } + } } /** Returns true if this #define, function, struct, or field within @@ -762,7 +762,7 @@ public class JavaConfiguration { for (Pattern regexp : ignoreNots) { Matcher matcher = regexp.matcher(symbol); if (!matcher.matches()) { - // Special case as this is most often likely to be the case. + // Special case as this is most often likely to be the case. // Unignores are not used very often. if(unignores.isEmpty()) { if(DEBUG_IGNORES) { @@ -770,7 +770,7 @@ public class JavaConfiguration { } return true; } - + boolean unignoreFound = false; for (Pattern unignoreRegexp : unignores) { Matcher unignoreMatcher = unignoreRegexp.matcher(symbol); @@ -779,7 +779,7 @@ public class JavaConfiguration { break; } } - + if (!unignoreFound) if(DEBUG_IGNORES) { System.err.println("Ignore Impl !unignore: "+symbol); @@ -836,7 +836,7 @@ public class JavaConfiguration { public Set<String> getRenamedJavaSymbols(String aliasedName) { return javaRenamedSymbols.get(aliasedName); } - + /** Programmatically adds a rename directive for the given symbol. */ public void addJavaSymbolRename(String origName, String newName) { if(DEBUG_RENAMES) { @@ -850,13 +850,13 @@ public class JavaConfiguration { if(DEBUG_RENAMES) { System.err.println(); } - + Set<String> origNames = javaRenamedSymbols.get(newName); if(null == origNames) { origNames = new HashSet<String>(); javaRenamedSymbols.put(newName, origNames); } - origNames.add(origName); + origNames.add(origName); } /** Returns true if the emission style is AllStatic. */ @@ -907,7 +907,7 @@ public class JavaConfiguration { // protected void dispatch(String cmd, StringTokenizer tok, File file, String filename, int lineNo) throws IOException { - //System.err.println("read cmd = [" + cmd + "]"); + //System.err.println("read cmd = [" + cmd + "]"); if (cmd.equalsIgnoreCase("Package")) { packageName = readString("package", tok, filename, lineNo); } else if (cmd.equalsIgnoreCase("GlueGenRuntimePackage")) { @@ -1172,7 +1172,7 @@ public class JavaConfiguration { final Set<String> parsedEnumNames = parser.getParsedEnumNames(); final Set<String> parsedFuncNames = parser.getParsedFunctionNames(); - + if(forInterface) { if(onlyList) { extendedIntfSymbolsOnly.addAll(parsedEnumNames); @@ -1181,7 +1181,7 @@ public class JavaConfiguration { extendedIntfSymbolsIgnore.addAll(parsedEnumNames); extendedIntfSymbolsIgnore.addAll(parsedFuncNames); } - } + } if(forImplementation) { if(onlyList) { extendedImplSymbolsOnly.addAll(parsedEnumNames); @@ -1213,12 +1213,12 @@ public class JavaConfiguration { ignoreMap.remove(regex); ignores.remove(pattern); - // If the pattern wasn't registered before, then make sure we have a + // If the pattern wasn't registered before, then make sure we have a // valid pattern instance to put into the unignores set. if(pattern == null) pattern = Pattern.compile(regex); unignores.add(pattern); - + //System.err.println("UN-IGNORING " + regex + " / " + ignores.get(regex)); } catch (NoSuchElementException e) { throw new RuntimeException("Error parsing \"Unignore\" command at line " + lineNo + @@ -1329,7 +1329,7 @@ public class JavaConfiguration { * <pre> * public abstract void FuncName(byte[] ugh, int bar, byte[] foo, byte[] goop); * </pre> - * + * * However, if you supplied the following directive: * * <pre> @@ -1363,7 +1363,7 @@ public class JavaConfiguration { " in file \"" + filename + "\"", e); } } - + protected void readStructPackage(StringTokenizer tok, String filename, int lineNo) { try { String struct = tok.nextToken(); @@ -1453,7 +1453,7 @@ public class JavaConfiguration { while (tok.countTokens() > 1) { linePrefix.append(tok.nextToken()); - linePrefix.append(" "); + linePrefix.append(" "); } // last token is filename String includedFilename = tok.nextToken(); @@ -1538,7 +1538,7 @@ public class JavaConfiguration { } addJavaPrologueOrEpilogue(methodName, restOfLine, prologue); } catch (NoSuchElementException e) { - throw new RuntimeException("Error parsing \"" + + throw new RuntimeException("Error parsing \"" + (prologue ? "JavaPrologue" : "JavaEpilogue") + "\" command at line " + lineNo + " in file \"" + filename + "\"", e); diff --git a/src/java/com/jogamp/gluegen/JavaEmitter.java b/src/java/com/jogamp/gluegen/JavaEmitter.java index 914f5a8..33b089a 100644 --- a/src/java/com/jogamp/gluegen/JavaEmitter.java +++ b/src/java/com/jogamp/gluegen/JavaEmitter.java @@ -86,11 +86,11 @@ public class JavaEmitter implements GlueEmitter { /** * Access control for emitted Java methods. */ - public enum MethodAccess { + public enum MethodAccess { PUBLIC("public"), PROTECTED("protected"), PRIVATE("private"), PACKAGE_PRIVATE("/* pp */"), PUBLIC_ABSTRACT("abstract"); - + public final String getJavaName() { return javaName; } - + MethodAccess(String javaName) { this.javaName = javaName; } @@ -102,7 +102,7 @@ public class JavaEmitter implements GlueEmitter { private PrintWriter cWriter; private final MachineDescription machDescJava = MachineDescription.StaticConfig.X86_64_UNIX.md; private final MachineDescription.StaticConfig[] machDescTargetConfigs = MachineDescription.StaticConfig.values(); - + protected final static Logger LOG = Logger.getLogger(JavaEmitter.class.getPackage().getName()); public void readConfigurationFile(String filename) throws Exception { @@ -615,7 +615,7 @@ public class JavaEmitter implements GlueEmitter { } } - protected void prepCEmitter(MethodBinding binding, CMethodBindingEmitter cEmitter) + protected void prepCEmitter(MethodBinding binding, CMethodBindingEmitter cEmitter) { // See whether we need an expression to help calculate the // length of any return type @@ -786,14 +786,14 @@ public class JavaEmitter implements GlueEmitter { String containingTypeName = containingType.getName(); // machDescJava global MachineDescription is the one used to determine - // the sizes of the primitive types seen in the public API in Java. + // the sizes of the primitive types seen in the public API in Java. // For example, if a C long is an element of a struct, it is the size // of a Java int on a 32-bit machine but the size of a Java long // on a 64-bit machine. To support both of these sizes with the // same API, the abstract base class must take and return a Java // long from the setter and getter for this field. However the // implementation on a 32-bit platform must downcast this to an - // int and set only an int's worth of data in the struct. + // int and set only an int's worth of data in the struct. // // The machDescTarget MachineDescription is the one used to determine how // much data to set in or get from the struct and exactly from @@ -872,10 +872,10 @@ public class JavaEmitter implements GlueEmitter { writer.println(); writer.println(" StructAccessor accessor;"); writer.println(); - writer.println(" private static final int mdIdx = MachineDescriptionRuntime.getStatic().ordinal();"); + writer.println(" private static final int mdIdx = MachineDescriptionRuntime.getStatic().ordinal();"); writer.println(); // generate all offset and size arrays - generateOffsetAndSizeArrays(writer, containingTypeName, structType, null); /* w/o offset */ + generateOffsetAndSizeArrays(writer, containingTypeName, structType, null); /* w/o offset */ for (int i = 0; i < structType.getNumFields(); i++) { final Field field = structType.getField(i); final Type fieldType = field.getType(); @@ -922,7 +922,7 @@ public class JavaEmitter implements GlueEmitter { } } } - } + } writer.println(); writer.println(" public static int size() {"); @@ -1061,7 +1061,7 @@ public class JavaEmitter implements GlueEmitter { writer.println(" }"); } else { JavaType javaType = null; - + try { javaType = typeToJavaType(fieldType, false, machDescJava); } catch (Exception e) { @@ -1071,7 +1071,7 @@ public class JavaEmitter implements GlueEmitter { } if (javaType.isPrimitive()) { // Primitive type - final boolean fieldTypeNativeSizeFixed = fieldType.getSize().hasFixedNativeSize(); + final boolean fieldTypeNativeSizeFixed = fieldType.getSize().hasFixedNativeSize(); final String javaTypeName; if ( isOpaque(fieldType) ) { javaTypeName = compatiblePrimitiveJavaTypeName(fieldType, javaType, machDescJava); @@ -1079,15 +1079,15 @@ public class JavaEmitter implements GlueEmitter { javaTypeName = javaType.getName(); } final String capJavaTypeName = capitalizeString(javaTypeName); - final String capFieldName = capitalizeString(fieldName); + final String capFieldName = capitalizeString(fieldName); final String sizeDenominator = fieldType.isPointer() ? "pointer" : javaTypeName ; - + if(GlueGen.debug()) { System.err.println("Java.StructEmitter.Primitive: "+field.getName()+", "+fieldType.getName(true)+", "+javaTypeName+", "+ ", fixedSize "+fieldTypeNativeSizeFixed+", opaque "+isOpaque(fieldType)+", isPointer "+fieldType.isPointer()+", isCompound "+fieldType.isCompound()+ ", sizeDenominator "+sizeDenominator); } - + writer.println(); // Setter generateSetterSignature(writer, false, containingTypeName, capFieldName, javaTypeName); @@ -1100,16 +1100,16 @@ public class JavaEmitter implements GlueEmitter { writer.println(" return this;"); writer.println(" }"); writer.println(); - + // Getter generateGetterSignature(writer, false, javaTypeName, capFieldName); writer.println(" {"); - writer.print (" return "); + writer.print (" return "); if( fieldTypeNativeSizeFixed ) { writer.println("accessor.get" + capJavaTypeName + "At(" + fieldName+"_offset[mdIdx]);"); } else { writer.println("accessor.get" + capJavaTypeName + "At(" + fieldName+"_offset[mdIdx], MachineDescriptionRuntime.getStatic().md."+sizeDenominator+"SizeInBytes());"); - } + } writer.println(" }"); } } @@ -1162,9 +1162,9 @@ public class JavaEmitter implements GlueEmitter { writer.print(" public " + (abstractMethod ? "abstract " : "") + returnTypeName + " set" + capitalizedFieldName + "(" + paramTypeName + " val)"); } - private void generateOffsetAndSizeArrays(PrintWriter writer, String fieldName, Type fieldType, Field field) { + private void generateOffsetAndSizeArrays(PrintWriter writer, String fieldName, Type fieldType, Field field) { if(null != field) { - writer.print(" private static final int[] "+fieldName+"_offset = new int[] { "); + writer.print(" private static final int[] "+fieldName+"_offset = new int[] { "); for( int i=0; i < machDescTargetConfigs.length; i++ ) { if(0<i) { writer.print(", "); @@ -1175,7 +1175,7 @@ public class JavaEmitter implements GlueEmitter { writer.println(" };"); } if(null!=fieldType) { - writer.print(" private static final int[] "+fieldName+"_size = new int[] { "); + writer.print(" private static final int[] "+fieldName+"_size = new int[] { "); for( int i=0; i < machDescTargetConfigs.length; i++ ) { if(0<i) { writer.print(", "); @@ -1186,7 +1186,7 @@ public class JavaEmitter implements GlueEmitter { writer.println(" };"); } } - + private JavaType typeToJavaType(Type cType, boolean outgoingArgument, MachineDescription curMachDesc) { // Recognize JNIEnv* case up front PointerType opt = cType.asPointer(); @@ -1254,7 +1254,7 @@ public class JavaEmitter implements GlueEmitter { // t is <type>[], we need to get <type> targetType = t.asArray().getElementType(); } - + // Handle Types of form pointer-to-type or array-of-type, like // char* or int[]; these are expanded out into Java primitive // arrays, NIO buffers, or both in expandMethodBinding @@ -1263,7 +1263,7 @@ public class JavaEmitter implements GlueEmitter { return JavaType.createForCVoidPointer(); } else if (targetType.isInt()) { final SizeThunk targetSizeThunk = targetType.getSize(); - if( null != targetSizeThunk && SizeThunk.POINTER == targetSizeThunk ) { + if( null != targetSizeThunk && SizeThunk.POINTER == targetSizeThunk ) { // Map intptr_t*, uintptr_t*, ptrdiff_t* and size_t* to PointerBuffer, since referenced memory-size is arch dependent return JavaType.forNIOPointerBufferClass(); } diff --git a/src/java/com/jogamp/gluegen/JavaMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/JavaMethodBindingEmitter.java index bd99486..81188a5 100644 --- a/src/java/com/jogamp/gluegen/JavaMethodBindingEmitter.java +++ b/src/java/com/jogamp/gluegen/JavaMethodBindingEmitter.java @@ -54,7 +54,7 @@ import java.util.List; * An emitter that emits only the interface for a Java<->C JNI binding. */ public class JavaMethodBindingEmitter extends FunctionEmitter { - + public static final EmissionModifier PUBLIC = new EmissionModifier("public"); public static final EmissionModifier PROTECTED = new EmissionModifier("protected"); public static final EmissionModifier PRIVATE = new EmissionModifier("private"); diff --git a/src/java/com/jogamp/gluegen/JavaType.java b/src/java/com/jogamp/gluegen/JavaType.java index a6cf890..8a79559 100644 --- a/src/java/com/jogamp/gluegen/JavaType.java +++ b/src/java/com/jogamp/gluegen/JavaType.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -50,8 +50,8 @@ import com.jogamp.gluegen.cgram.types.*; * contains some utility methods for creating common types. */ public class JavaType { - - /* + + /* * Represents C arrays that will / can be represented * with NIO buffers (resolved down to another JavaType later in processing) */ @@ -309,13 +309,13 @@ public class JavaType { if (elementType.isArray()) { // Type is array-of-arrays-of-something - - if (elementType.getComponentType().isPrimitive()) { - // Type is an array-of-arrays-of-primitive + + if (elementType.getComponentType().isPrimitive()) { + // Type is an array-of-arrays-of-primitive return "jobjectArray /* elements are " + elementType.getComponentType() + "[]*/"; //return "jobjectArray"; } else { - throw new RuntimeException("Multi-dimensional arrays of types that are not primitives or Strings are not supported."); + throw new RuntimeException("Multi-dimensional arrays of types that are not primitives or Strings are not supported."); } } @@ -431,12 +431,12 @@ public class JavaType { public boolean isCompoundTypeWrapper() { return (clazz == null && name != null && !isJNIEnv()); } - + public boolean isArrayOfCompoundTypeWrappers() { return elementType != null; } - - + + public boolean isCPrimitivePointerType() { return primitivePointerType != null; } @@ -482,7 +482,7 @@ public class JavaType { public String toString() { return getName(); } - + //---------------------------------------------------------------------- // Internals only below this point // @@ -537,7 +537,7 @@ public class JavaType { this.name = name; this.elementType = elementType; } - + private String arrayName(Class<?> clazz) { StringBuilder buf = new StringBuilder(); int arrayCount = 0; diff --git a/src/java/com/jogamp/gluegen/Logging.java b/src/java/com/jogamp/gluegen/Logging.java index d8c1b5a..4ed4dba 100644 --- a/src/java/com/jogamp/gluegen/Logging.java +++ b/src/java/com/jogamp/gluegen/Logging.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,12 +20,12 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. */ - + /* * Created on Wednesday, March 31 2010 13:30 */ @@ -46,8 +46,8 @@ import com.jogamp.common.util.PropertyAccess; public class Logging { static void init() { - final String packageName = Logging.class.getPackage().getName(); - final String property = PropertyAccess.getProperty(packageName+".level", true); + final String packageName = Logging.class.getPackage().getName(); + final String property = PropertyAccess.getProperty(packageName+".level", true); Level level; if(property != null) { level = Level.parse(property); diff --git a/src/java/com/jogamp/gluegen/ReferencedStructs.java b/src/java/com/jogamp/gluegen/ReferencedStructs.java index b8a176f..f88594e 100644 --- a/src/java/com/jogamp/gluegen/ReferencedStructs.java +++ b/src/java/com/jogamp/gluegen/ReferencedStructs.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -49,7 +49,7 @@ public class ReferencedStructs implements TypeVisitor { public void clear() { results.clear(); } - + public Iterator<Type> results() { return results.iterator(); } diff --git a/src/java/com/jogamp/gluegen/SymbolFilter.java b/src/java/com/jogamp/gluegen/SymbolFilter.java index 724ff40..cf34067 100644 --- a/src/java/com/jogamp/gluegen/SymbolFilter.java +++ b/src/java/com/jogamp/gluegen/SymbolFilter.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,7 +28,7 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * */ package com.jogamp.gluegen; diff --git a/src/java/com/jogamp/gluegen/TypeInfo.java b/src/java/com/jogamp/gluegen/TypeInfo.java index e480571..f5db353 100644 --- a/src/java/com/jogamp/gluegen/TypeInfo.java +++ b/src/java/com/jogamp/gluegen/TypeInfo.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/cgram/CSymbolTable.java b/src/java/com/jogamp/gluegen/cgram/CSymbolTable.java index 318543b..69ec0ed 100644 --- a/src/java/com/jogamp/gluegen/cgram/CSymbolTable.java +++ b/src/java/com/jogamp/gluegen/cgram/CSymbolTable.java @@ -35,14 +35,14 @@ public class CSymbolTable { scopeStack.removeElementAt(size - 1); } - /** return the current scope as a string + /** return the current scope as a string */ public String currentScopeAsString() { StringBuilder buf = new StringBuilder(100); boolean first = true; Enumeration<String> e = scopeStack.elements(); while(e.hasMoreElements()) { - if(first) + if(first) first = false; else buf.append("::"); @@ -51,7 +51,7 @@ public class CSymbolTable { return buf.toString(); } - /** given a name for a type, append it with the + /** given a name for a type, append it with the current scope. */ public String addCurrentScopeToName(String name) { @@ -59,7 +59,7 @@ public class CSymbolTable { return addScopeToName(currScope, name); } - /** given a name for a type, append it with the + /** given a name for a type, append it with the given scope. MBZ */ public String addScopeToName(String scope, String name) { @@ -80,7 +80,7 @@ public class CSymbolTable { } return null; } - + /** add a node to the table with it's key as the current scope and the name */ public TNode add(String name, TNode node) { @@ -116,7 +116,7 @@ public class CSymbolTable { /** convert this table to a string */ public String toString() { StringBuilder buff = new StringBuilder(300); - buff.append("CSymbolTable { \nCurrentScope: " + currentScopeAsString() + + buff.append("CSymbolTable { \nCurrentScope: " + currentScopeAsString() + "\nDefinedSymbols:\n"); Enumeration<String> ke = symTable.keys(); Enumeration<TNode> ve = symTable.elements(); diff --git a/src/java/com/jogamp/gluegen/cgram/CToken.java b/src/java/com/jogamp/gluegen/cgram/CToken.java index f6bbf51..7bd48ad 100644 --- a/src/java/com/jogamp/gluegen/cgram/CToken.java +++ b/src/java/com/jogamp/gluegen/cgram/CToken.java @@ -6,22 +6,22 @@ public class CToken extends antlr.CommonToken { String source = ""; int tokenNumber; - public String getSource() - { + public String getSource() + { return source; } - public void setSource(String src) + public void setSource(String src) { source = src; } - public int getTokenNumber() - { + public int getTokenNumber() + { return tokenNumber; } - public void setTokenNumber(int i) + public void setTokenNumber(int i) { tokenNumber = i; } diff --git a/src/java/com/jogamp/gluegen/cgram/Define.java b/src/java/com/jogamp/gluegen/cgram/Define.java index c2510df..1b23346 100644 --- a/src/java/com/jogamp/gluegen/cgram/Define.java +++ b/src/java/com/jogamp/gluegen/cgram/Define.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/cgram/LineObject.java b/src/java/com/jogamp/gluegen/cgram/LineObject.java index 5104497..4914759 100644 --- a/src/java/com/jogamp/gluegen/cgram/LineObject.java +++ b/src/java/com/jogamp/gluegen/cgram/LineObject.java @@ -9,7 +9,7 @@ class LineObject { boolean systemHeader = false; boolean treatAsC = false; - public LineObject() + public LineObject() { super(); } @@ -25,27 +25,27 @@ class LineObject { treatAsC = lobj.getTreatAsC(); } - public LineObject( String src) + public LineObject( String src) { source = src; } - public void setSource(String src) + public void setSource(String src) { source = src; } - public String getSource() + public String getSource() { return source; } - public void setParent(LineObject par) + public void setParent(LineObject par) { parent = par; } - public LineObject getParent() + public LineObject getParent() { return parent; } @@ -55,7 +55,7 @@ class LineObject { line = l; } - public int getLine() + public int getLine() { return line; } @@ -65,42 +65,42 @@ class LineObject { line++; } - public void setEnteringFile(boolean v) + public void setEnteringFile(boolean v) { enteringFile = v; } - public boolean getEnteringFile() + public boolean getEnteringFile() { return enteringFile; } - public void setReturningToFile(boolean v) + public void setReturningToFile(boolean v) { returningToFile = v; } - public boolean getReturningToFile() + public boolean getReturningToFile() { return returningToFile; } - public void setSystemHeader(boolean v) + public void setSystemHeader(boolean v) { systemHeader = v; } - public boolean getSystemHeader() + public boolean getSystemHeader() { return systemHeader; } - public void setTreatAsC(boolean v) + public void setTreatAsC(boolean v) { treatAsC = v; } - public boolean getTreatAsC() + public boolean getTreatAsC() { return treatAsC; } diff --git a/src/java/com/jogamp/gluegen/cgram/PreprocessorInfoChannel.java b/src/java/com/jogamp/gluegen/cgram/PreprocessorInfoChannel.java index 5281ab1..7cf64b0 100644 --- a/src/java/com/jogamp/gluegen/cgram/PreprocessorInfoChannel.java +++ b/src/java/com/jogamp/gluegen/cgram/PreprocessorInfoChannel.java @@ -28,11 +28,11 @@ public class PreprocessorInfoChannel { return maxTokenNumber; } - + public Vector<Object> extractLinesPrecedingTokenNumber( Integer toknum ) { Vector<Object> lines = new Vector<Object>(); - if (toknum == null) return lines; + if (toknum == null) return lines; for (int i = firstValidTokenNumber; i < toknum.intValue(); i++){ Integer inti = new Integer(i); if ( lineLists.containsKey( inti ) ) { diff --git a/src/java/com/jogamp/gluegen/cgram/TNode.java b/src/java/com/jogamp/gluegen/cgram/TNode.java index 01ef626..00c4ffa 100644 --- a/src/java/com/jogamp/gluegen/cgram/TNode.java +++ b/src/java/com/jogamp/gluegen/cgram/TNode.java @@ -7,13 +7,13 @@ import java.lang.reflect.*; import java.util.Hashtable; import java.util.Enumeration; -/** +/** Class TNode is an implementation of the AST interface and adds many useful features: It is double-linked for reverse searching. (this is currently incomplete, in that method doubleLink() must - be called after any changes to the tree to maintain the + be called after any changes to the tree to maintain the reverse links). It can store a definition node (defNode), so that nodes such @@ -38,8 +38,8 @@ public class TNode extends CommonAST { protected TNode left; protected boolean marker = false; protected Hashtable<String, Object> attributes = null; - static String tokenVocabulary; - + static String tokenVocabulary; + @@ -50,7 +50,7 @@ public class TNode extends CommonAST { tokenVocabulary = s; } - + public void initialize(Token token) { CToken tok = (CToken) token; setText(tok.getText()); @@ -58,7 +58,7 @@ public void initialize(Token token) { setLineNum(tok.getLine()); setAttribute("source", tok.getSource()); setAttribute("tokenNumber", new Integer(tok.getTokenNumber())); -} +} public void initialize(AST tr) { TNode t = (TNode) tr; setText(t.getText()); @@ -66,31 +66,31 @@ public void initialize(AST tr) { setLineNum(t.getLineNum()); setDefNode(t.getDefNode()); this.attributes = t.getAttributesTable(); -} +} /** Get the token type for this node */ public int getType() { return ttype; } - + /** Set the token type for this node */ - public void setType(int ttype_) { - ttype = ttype_; + public void setType(int ttype_) { + ttype = ttype_; } - + /** Get the marker value for this node. This member is a general-use marker. */ public boolean getMarker() { return marker; } - + /** Set the marker value for this node. This property is a general-use boolean marker. */ - public void setMarker(boolean marker_) { - marker = marker_; + public void setMarker(boolean marker_) { + marker = marker_; } /** get the hashtable that holds attribute values. - */ + */ public Hashtable<String, Object> getAttributesTable() { if(attributes == null) attributes = new Hashtable<String, Object>(7); @@ -117,42 +117,42 @@ public void initialize(AST tr) { /** Get the line number for this node. If the line number is 0, search for a non-zero line num among children */ - public int getLineNum() { + public int getLineNum() { if(lineNum != 0) - return lineNum; + return lineNum; else if(down == null) - return lineNum; + return lineNum; else return ((TNode)down).getLocalLineNum(); } - - public int getLocalLineNum() { + + public int getLocalLineNum() { if(lineNum != 0) - return lineNum; + return lineNum; else if(down == null) if(right == null) - return lineNum; + return lineNum; else return ((TNode)right).getLocalLineNum(); else return ((TNode)down).getLocalLineNum(); } - + /** Set the line number for this node */ - public void setLineNum(int lineNum_) { - lineNum = lineNum_; + public void setLineNum(int lineNum_) { + lineNum = lineNum_; } - + /** Get the token text for this node */ public String getText() { return text; } - + /** Set the token text for this node */ - public void setText(String text_) { - text = text_; + public void setText(String text_) { + text = text_; } - + /** Returns the text for this node and all children */ public String getAllChildrenText() { StringBuilder buf = new StringBuilder(); @@ -167,12 +167,12 @@ public void initialize(AST tr) { public TNode getLastChild() { TNode down = (TNode)getFirstChild(); if(down != null) - return down.getLastSibling(); - else + return down.getLastSibling(); + else return null; } - /** return the last sibling of this node, which is + /** return the last sibling of this node, which is this if the next sibling is null */ public TNode getLastSibling() { TNode next = (TNode)getNextSibling(); @@ -182,7 +182,7 @@ public void initialize(AST tr) { return this; } - /** return the first sibling of this node, which is + /** return the first sibling of this node, which is this if the prev sibling is null */ public TNode getFirstSibling() { TNode prev = left; @@ -201,7 +201,7 @@ public void initialize(AST tr) { /** add the new node as a new sibling, inserting it ahead of any existing next sibling. This method maintains double-linking. - if node is null, nothing happens. If the node has siblings, + if node is null, nothing happens. If the node has siblings, then they are added in as well. */ public void addSibling(AST node) { @@ -215,7 +215,7 @@ public void initialize(AST tr) { next.left = nodeLastSib; } - + /** return the number of children of this node */ public int numberOfChildren() { int count = 0; @@ -234,15 +234,15 @@ public void initialize(AST tr) { TNode parent = up; TNode prev = left; TNode next = (TNode)right; - - if(parent != null) { + + if(parent != null) { parent.down = next; if(next != null) { next.up = parent; next.left = prev; // which should be null } - } - else { + } + else { if(prev != null) prev.right = next; if(next != null) @@ -255,7 +255,7 @@ public void initialize(AST tr) { public TNode getDefNode() { return defNode; } - + /** set the def node for this node */ public void setDefNode(TNode n) { defNode = n; @@ -307,7 +307,7 @@ public void initialize(AST tr) { StringBuilder str = new StringBuilder( getNameForType(getType()) + "[" + getText() + ", " + "]"); - if(this.getLineNum() != 0) + if(this.getLineNum() != 0) str.append(" line:" + (this.getLineNum() ) ); Enumeration<String> keys = (this.getAttributesTable().keys()); @@ -331,23 +331,23 @@ public void initialize(AST tr) { /** protected method that does the work of printing */ protected static void printASTNode(AST t, int indent) { AST child1, next; - child1 = t.getFirstChild(); + child1 = t.getFirstChild(); System.out.print("\n"); - for(int i = 0; i < indent; i++) + for(int i = 0; i < indent; i++) System.out.print(" "); - if(child1 != null) + if(child1 != null) System.out.print("("); String s = t.getText(); if(s != null && s.length() > 0) { System.out.print(getNameForType(t.getType())); System.out.print(": \"" + s + "\""); - } + } else System.out.print(getNameForType(t.getType())); - if(((TNode)t).getLineNum() != 0) + if(((TNode)t).getLineNum() != 0) System.out.print(" line:" + ((TNode)t).getLineNum() ); Enumeration<String> keys = ((TNode)t).getAttributesTable().keys(); @@ -364,7 +364,7 @@ public void initialize(AST tr) { printASTNode(child1,indent + 1); System.out.print("\n"); - for(int i = 0; i < indent; i++) + for(int i = 0; i < indent; i++) System.out.print(" "); System.out.print(")"); } @@ -418,22 +418,22 @@ public void initialize(AST tr) { return up.parentOfType(type); } - /** find the first child of the node + /** find the first child of the node of the given type, return null on failure */ public TNode firstChildOfType(int type) { TNode down = (TNode)getFirstChild(); - if(down == null) + if(down == null) return null; if(down.getType() == type) return down; return down.firstSiblingOfType(type); } - /** find the first sibling of the node + /** find the first sibling of the node of the given type, return null on failure */ public TNode firstSiblingOfType(int type) { TNode right = (TNode)getNextSibling(); - if(right == null) + if(right == null) return null; if(right.getType() == type) return right; diff --git a/src/java/com/jogamp/gluegen/cgram/TNodeFactory.java b/src/java/com/jogamp/gluegen/cgram/TNodeFactory.java index 0a3fbcb..2984a84 100644 --- a/src/java/com/jogamp/gluegen/cgram/TNodeFactory.java +++ b/src/java/com/jogamp/gluegen/cgram/TNodeFactory.java @@ -9,8 +9,8 @@ import antlr.collections.AST; public class TNodeFactory extends ASTFactory { /** Create a new ampty AST node */ - public AST create() { - return new TNode(); + public AST create() { + return new TNode(); } /** Create a new AST node from type and text */ @@ -29,5 +29,5 @@ public class TNodeFactory extends ASTFactory { return newast; } - + } diff --git a/src/java/com/jogamp/gluegen/cgram/types/ArrayType.java b/src/java/com/jogamp/gluegen/cgram/types/ArrayType.java index 7bd7d42..bad63db 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/ArrayType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/ArrayType.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -131,5 +131,5 @@ public class ArrayType extends MemoryLayoutType implements Cloneable { Type newCVVariant(int cvAttributes) { return new ArrayType(elementType, getSize(), length, cvAttributes); - } + } } diff --git a/src/java/com/jogamp/gluegen/cgram/types/BitType.java b/src/java/com/jogamp/gluegen/cgram/types/BitType.java index a7a1f55..4862749 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/BitType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/BitType.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -88,5 +88,5 @@ public class BitType extends IntType implements Cloneable { @Override Type newCVVariant(int cvAttributes) { return new BitType(underlyingType, sizeInBits, offset, cvAttributes); - } + } } diff --git a/src/java/com/jogamp/gluegen/cgram/types/CVAttributes.java b/src/java/com/jogamp/gluegen/cgram/types/CVAttributes.java index 34b703e..f8a6095 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/CVAttributes.java +++ b/src/java/com/jogamp/gluegen/cgram/types/CVAttributes.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java b/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java index 746212d..4582a81 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/CompoundType.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -70,7 +70,7 @@ public abstract class CompoundType extends MemoryLayoutType implements Cloneable throw new RuntimeException("OO relation "+kind+" / Compount not yet supported"); } } - + public Object clone() { CompoundType n = (CompoundType) super.clone(); if(null!=this.fields) { @@ -115,7 +115,7 @@ public abstract class CompoundType extends MemoryLayoutType implements Cloneable public String getStructName() { return structName; } - + /** Sets the struct name of this CompoundType, i.e. the "foo" in the construct "struct foo { ... };". */ public void setStructName(String structName) { @@ -132,7 +132,7 @@ public abstract class CompoundType extends MemoryLayoutType implements Cloneable ArrayList<Field> getFields() { return fields; } void setFields(ArrayList<Field> fields) { this.fields = fields; } - + /** Returns the number of fields in this type. */ public int getNumFields() { return ((fields == null) ? 0 : fields.size()); diff --git a/src/java/com/jogamp/gluegen/cgram/types/CompoundTypeKind.java b/src/java/com/jogamp/gluegen/cgram/types/CompoundTypeKind.java index 37b813c..62d8d42 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/CompoundTypeKind.java +++ b/src/java/com/jogamp/gluegen/cgram/types/CompoundTypeKind.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. @@ -32,9 +32,9 @@ package com.jogamp.gluegen.cgram.types; represented as compound types. Used while syntax parsing. */ public enum CompoundTypeKind { STRUCT(0), UNION(1); - + public final int id; - + CompoundTypeKind(int id){ this.id = id; } diff --git a/src/java/com/jogamp/gluegen/cgram/types/DoubleType.java b/src/java/com/jogamp/gluegen/cgram/types/DoubleType.java index 280485a..e95ffb9 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/DoubleType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/DoubleType.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/cgram/types/EnumType.java b/src/java/com/jogamp/gluegen/cgram/types/EnumType.java index d21774f..9e142bd 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/EnumType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/EnumType.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/cgram/types/Field.java b/src/java/com/jogamp/gluegen/cgram/types/Field.java index 891bb27..1c4b4fa 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/Field.java +++ b/src/java/com/jogamp/gluegen/cgram/types/Field.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/cgram/types/FloatType.java b/src/java/com/jogamp/gluegen/cgram/types/FloatType.java index 7766b8c..dff7a00 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/FloatType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/FloatType.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/cgram/types/FunctionSymbol.java b/src/java/com/jogamp/gluegen/cgram/types/FunctionSymbol.java index f730c0e..c4802e7 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/FunctionSymbol.java +++ b/src/java/com/jogamp/gluegen/cgram/types/FunctionSymbol.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,18 +28,18 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ package com.jogamp.gluegen.cgram.types; -/** +/** * Describes a function symbol, which includes the name and * type. Since we are currently only concerned with processing * functions this is the only symbol type, though plausibly more @@ -48,7 +48,7 @@ package com.jogamp.gluegen.cgram.types; * Note: Since C does not support method-overloading polymorphism like C++ or Java, * we ignore the {@link FunctionType} attribute in {@link #equals(Object)} and {@link #hashCode()}.<br/> * Hence we assume all method occurrences w/ same name are of equal or compatible type. <br/> - * Deep comparison can be performed via {@link #isCompletelyEqual(Object o)}; + * Deep comparison can be performed via {@link #isCompletelyEqual(Object o)}; * </p> **/ public class FunctionSymbol { @@ -135,7 +135,7 @@ public class FunctionSymbol { } /** - * Compares the function type as well, since {@link #equals(Object)} + * Compares the function type as well, since {@link #equals(Object)} * and {@link #hashCode()} won't. */ public boolean isCompletelyEqual(Object arg) { diff --git a/src/java/com/jogamp/gluegen/cgram/types/FunctionType.java b/src/java/com/jogamp/gluegen/cgram/types/FunctionType.java index fcaf97b..c32d184 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/FunctionType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/FunctionType.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/cgram/types/IntType.java b/src/java/com/jogamp/gluegen/cgram/types/IntType.java index b85c7fc..b37e741 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/IntType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/IntType.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/cgram/types/MemoryLayoutType.java b/src/java/com/jogamp/gluegen/cgram/types/MemoryLayoutType.java index f8f83d3..df0d23e 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/MemoryLayoutType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/MemoryLayoutType.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. @@ -32,10 +32,10 @@ public abstract class MemoryLayoutType extends Type { protected MemoryLayoutType(String name, SizeThunk size, int cvAttributes) { super(name, size, cvAttributes); - isLayouted = false; + isLayouted = false; } public boolean isLayouted() { return isLayouted; } public void setLayouted() { isLayouted = true; } - + } diff --git a/src/java/com/jogamp/gluegen/cgram/types/PointerType.java b/src/java/com/jogamp/gluegen/cgram/types/PointerType.java index 4666e48..92544c5 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/PointerType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/PointerType.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/cgram/types/PrimitiveType.java b/src/java/com/jogamp/gluegen/cgram/types/PrimitiveType.java index 1eea9a4..9d108df 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/PrimitiveType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/PrimitiveType.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/cgram/types/SizeThunk.java b/src/java/com/jogamp/gluegen/cgram/types/SizeThunk.java index 33b17cc..b40d4f3 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/SizeThunk.java +++ b/src/java/com/jogamp/gluegen/cgram/types/SizeThunk.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -48,8 +48,8 @@ import com.jogamp.common.os.MachineDescription; 32-bit and 64-bit) from the same internal representation of the various types involved. */ public abstract class SizeThunk implements Cloneable { - private boolean fixedNativeSize; - + private boolean fixedNativeSize; + // Private constructor because there are only a few of these private SizeThunk(boolean fixedNativeSize) { this.fixedNativeSize = fixedNativeSize; } @@ -60,7 +60,7 @@ public abstract class SizeThunk implements Cloneable { throw new InternalError(); } } - + public final boolean hasFixedNativeSize() { return fixedNativeSize; } public abstract long computeSize(MachineDescription machDesc); @@ -156,7 +156,7 @@ public abstract class SizeThunk implements Cloneable { return thunk1.computeSize(machDesc) + thunk2.computeSize(machDesc); } public long computeAlignment(MachineDescription machDesc) { - final long thunk1A = thunk1.computeAlignment(machDesc); + final long thunk1A = thunk1.computeAlignment(machDesc); final long thunk2A = thunk2.computeAlignment(machDesc); return ( thunk1A > thunk2A ) ? thunk1A : thunk2A ; } @@ -170,7 +170,7 @@ public abstract class SizeThunk implements Cloneable { return thunk1.computeSize(machDesc) * thunk2.computeSize(machDesc); } public long computeAlignment(MachineDescription machDesc) { - final long thunk1A = thunk1.computeAlignment(machDesc); + final long thunk1A = thunk1.computeAlignment(machDesc); final long thunk2A = thunk2.computeAlignment(machDesc); return ( thunk1A > thunk2A ) ? thunk1A : thunk2A ; } @@ -185,17 +185,17 @@ public abstract class SizeThunk implements Cloneable { // remainder = net_size & ( alignment - 1 ) // padding = alignment - remainder ; // aligned_size = net_size + padding ; - + final long size = offsetThunk.computeSize(machDesc); final long alignment = alignmentThunk.computeAlignment(machDesc); - + final long remainder = size & ( alignment - 1 ) ; final long padding = (remainder > 0) ? alignment - remainder : 0; return size + padding; } - + public long computeAlignment(MachineDescription machDesc) { - final long thunk1A = offsetThunk.computeAlignment(machDesc); + final long thunk1A = offsetThunk.computeAlignment(machDesc); final long thunk2A = alignmentThunk.computeAlignment(machDesc); return ( thunk1A > thunk2A ) ? thunk1A : thunk2A ; } @@ -209,7 +209,7 @@ public abstract class SizeThunk implements Cloneable { return Math.max(thunk1.computeSize(machDesc), thunk2.computeSize(machDesc)); } public long computeAlignment(MachineDescription machDesc) { - final long thunk1A = thunk1.computeAlignment(machDesc); + final long thunk1A = thunk1.computeAlignment(machDesc); final long thunk2A = thunk2.computeAlignment(machDesc); return ( thunk1A > thunk2A ) ? thunk1A : thunk2A ; } @@ -222,8 +222,8 @@ public abstract class SizeThunk implements Cloneable { return constant; } public long computeAlignment(MachineDescription machDesc) { - return 1; // no alignment for constants - } + return 1; // no alignment for constants + } }; } } diff --git a/src/java/com/jogamp/gluegen/cgram/types/StructLayout.java b/src/java/com/jogamp/gluegen/cgram/types/StructLayout.java index 60284b9..11501e1 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/StructLayout.java +++ b/src/java/com/jogamp/gluegen/cgram/types/StructLayout.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -56,7 +56,7 @@ public class StructLayout { public void layout(CompoundType t) { /** - * - 1) align offset for the new data type, + * - 1) align offset for the new data type, * - 2) add the aligned size of the new data type * - 3) add trailing padding (largest element size) */ @@ -123,7 +123,7 @@ public class StructLayout { curOffset = SizeThunk.align(curOffset, curOffset); t.setSize(curOffset); } - t.setLayouted(); + t.setLayouted(); } public static StructLayout create(int baseOffset) { @@ -132,5 +132,5 @@ public class StructLayout { public static void layout(int baseOffset, CompoundType t) { create(baseOffset).layout(t); - } + } } diff --git a/src/java/com/jogamp/gluegen/cgram/types/StructType.java b/src/java/com/jogamp/gluegen/cgram/types/StructType.java index cade91c..74fca7c 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/StructType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/StructType.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. @@ -32,7 +32,7 @@ public class StructType extends CompoundType { public StructType(String name, SizeThunk size, int cvAttributes) { this(name, size, cvAttributes, null); } - + StructType(String name, SizeThunk size, int cvAttributes, String structName) { super (name, size, cvAttributes, structName); } @@ -47,11 +47,11 @@ public class StructType extends CompoundType { public final boolean isStruct() { return true; } public final boolean isUnion() { return false; } - + Type newCVVariant(int cvAttributes) { StructType t = new StructType(getName(), getSize(), cvAttributes, getStructName()); t.setFields(getFields()); return t; } - + } diff --git a/src/java/com/jogamp/gluegen/cgram/types/TypeDictionary.java b/src/java/com/jogamp/gluegen/cgram/types/TypeDictionary.java index be2adb4..3994c12 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/TypeDictionary.java +++ b/src/java/com/jogamp/gluegen/cgram/types/TypeDictionary.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -92,7 +92,7 @@ public class TypeDictionary { return map.remove(name); } - /** Get all the names that map to Types. + /** Get all the names that map to Types. * @return a Set of Strings that are the typedef names that map to Types in the dictionary. */ public Set<String> keySet() { @@ -106,7 +106,7 @@ public class TypeDictionary { public boolean containsKey(String key) { return map.containsKey(key); } - + public boolean containsValue(Type value) { return map.containsValue(value); } diff --git a/src/java/com/jogamp/gluegen/cgram/types/TypeVisitor.java b/src/java/com/jogamp/gluegen/cgram/types/TypeVisitor.java index 0889681..89c014b 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/TypeVisitor.java +++ b/src/java/com/jogamp/gluegen/cgram/types/TypeVisitor.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/cgram/types/UnionType.java b/src/java/com/jogamp/gluegen/cgram/types/UnionType.java index 4de10da..857507c 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/UnionType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/UnionType.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. @@ -32,11 +32,11 @@ public class UnionType extends CompoundType { public UnionType(String name, SizeThunk size, int cvAttributes) { this(name, size, cvAttributes, null); } - + UnionType(String name, SizeThunk size, int cvAttributes, String structName) { super (name, size, cvAttributes, structName); } - + @Override public boolean equals(Object arg) { if (arg == null || !(arg instanceof UnionType)) { @@ -44,7 +44,7 @@ public class UnionType extends CompoundType { } return super.equals(arg); } - + public final boolean isStruct() { return false; } public final boolean isUnion() { return true; } @@ -53,5 +53,5 @@ public class UnionType extends CompoundType { t.setFields(getFields()); return t; } - + } diff --git a/src/java/com/jogamp/gluegen/cgram/types/VoidType.java b/src/java/com/jogamp/gluegen/cgram/types/VoidType.java index fa098e7..1f76e70 100644 --- a/src/java/com/jogamp/gluegen/cgram/types/VoidType.java +++ b/src/java/com/jogamp/gluegen/cgram/types/VoidType.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2010 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/jgram/Test.java b/src/java/com/jogamp/gluegen/jgram/Test.java index c890f67..8baff02 100644 --- a/src/java/com/jogamp/gluegen/jgram/Test.java +++ b/src/java/com/jogamp/gluegen/jgram/Test.java @@ -86,16 +86,16 @@ class Test { String s = (String) iter.next(); System.out.println(s); } - + // do something with the tree //doTreeAction(f, parser.getAST(), parser.getTokenNames()); } catch (Exception e) { System.err.println("parser exception: "+e); - e.printStackTrace(); // so we can get stack trace + e.printStackTrace(); // so we can get stack trace } } - + /* public static void doTreeAction(String f, AST t, String[] tokenNames) { if ( t==null ) return; diff --git a/src/java/com/jogamp/gluegen/pcpp/ConcatenatingReader.java b/src/java/com/jogamp/gluegen/pcpp/ConcatenatingReader.java index 1eea281..c7e3635 100644 --- a/src/java/com/jogamp/gluegen/pcpp/ConcatenatingReader.java +++ b/src/java/com/jogamp/gluegen/pcpp/ConcatenatingReader.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java index aecb079..49ff4fc 100644 --- a/src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java +++ b/src/java/com/jogamp/gluegen/procaddress/ProcAddressCMethodBindingEmitter.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -57,7 +57,7 @@ public class ProcAddressCMethodBindingEmitter extends CMethodBindingEmitter { public ProcAddressCMethodBindingEmitter(CMethodBindingEmitter methodToWrap, final boolean callThroughProcAddress, boolean needsLocalTypedef, String localTypedefCallingConvention, ProcAddressEmitter emitter) { - + super( new MethodBinding(methodToWrap.getBinding()) { @Override diff --git a/src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java b/src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java index 7bd9241..14b15d2 100644 --- a/src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java +++ b/src/java/com/jogamp/gluegen/procaddress/ProcAddressConfiguration.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ diff --git a/src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java b/src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java index 57b29e9..afaf7d1 100644 --- a/src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java +++ b/src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2013 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,11 +29,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -69,7 +69,7 @@ import com.jogamp.gluegen.runtime.ProcAddressTable; public class ProcAddressEmitter extends JavaEmitter { /** Must be synchronized w/ ProcAddressTable.PROCADDRESS_VAR_PREFIX !!! */ - public static final String PROCADDRESS_VAR_PREFIX = "_addressof_"; + public static final String PROCADDRESS_VAR_PREFIX = "_addressof_"; protected static final String WRAP_PREFIX = "dispatch_"; private TypeDictionary typedefDictionary; protected PrintWriter tableWriter; @@ -182,8 +182,8 @@ public class ProcAddressEmitter extends JavaEmitter { /** If 'native', enforce 'private native' modifiers. */ protected void fixSecurityModifiers(JavaMethodBindingEmitter javaEmitter) { - if( javaEmitter.hasModifier(JavaMethodBindingEmitter.NATIVE) && - !javaEmitter.hasModifier(JavaMethodBindingEmitter.PRIVATE) ) + if( javaEmitter.hasModifier(JavaMethodBindingEmitter.NATIVE) && + !javaEmitter.hasModifier(JavaMethodBindingEmitter.PRIVATE) ) { javaEmitter.removeModifier(JavaMethodBindingEmitter.PUBLIC); javaEmitter.removeModifier(JavaMethodBindingEmitter.PROTECTED); @@ -192,7 +192,7 @@ public class ProcAddressEmitter extends JavaEmitter { javaEmitter.addModifier(JavaMethodBindingEmitter.NATIVE); } } - + protected void generateModifiedEmitters(JavaMethodBindingEmitter baseJavaEmitter, List<FunctionEmitter> emitters) { // See whether we need a proc address entry for this one boolean callThroughProcAddress = needsProcAddressWrapper(baseJavaEmitter.getBinding().getCSymbol()); @@ -210,8 +210,8 @@ public class ProcAddressEmitter extends JavaEmitter { !baseJavaEmitter.hasModifier(JavaMethodBindingEmitter.PRIVATE) && baseJavaEmitter.hasModifier(JavaMethodBindingEmitter.NATIVE) && callThroughProcAddress; - - + + { final ProcAddressJavaMethodBindingEmitter emitter = new ProcAddressJavaMethodBindingEmitter(baseJavaEmitter, callThroughProcAddress, @@ -219,7 +219,7 @@ public class ProcAddressEmitter extends JavaEmitter { baseJavaEmitter.isForImplementingMethodCall(), this); if( needsJavaWrapper ) { - emitter.setEmitBody(true); + emitter.setEmitBody(true); emitter.removeModifier(JavaMethodBindingEmitter.NATIVE); } else if ( callThroughProcAddress ) { fixSecurityModifiers(emitter); @@ -310,7 +310,7 @@ public class ProcAddressEmitter extends JavaEmitter { } final String fullTableClassName = implPackageName + "." + tableClassName; final MethodAccess tableClassAccess = cfg.accessControl(fullTableClassName); - + final String jImplRoot = getJavaOutputDir() + File.separator + CodeGenUtils.packageAsPath(implPackageName); tableWriter = openFile(jImplRoot + File.separator + tableClassName + ".java", tableClassName); diff --git a/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java b/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java index 443c1d8..407d58f 100644 --- a/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java +++ b/src/java/com/jogamp/gluegen/procaddress/ProcAddressJavaMethodBindingEmitter.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,11 +28,11 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ @@ -50,7 +50,7 @@ public class ProcAddressJavaMethodBindingEmitter extends JavaMethodBindingEmitte protected boolean callThroughProcAddress; protected boolean changeNameAndArguments; - + protected String getProcAddressTableExpr; protected ProcAddressEmitter emitter; diff --git a/src/java/com/jogamp/gluegen/runtime/FunctionAddressResolver.java b/src/java/com/jogamp/gluegen/runtime/FunctionAddressResolver.java index 6db52d1..4fc40a4 100644 --- a/src/java/com/jogamp/gluegen/runtime/FunctionAddressResolver.java +++ b/src/java/com/jogamp/gluegen/runtime/FunctionAddressResolver.java @@ -3,14 +3,14 @@ * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR @@ -20,7 +20,7 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of JogAmp Community. @@ -43,5 +43,5 @@ public interface FunctionAddressResolver { * Resolves the name of the function bound to the method and returns the address. */ public long resolve(String name, DynamicLookupHelper lookup); - + } diff --git a/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java b/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java index d331187..f54d5db 100644 --- a/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java +++ b/src/java/com/jogamp/gluegen/runtime/ProcAddressTable.java @@ -1,22 +1,22 @@ /* * Copyright (c) 2003-2005 Sun Microsystems, Inc. All Rights Reserved. * Copyright (c) 2013 JogAmp Community. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -29,7 +29,7 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. @@ -119,13 +119,13 @@ public abstract class ProcAddressTable { */ public void reset(DynamicLookupHelper lookup) throws SecurityException, RuntimeException { SecurityUtil.checkAllLinkPermission(); - + if(null==lookup) { throw new RuntimeException("Passed null DynamicLookupHelper"); } final Field[] fields = getClass().getDeclaredFields(); - + final PrintStream dout; if (DEBUG) { dout = getDebugOutStream(); @@ -133,10 +133,10 @@ public abstract class ProcAddressTable { } else { dout = null; } - + // All at once - performance. AccessibleObject.setAccessible(fields, true); - + for (int i = 0; i < fields.length; ++i) { final String fieldName = fields[i].getName(); if ( isAddressField(fieldName) ) { @@ -173,7 +173,7 @@ public abstract class ProcAddressTable { private final void setEntry(final Field addressField, final String funcName, final DynamicLookupHelper lookup) throws SecurityException { try { assert (addressField.getType() == Long.TYPE); - final long newProcAddress = resolver.resolve(funcName, lookup); + final long newProcAddress = resolver.resolve(funcName, lookup); addressField.setLong(this, newProcAddress); if (DEBUG) { getDebugOutStream().println(" " + addressField.getName() + " -> 0x" + Long.toHexString(newProcAddress)); @@ -195,14 +195,14 @@ public abstract class ProcAddressTable { throw new IllegalArgumentException(getClass().getName() +" has no entry for the function '"+name+"'.", ex); } } - - /** + + /** * Warning: Returns an accessible probably protected field! * <p> * Caller should have checked link permissions * for <b>all</b> libraries, i.e. for <code>new RuntimePermission("loadLibrary.*");</code> * <i>if</i> exposing the field or address! - * </p> + * </p> */ private final Field fieldForFunctionInSec(final String name) throws IllegalArgumentException { return AccessController.doPrivileged(new PrivilegedAction<Field>() { @@ -243,7 +243,7 @@ public abstract class ProcAddressTable { /** * Returns this table as map with the function name as key and the address as value. */ - private final Map<String, Long> toMap() { + private final Map<String, Long> toMap() { final SortedMap<String, Long> map = new TreeMap<String, Long>(); final Field[] fields = getClass().getFields(); @@ -259,7 +259,7 @@ public abstract class ProcAddressTable { } catch (IllegalAccessException ex) { throw new RuntimeException(ex); } - + return map; } @@ -292,7 +292,7 @@ public abstract class ProcAddressTable { throw new RuntimeException(ex); } } - + /** * This is a convenience method to query the native function handle by name. * <p> @@ -317,7 +317,7 @@ public abstract class ProcAddressTable { throw new RuntimeException(ex); } } - + /** * Returns all functions pointing to null. */ diff --git a/src/java/com/jogamp/gluegen/structgen/CStructAnnotationProcessor.java b/src/java/com/jogamp/gluegen/structgen/CStructAnnotationProcessor.java index 841fa1d..1eda788 100644 --- a/src/java/com/jogamp/gluegen/structgen/CStructAnnotationProcessor.java +++ b/src/java/com/jogamp/gluegen/structgen/CStructAnnotationProcessor.java @@ -73,7 +73,7 @@ import jogamp.common.Debug; * <p> * User can enable DEBUG while defining property <code>jogamp.gluegen.structgen.debug</code>. * </p> - * + * * @author Michael Bien * @author Sven Gothel, et.al. */ @@ -82,15 +82,15 @@ import jogamp.common.Debug; public class CStructAnnotationProcessor extends AbstractProcessor { private static final String DEFAULT = "_default_"; private static final boolean DEBUG; - + static { Debug.initSingleton(); DEBUG = Debug.isPropertyDefined("jogamp.gluegen.structgen.debug", true); } - + private static final String STRUCTGENOUTPUT_OPTION = "structgen.output"; private static final String STRUCTGENOUTPUT = PropertyAccess.getProperty("jogamp.gluegen."+STRUCTGENOUTPUT_OPTION, true, "gensrc"); - + private Filer filer; private Messager messager; private Elements eltUtils; @@ -113,7 +113,7 @@ public class CStructAnnotationProcessor extends AbstractProcessor { private File locateSource(String packageName, String relativeName) { try { - if( DEBUG ) { + if( DEBUG ) { System.err.println("CStruct.locateSource.0: p "+packageName+", r "+relativeName); } final FileObject h = filer.getResource(StandardLocation.SOURCE_PATH, packageName, relativeName); @@ -127,7 +127,7 @@ public class CStructAnnotationProcessor extends AbstractProcessor { } catch (IOException e) { if(DEBUG) { System.err.println("Catched "+e.getClass().getSimpleName()+": "+e.getMessage()); /* e.printStackTrace(); */ } } return null; } - + @Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment env) { final String user_dir = System.getProperty("user.dir"); @@ -142,14 +142,14 @@ public class CStructAnnotationProcessor extends AbstractProcessor { final CStruct struct = element.getAnnotation(CStruct.class); final String headerRelPath = struct.header(); final Element enclElement = element.getEnclosingElement(); - - System.err.println("CStruct: "+struct+", package "+packageName+", header "+headerRelPath); + + System.err.println("CStruct: "+struct+", package "+packageName+", header "+headerRelPath); if(DEBUG) { System.err.println("CStruct.0: user.dir: "+user_dir); System.err.println("CStruct.0: element: "+element+", .simpleName "+element.getSimpleName()); - System.err.println("CStruct.0: enclElement: "+enclElement+", .simpleName "+enclElement.getSimpleName()+", .package "+eltUtils.getPackageOf(enclElement).toString()); + System.err.println("CStruct.0: enclElement: "+enclElement+", .simpleName "+enclElement.getSimpleName()+", .package "+eltUtils.getPackageOf(enclElement).toString()); } - + final File headerFile; { File f = locateSource(packageName, headerRelPath); @@ -162,7 +162,7 @@ public class CStructAnnotationProcessor extends AbstractProcessor { } headerFile = f; } - + final String root; { String root0 = headerFile.getAbsolutePath(); |