From 791a2749886f02ec7b8db25bf8862e8269b96da5 Mon Sep 17 00:00:00 2001
From: Harvey Harrison
Date: Thu, 17 Oct 2013 21:06:56 -0700
Subject: gluegen: remove trailing whitespace
Signed-off-by: Harvey Harrison
---
src/java/com/jogamp/common/GlueGenVersion.java | 10 +-
.../com/jogamp/common/JogampRuntimeException.java | 10 +-
.../com/jogamp/common/jvm/JNILibLoaderBase.java | 96 +++---
.../com/jogamp/common/net/AssetURLConnection.java | 42 +--
.../com/jogamp/common/net/AssetURLContext.java | 60 ++--
.../jogamp/common/net/AssetURLStreamHandler.java | 16 +-
.../common/net/GenericURLStreamHandlerFactory.java | 12 +-
.../jogamp/common/net/PiggybackURLConnection.java | 26 +-
.../com/jogamp/common/net/PiggybackURLContext.java | 10 +-
src/java/com/jogamp/common/net/asset/Handler.java | 12 +-
src/java/com/jogamp/common/nio/AbstractBuffer.java | 20 +-
src/java/com/jogamp/common/nio/Buffers.java | 156 +++++-----
.../com/jogamp/common/nio/CachedBufferFactory.java | 54 ++--
src/java/com/jogamp/common/nio/NativeBuffer.java | 16 +-
src/java/com/jogamp/common/nio/PointerBuffer.java | 44 +--
src/java/com/jogamp/common/nio/StructAccessor.java | 50 +--
src/java/com/jogamp/common/os/AndroidVersion.java | 28 +-
.../com/jogamp/common/os/DynamicLibraryBundle.java | 58 ++--
.../jogamp/common/os/DynamicLibraryBundleInfo.java | 40 +--
src/java/com/jogamp/common/os/DynamicLinker.java | 36 +--
.../com/jogamp/common/os/DynamicLookupHelper.java | 20 +-
.../com/jogamp/common/os/MachineDescription.java | 82 ++---
src/java/com/jogamp/common/os/NativeLibrary.java | 58 ++--
src/java/com/jogamp/common/os/Platform.java | 148 ++++-----
src/java/com/jogamp/common/util/ArrayHashSet.java | 14 +-
src/java/com/jogamp/common/util/FloatStack.java | 60 ++--
src/java/com/jogamp/common/util/Function.java | 12 +-
src/java/com/jogamp/common/util/FunctionTask.java | 28 +-
src/java/com/jogamp/common/util/HashUtil.java | 20 +-
src/java/com/jogamp/common/util/IOUtil.java | 346 ++++++++++-----------
src/java/com/jogamp/common/util/IntBitfield.java | 42 +--
src/java/com/jogamp/common/util/IntIntHashMap.java | 90 +++---
src/java/com/jogamp/common/util/JarUtil.java | 178 +++++------
src/java/com/jogamp/common/util/JogampVersion.java | 18 +-
src/java/com/jogamp/common/util/LFRingbuffer.java | 100 +++---
.../com/jogamp/common/util/PrimitiveStack.java | 28 +-
.../com/jogamp/common/util/PropertyAccess.java | 46 +--
.../com/jogamp/common/util/ReflectionUtil.java | 54 ++--
src/java/com/jogamp/common/util/Ringbuffer.java | 58 ++--
.../com/jogamp/common/util/RunnableExecutor.java | 22 +-
src/java/com/jogamp/common/util/RunnableTask.java | 30 +-
src/java/com/jogamp/common/util/SecurityUtil.java | 44 +--
.../com/jogamp/common/util/SyncedRingbuffer.java | 94 +++---
src/java/com/jogamp/common/util/TaskBase.java | 50 +--
src/java/com/jogamp/common/util/ValueConv.java | 36 +--
src/java/com/jogamp/common/util/VersionNumber.java | 76 ++---
.../jogamp/common/util/VersionNumberString.java | 20 +-
src/java/com/jogamp/common/util/VersionUtil.java | 18 +-
.../com/jogamp/common/util/awt/AWTEDTExecutor.java | 20 +-
.../jogamp/common/util/cache/TempFileCache.java | 54 ++--
.../com/jogamp/common/util/cache/TempJarCache.java | 144 ++++-----
src/java/com/jogamp/common/util/locks/Lock.java | 6 +-
.../com/jogamp/common/util/locks/LockFactory.java | 14 +-
.../jogamp/common/util/locks/RecursiveLock.java | 2 +-
.../util/locks/RecursiveThreadGroupLock.java | 66 ++--
.../common/util/locks/SingletonInstance.java | 20 +-
.../com/jogamp/common/util/locks/ThreadLock.java | 14 +-
src/java/com/jogamp/gluegen/ArrayTypes.java | 14 +-
.../com/jogamp/gluegen/CMethodBindingEmitter.java | 130 ++++----
src/java/com/jogamp/gluegen/CodeGenUtils.java | 14 +-
src/java/com/jogamp/gluegen/CommentEmitter.java | 16 +-
.../com/jogamp/gluegen/ConstantDefinition.java | 22 +-
src/java/com/jogamp/gluegen/DebugEmitter.java | 20 +-
src/java/com/jogamp/gluegen/FunctionEmitter.java | 38 +--
src/java/com/jogamp/gluegen/GlueEmitter.java | 16 +-
.../com/jogamp/gluegen/GlueEmitterControls.java | 14 +-
src/java/com/jogamp/gluegen/GlueGen.java | 24 +-
src/java/com/jogamp/gluegen/JavaConfiguration.java | 62 ++--
src/java/com/jogamp/gluegen/JavaEmitter.java | 48 +--
.../jogamp/gluegen/JavaMethodBindingEmitter.java | 2 +-
src/java/com/jogamp/gluegen/JavaType.java | 36 +--
src/java/com/jogamp/gluegen/Logging.java | 14 +-
src/java/com/jogamp/gluegen/ReferencedStructs.java | 16 +-
src/java/com/jogamp/gluegen/SymbolFilter.java | 12 +-
src/java/com/jogamp/gluegen/TypeInfo.java | 14 +-
.../com/jogamp/gluegen/cgram/CSymbolTable.java | 12 +-
src/java/com/jogamp/gluegen/cgram/CToken.java | 12 +-
src/java/com/jogamp/gluegen/cgram/Define.java | 14 +-
src/java/com/jogamp/gluegen/cgram/LineObject.java | 30 +-
.../gluegen/cgram/PreprocessorInfoChannel.java | 4 +-
src/java/com/jogamp/gluegen/cgram/TNode.java | 104 +++----
.../com/jogamp/gluegen/cgram/TNodeFactory.java | 6 +-
.../com/jogamp/gluegen/cgram/types/ArrayType.java | 16 +-
.../com/jogamp/gluegen/cgram/types/BitType.java | 16 +-
.../jogamp/gluegen/cgram/types/CVAttributes.java | 14 +-
.../jogamp/gluegen/cgram/types/CompoundType.java | 20 +-
.../gluegen/cgram/types/CompoundTypeKind.java | 12 +-
.../com/jogamp/gluegen/cgram/types/DoubleType.java | 14 +-
.../com/jogamp/gluegen/cgram/types/EnumType.java | 14 +-
src/java/com/jogamp/gluegen/cgram/types/Field.java | 14 +-
.../com/jogamp/gluegen/cgram/types/FloatType.java | 14 +-
.../jogamp/gluegen/cgram/types/FunctionSymbol.java | 20 +-
.../jogamp/gluegen/cgram/types/FunctionType.java | 14 +-
.../com/jogamp/gluegen/cgram/types/IntType.java | 14 +-
.../gluegen/cgram/types/MemoryLayoutType.java | 12 +-
.../jogamp/gluegen/cgram/types/PointerType.java | 14 +-
.../jogamp/gluegen/cgram/types/PrimitiveType.java | 14 +-
.../com/jogamp/gluegen/cgram/types/SizeThunk.java | 38 +--
.../jogamp/gluegen/cgram/types/StructLayout.java | 20 +-
.../com/jogamp/gluegen/cgram/types/StructType.java | 14 +-
.../jogamp/gluegen/cgram/types/TypeDictionary.java | 18 +-
.../jogamp/gluegen/cgram/types/TypeVisitor.java | 14 +-
.../com/jogamp/gluegen/cgram/types/UnionType.java | 16 +-
.../com/jogamp/gluegen/cgram/types/VoidType.java | 14 +-
src/java/com/jogamp/gluegen/jgram/Test.java | 6 +-
.../jogamp/gluegen/pcpp/ConcatenatingReader.java | 14 +-
.../ProcAddressCMethodBindingEmitter.java | 16 +-
.../procaddress/ProcAddressConfiguration.java | 14 +-
.../gluegen/procaddress/ProcAddressEmitter.java | 30 +-
.../ProcAddressJavaMethodBindingEmitter.java | 16 +-
.../gluegen/runtime/FunctionAddressResolver.java | 10 +-
.../jogamp/gluegen/runtime/ProcAddressTable.java | 36 +--
.../structgen/CStructAnnotationProcessor.java | 22 +-
src/java/jogamp/common/Debug.java | 16 +-
src/java/jogamp/common/jvm/JVMUtil.java | 14 +-
src/java/jogamp/common/os/AndroidUtils.java | 28 +-
.../jogamp/common/os/BionicDynamicLinkerImpl.java | 8 +-
src/java/jogamp/common/os/DynamicLinkerImpl.java | 14 +-
.../jogamp/common/os/MacOSXDynamicLinkerImpl.java | 6 +-
.../common/os/MachineDescriptionRuntime.java | 46 +--
src/java/jogamp/common/os/PlatformPropsImpl.java | 104 +++----
.../jogamp/common/os/PosixDynamicLinkerImpl.java | 4 +-
.../jogamp/common/os/UnixDynamicLinkerImpl.java | 12 +-
.../jogamp/common/os/WindowsDynamicLinkerImpl.java | 8 +-
src/java/jogamp/common/os/elf/ElfHeader.java | 148 ++++-----
src/java/jogamp/common/os/elf/IOUtils.java | 54 ++--
src/java/jogamp/common/os/elf/Section.java | 6 +-
.../jogamp/common/os/elf/SectionArmAttributes.java | 100 +++---
src/java/jogamp/common/os/elf/SectionHeader.java | 32 +-
.../jogamp/common/util/locks/LockDebugUtil.java | 4 +-
.../locks/RecursiveLockImpl01CompleteFair.java | 54 ++--
.../util/locks/RecursiveLockImpl01Unfairish.java | 54 ++--
.../common/util/locks/RecursiveLockImplJava5.java | 6 +-
.../RecursiveThreadGroupLockImpl01Unfairish.java | 66 ++--
.../util/locks/SingletonInstanceFileLock.java | 14 +-
.../util/locks/SingletonInstanceServerSocket.java | 76 ++---
136 files changed, 2508 insertions(+), 2508 deletions(-)
(limited to 'src')
diff --git a/src/java/com/jogamp/common/GlueGenVersion.java b/src/java/com/jogamp/common/GlueGenVersion.java
index 5ae3412..a20b153 100644
--- a/src/java/com/jogamp/common/GlueGenVersion.java
+++ b/src/java/com/jogamp/common/GlueGenVersion.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.
*/
-
+
package com.jogamp.common;
import com.jogamp.common.util.JogampVersion;
diff --git a/src/java/com/jogamp/common/JogampRuntimeException.java b/src/java/com/jogamp/common/JogampRuntimeException.java
index 1dd7519..7298812 100644
--- a/src/java/com/jogamp/common/JogampRuntimeException.java
+++ b/src/java/com/jogamp/common/JogampRuntimeException.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.
*/
-
+
package com.jogamp.common;
/** A generic exception for Jogamp errors used throughout the binding
diff --git a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
index 67cc05c..1b19d04 100644
--- a/src/java/com/jogamp/common/jvm/JNILibLoaderBase.java
+++ b/src/java/com/jogamp/common/jvm/JNILibLoaderBase.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.
*/
@@ -62,14 +62,14 @@ import jogamp.common.Debug;
import jogamp.common.os.PlatformPropsImpl;
public class JNILibLoaderBase {
- public static final boolean DEBUG = Debug.debug("JNILibLoader");
+ public static final boolean DEBUG = Debug.debug("JNILibLoader");
public interface LoaderAction {
/**
* Loads the library specified by libname.
* The implementation should ignore, if the library has been loaded already.
* @param libname the library to load
- * @param ignoreError if true, errors during loading the library should be ignored
+ * @param ignoreError if true, errors during loading the library should be ignored
* @param cl optional ClassLoader, used to locate the library
* @return true if library loaded successful
*/
@@ -81,12 +81,12 @@ public class JNILibLoaderBase {
* The implementation should ignore, if any library has been loaded already.
* @param libname the library to load
* @param preload the libraries to load before loading the main library if not null
- * @param preloadIgnoreError if true, errors during loading the preload-libraries should be ignored
+ * @param preloadIgnoreError if true, errors during loading the preload-libraries should be ignored
* @param cl optional ClassLoader, used to locate the library
*/
void loadLibrary(String libname, String[] preload, boolean preloadIgnoreError, ClassLoader cl);
}
-
+
private static class DefaultAction implements LoaderAction {
public boolean loadLibrary(String libname, boolean ignoreError, ClassLoader cl) {
boolean res = true;
@@ -143,13 +143,13 @@ public class JNILibLoaderBase {
public static void enableLoading() {
setLoadingAction(new DefaultAction());
}
-
+
public static synchronized void setLoadingAction(LoaderAction action) {
loaderAction = action;
}
/**
- *
+ *
* @param classFromJavaJar
* @param classJarURI
* @param jarBasename jar basename w/ suffix
@@ -170,16 +170,16 @@ public class JNILibLoaderBase {
if(TempJarCache.isInitialized()) {
final URI jarSubURI = JarUtil.getJarSubURI( classJarURI );
if(null == jarSubURI) {
- throw new IllegalArgumentException("JarSubURI is null of: "+classJarURI);
+ throw new IllegalArgumentException("JarSubURI is null of: "+classJarURI);
}
final String jarUriRoot_s = IOUtil.getURIDirname( jarSubURI.toString() );
msg.append("[ ").append(jarSubURI.toString()).append(" -> ").append(jarUriRoot_s).append(" ] + ");
-
+
final String nativeLibraryPath = "natives/"+PlatformPropsImpl.os_and_arch+"/";
final ClassLoader cl = classFromJavaJar.getClassLoader();
final URL nativeLibraryURI = cl.getResource(nativeLibraryPath);
if( null != nativeLibraryURI ) {
- // We probably have one big-fat jar file, containing java classes
+ // We probably have one big-fat jar file, containing java classes
// and all native platform libraries under 'natives/os.and.arch'!
final URI nativeJarURI = JarUtil.getJarFileURI(jarUriRoot_s+jarBasename);
if( TempJarCache.addNativeLibs(classFromJavaJar, nativeJarURI, nativeLibraryPath) ) {
@@ -188,7 +188,7 @@ public class JNILibLoaderBase {
}
}
if( !ok ) {
- // We assume one slim native jar file per 'os.and.arch'!
+ // We assume one slim native jar file per 'os.and.arch'!
final URI nativeJarURI = JarUtil.getJarFileURI(jarUriRoot_s+nativeJarBasename);
msg.append(nativeJarBasename).append(" -> slim: ").append(nativeJarURI);
ok = TempJarCache.addNativeLibs(classFromJavaJar, nativeJarURI, null /* nativeLibraryPath */);
@@ -201,22 +201,22 @@ public class JNILibLoaderBase {
}
return ok;
}
-
+
/**
* Loads and adds a JAR file's native library to the TempJarCache.
* The native library JAR file's URI is derived as follows:
*
- *
+ *
* @param classFromJavaJar GLProfile
* @param nativeJarBasename jogl-all
* @return true if the native JAR file loaded successful or were loaded already, false in case of an error
@@ -234,15 +234,15 @@ public class JNILibLoaderBase {
if(DEBUG) {
e0.printStackTrace();
}
- }
+ }
} else if(DEBUG) {
System.err.println("JNILibLoaderBase: addNativeJarLibs1: disabled due to uninitialized TempJarCache");
}
return false;
}
-
+
/**
- * Loads and adds a JAR file's native library to the TempJarCache,
+ * Loads and adds a JAR file's native library to the TempJarCache,
* calling {@link JNILibLoaderBase#addNativeJarLibs(Class[], String, String[])}
* with default JOGL deployment configuration:
*
@@ -258,7 +258,7 @@ public class JNILibLoaderBase {
*
ClassJar1[-noawt,-mobile,-core,-android]?.jar to ClassJar1-natives-os.and.arch.jar
*
ClassJar2[-noawt,-mobile,-core,-android]?.jar to ClassJar2-natives-os.and.arch.jar
*
..
- *
+ *
*/
public static final boolean addNativeJarLibsJoglCfg(final Class>[] classesFromJavaJars) {
return addNativeJarLibs(classesFromJavaJars, "-all", joglDeployCfg);
@@ -269,11 +269,11 @@ public class JNILibLoaderBase {
* Loads and adds a JAR file's native library to the TempJarCache.
* The native library JAR file's URI is derived as follows:
*
// either: [jogl-all.jar, jogl-all-noawt.jar, jogl-all-mobile.jar, jogl-all-android.jar] -> jogl-all-natives-os.and.arch.jar
@@ -334,12 +334,12 @@ public class JNILibLoaderBase {
JNILibLoaderBase.addNativeJarLibs(classesFromJavaJars, "-all", new String[] { "-noawt", "-mobile", "-core", "-android" } );
*
*
- *
+ *
* @param classesFromJavaJars For each given Class, load the native library JAR.
* @param singleJarMarker Optional string marker like "-all" to identify the single 'all-in-one' JAR file
* after which processing of the class array shall stop.
* @param stripBasenameSuffixes Optional substrings to be stripped of the base URI
- *
+ *
* @return true if either the 'all-in-one' native JAR or all native JARs loaded successful or were loaded already,
* false in case of an error
*/
@@ -351,7 +351,7 @@ public class JNILibLoaderBase {
if(TempJarCache.isInitialized()) {
final StringBuilder msg = new StringBuilder();
int count = 0;
- try {
+ try {
boolean done = false;
ok = true;
for(int i=0; !done && ok && i
* The implementation should ignore, if the library has been loaded already.
* @param libname the library to load
- * @param ignoreError if true, errors during loading the library should be ignored
+ * @param ignoreError if true, errors during loading the library should be ignored
* @param cl optional ClassLoader, used to locate the library
* @return true if library loaded successful
*/
protected static synchronized boolean loadLibrary(String libname, boolean ignoreError, ClassLoader cl) {
if (loaderAction != null) {
- return loaderAction.loadLibrary(libname, ignoreError, cl);
+ return loaderAction.loadLibrary(libname, ignoreError, cl);
}
return false;
}
-
+
/**
* Loads the library specified by libname, using the {@link LoaderAction} set by {@link #setLoadingAction(LoaderAction)}.
* Optionally preloads the libraries specified by preload.
* The implementation should ignore, if any library has been loaded already.
* @param libname the library to load
* @param preload the libraries to load before loading the main library if not null
- * @param preloadIgnoreError if true, errors during loading the preload-libraries should be ignored
+ * @param preloadIgnoreError if true, errors during loading the preload-libraries should be ignored
* @param cl optional ClassLoader, used to locate the library
*/
protected static synchronized void loadLibrary(String libname, String[] preload, boolean preloadIgnoreError, ClassLoader cl) {
if (loaderAction != null) {
- loaderAction.loadLibrary(libname, preload, preloadIgnoreError, cl);
+ loaderAction.loadLibrary(libname, preload, preloadIgnoreError, cl);
}
}
@@ -435,20 +435,20 @@ public class JNILibLoaderBase {
static {
final String sunAppletLauncherProperty = "sun.jnlp.applet.launcher";
final String sunAppletLauncherClassName = "org.jdesktop.applet.util.JNLPAppletLauncher";
-
+
final Method loadLibraryMethod = AccessController.doPrivileged(new PrivilegedAction() {
public Method run() {
// FIXME: remove
- final boolean usingJNLPAppletLauncher = Debug.getBooleanProperty(sunAppletLauncherProperty, true);
-
+ final boolean usingJNLPAppletLauncher = Debug.getBooleanProperty(sunAppletLauncherProperty, true);
+
Class> launcherClass = null;
Method loadLibraryMethod = null;
-
+
if (usingJNLPAppletLauncher) {
try {
launcherClass = Class.forName(sunAppletLauncherClassName);
} catch (ClassNotFoundException cnfe) {
- // oops .. look like JNLPAppletLauncher doesn't exist, despite property
+ // oops .. look like JNLPAppletLauncher doesn't exist, despite property
// this may happen if a previous applet was using JNLPAppletLauncher in the same JVM
System.err.println("JNILibLoaderBase: <"+sunAppletLauncherClassName+"> not found, despite enabled property <"+sunAppletLauncherProperty+">, JNLPAppletLauncher was probably used before");
System.setProperty(sunAppletLauncherProperty, Boolean.FALSE.toString());
@@ -465,7 +465,7 @@ public class JNILibLoaderBase {
launcherClass = null;
}
}
- }
+ }
if(null==launcherClass) {
String launcherClassName = PropertyAccess.getProperty("jnlp.launcher.class", false);
if(null!=launcherClassName) {
@@ -490,7 +490,7 @@ public class JNILibLoaderBase {
}
private static void loadLibraryInternal(String libraryName, ClassLoader cl) {
- // Note: special-casing JAWT which is built in to the JDK
+ // Note: special-casing JAWT which is built in to the JDK
int mode = 0; // 1 - custom, 2 - System.load( TempJarCache ), 3 - System.loadLibrary( name ), 4 - System.load( enumLibNames )
if (null!=customLoadLibraryMethod && !libraryName.equals("jawt")) {
// FIXME: remove
diff --git a/src/java/com/jogamp/common/net/AssetURLConnection.java b/src/java/com/jogamp/common/net/AssetURLConnection.java
index f2a5a01..4f2a412 100644
--- a/src/java/com/jogamp/common/net/AssetURLConnection.java
+++ b/src/java/com/jogamp/common/net/AssetURLConnection.java
@@ -6,31 +6,31 @@ import java.net.URL;
/**
* See base class {@link PiggybackURLConnection} for motivation.
- *
+ *
*
* asset resource location protocol connection.
*
- *
+ *
*
* See {@link AssetURLContext#resolve(String)} how resources are being resolved.
*
*
*
Example:
- *
+ *
* Assuming the plain asset entrytest/lala.txt is being resolved by
* a class test.LaLaTest, ie. using the asset aware ClassLoader,
- * one would use the following asset aware filesystem layout:
- *
+ * one would use the following asset aware filesystem layout:
+ *
*
* test/LaLaTest.class
* assets/test/lala.txt
*
- *
- * The above maybe on a plain filesystem, or within a JAR or an APK file,
+ *
+ * The above maybe on a plain filesystem, or within a JAR or an APK file,
* e.g. jogamp.test.apk.
- *
+ *
* The above would result in the following possible URLs
- * reflecting the plain and resolved state of the asset URL:
+ * reflecting the plain and resolved state of the asset URL:
*
* can be retrieved using {@link #getSubProtocol()}.
*
- *
+ *
* In all above cases, the asset entry is test/lala.txt,
* which can be retrieved via {@link #getEntryName()}.
- *
+ *
*
*
General Implementation Notes:
* An asset URL is resolved using {@link AssetURLContext#getClassLoader()}.{@link ClassLoader#getResource(String) getResource(String)},
@@ -56,43 +56,43 @@ import java.net.URL;
*
*
*
Warning:
- * Since the asset protocol is currently not being implemented
+ * Since the asset protocol is currently not being implemented
* on all platform with an appropriate ClassLoader, a user shall not create the asset URL manually.
*
- *
+ *
*
Android Implementation Notes:
*
- * The Android ClassLoader {@link jogamp.android.launcher.AssetDexClassLoader}
+ * The Android ClassLoader {@link jogamp.android.launcher.AssetDexClassLoader}
* resolves the resource as an asset URL in it's {@link ClassLoader#findResource(String)} implementation.
*
- * Currently we attach our asset {@link java.net.URLStreamHandlerFactory}
+ * Currently we attach our asset {@link java.net.URLStreamHandlerFactory}
* to allow {@link java.net.URL} to handle asset URLs via our asset {@link java.net.URLStreamHandler} implementation.
*
*/
public class AssetURLConnection extends PiggybackURLConnection {
-
+
public AssetURLConnection(URL url, AssetURLContext implHelper) {
super(url, implHelper);
}
-
+
@Override
public String getEntryName() throws IOException {
if(!connected) {
throw new IOException("not connected");
}
-
+
final String urlPath ;
if(subConn instanceof JarURLConnection) {
urlPath = ((JarURLConnection)subConn).getEntryName();
} else {
urlPath = subConn.getURL().getPath();
}
-
+
if(urlPath.startsWith(AssetURLContext.assets_folder)) {
return urlPath.substring(AssetURLContext.assets_folder.length());
} else {
return urlPath;
}
}
-
+
}
diff --git a/src/java/com/jogamp/common/net/AssetURLContext.java b/src/java/com/jogamp/common/net/AssetURLContext.java
index 470530e..38691e8 100644
--- a/src/java/com/jogamp/common/net/AssetURLContext.java
+++ b/src/java/com/jogamp/common/net/AssetURLContext.java
@@ -17,14 +17,14 @@ import com.jogamp.common.util.IOUtil;
*/
public abstract class AssetURLContext implements PiggybackURLContext {
private static final boolean DEBUG = IOUtil.DEBUG;
-
+
/** The asset URL protocol name asset */
public static final String asset_protocol = "asset";
-
+
/** The asset URL protocol prefix asset: */
public static final String asset_protocol_prefix = "asset:";
-
- /**
+
+ /**
* The optionalasset folder name with ending slash assets/.
*
* Note that the asset folder is not used on all platforms using the asset protocol
@@ -41,11 +41,11 @@ public abstract class AssetURLContext implements PiggybackURLContext {
}
};
}
-
+
public static AssetURLStreamHandler createHandler(final ClassLoader cl) {
return new AssetURLStreamHandler(create(cl));
}
-
+
/**
* Create an asset URL, suitable even w/o the registered asset URLStreamHandler.
*
@@ -62,7 +62,7 @@ public abstract class AssetURLContext implements PiggybackURLContext {
public static URL createURL(String path, ClassLoader cl) throws MalformedURLException {
return new URL(null, path.startsWith(asset_protocol_prefix) ? path : asset_protocol_prefix + path, createHandler(cl));
}
-
+
/**
* Create an asset URL, suitable only with the registered asset URLStreamHandler.
*
@@ -78,20 +78,20 @@ public abstract class AssetURLContext implements PiggybackURLContext {
public static URL createURL(String path) throws MalformedURLException {
return new URL(path.startsWith(asset_protocol_prefix) ? path : asset_protocol_prefix + path);
}
-
+
/**
- * Returns the asset handler previously set via {@link #registerHandler(ClassLoader)},
+ * Returns the asset handler previously set via {@link #registerHandler(ClassLoader)},
* or null if none was set.
*/
public static URLStreamHandler getRegisteredHandler() {
final GenericURLStreamHandlerFactory f = GenericURLStreamHandlerFactory.register();
return ( null != f ) ? f.getHandler(asset_protocol) : null;
}
-
+
/**
- * Registers the generic URLStreamHandlerFactory via {@link GenericURLStreamHandlerFactory#register()}
+ * Registers the generic URLStreamHandlerFactory via {@link GenericURLStreamHandlerFactory#register()}
* and if successful sets the assethandler for the given ClassLoader cl.
- *
+ *
* @return true if successful, otherwise false
*/
public static boolean registerHandler(ClassLoader cl) {
@@ -103,11 +103,11 @@ public abstract class AssetURLContext implements PiggybackURLContext {
return false;
}
}
-
- /**
+
+ /**
* Returns an asset aware ClassLoader.
*
- * The ClassLoader is required to find the asset resource
+ * The ClassLoader is required to find the asset resource
* via it's URL findResource(String) implementation.
*
*
@@ -123,33 +123,33 @@ public abstract class AssetURLContext implements PiggybackURLContext {
@Override
public String getImplementedProtocol() {
return asset_protocol;
- }
-
+ }
+
/**
* {@inheritDoc}
- *
+ *
* This implementation attempts to resolve path in the following order:
*
*
as a valid URL: new URL(path), use sub-protocol if asset URL
*
via ClassLoader: {@link #getClassLoader()}.{@link ClassLoader#getResource(String) getResource(path)}, use sub-protocol if asset URL
*
as a File: new File(path).toURI().toURL()
*
- *
+ *
*
* In case of using the ClassLoader (2) and if running on Android,
* the {@link #assets_folder} is being prepended to path if missing.
- *
* This is the asset URLStreamHandler variation
- * for manual use.
+ * for manual use.
*
*
* It requires passing a valid {@link AssetURLContext}
* for construction, hence it's not suitable for the pkg factory model.
*
*/
-public class AssetURLStreamHandler extends URLStreamHandler {
+public class AssetURLStreamHandler extends URLStreamHandler {
AssetURLContext ctx;
-
+
public AssetURLStreamHandler(AssetURLContext ctx) {
this.ctx = ctx;
}
-
+
@Override
protected URLConnection openConnection(URL u) throws IOException {
final AssetURLConnection c = new AssetURLConnection(u, ctx);
c.connect();
return c;
}
-
-
+
+
}
diff --git a/src/java/com/jogamp/common/net/GenericURLStreamHandlerFactory.java b/src/java/com/jogamp/common/net/GenericURLStreamHandlerFactory.java
index 79d7f71..4ec3f19 100644
--- a/src/java/com/jogamp/common/net/GenericURLStreamHandlerFactory.java
+++ b/src/java/com/jogamp/common/net/GenericURLStreamHandlerFactory.java
@@ -10,30 +10,30 @@ import java.util.Map;
public class GenericURLStreamHandlerFactory implements URLStreamHandlerFactory {
private static GenericURLStreamHandlerFactory factory = null;
-
+
private final Map protocolHandlers;
private GenericURLStreamHandlerFactory() {
protocolHandlers = new HashMap();
}
-
+
/**
* Sets the handler for protocol.
- *
+ *
* @return the previous set handler, or null if none was set.
*/
public synchronized final URLStreamHandler setHandler(String protocol, URLStreamHandler handler) {
return protocolHandlers.put(protocol, handler);
}
-
+
/**
- * Returns the protocol handler previously set via {@link #setHandler(String, URLStreamHandler)},
+ * Returns the protocol handler previously set via {@link #setHandler(String, URLStreamHandler)},
* or null if none was set.
*/
public synchronized final URLStreamHandler getHandler(String protocol) {
return protocolHandlers.get(protocol);
}
-
+
@Override
public synchronized final URLStreamHandler createURLStreamHandler(String protocol) {
return getHandler(protocol);
diff --git a/src/java/com/jogamp/common/net/PiggybackURLConnection.java b/src/java/com/jogamp/common/net/PiggybackURLConnection.java
index 39f1637..3b774e8 100644
--- a/src/java/com/jogamp/common/net/PiggybackURLConnection.java
+++ b/src/java/com/jogamp/common/net/PiggybackURLConnection.java
@@ -6,10 +6,10 @@ import java.net.URL;
import java.net.URLConnection;
/**
- * Generic resource location protocol connection,
+ * Generic resource location protocol connection,
* using another sub-protocol as the vehicle for a piggyback protocol.
*
- * The details of the sub-protocol can be queried using {@link #getSubProtocol()}.
+ * The details of the sub-protocol can be queried using {@link #getSubProtocol()}.
*
*
* See example in {@link AssetURLConnection}.
@@ -19,7 +19,7 @@ public abstract class PiggybackURLConnection exte
protected URL subUrl;
protected URLConnection subConn;
protected I context;
-
+
/**
* @param url the specific URL for this instance
* @param context the piggyback context, defining state independent code and constants
@@ -34,18 +34,18 @@ public abstract class PiggybackURLConnection exte
* Resolves the URL via {@link PiggybackURLContext#resolve(String)},
* see {@link AssetURLContext#resolve(String)} for an example.
*
- *
+ *
* {@inheritDoc}
*/
@Override
public synchronized void connect() throws IOException {
if(!connected) {
- subConn = context.resolve(url.getPath());
- subUrl = subConn.getURL();
+ subConn = context.resolve(url.getPath());
+ subUrl = subConn.getURL();
connected = true;
}
}
-
+
@Override
public InputStream getInputStream() throws IOException {
if(!connected) {
@@ -53,26 +53,26 @@ public abstract class PiggybackURLConnection exte
}
return subConn.getInputStream();
}
-
- /**
+
+ /**
* Returns the entry name of the asset.
*
+ *
* @throws IOException is not connected
**/
public abstract String getEntryName() throws IOException;
-
- /**
+
+ /**
* Returns the resolved sub protocol of the asset or null, ie:
*
* Plain asset:test/lala.txt
* Resolved asset:jar:file:/data/app/jogamp.test.apk!/assets/test/lala.txt
* Result jar:file:/data/app/jogamp.test.apk!/assets/test/lala.txt
*
- *
+ *
* @throws IOException is not connected
*/
public URL getSubProtocol() throws IOException {
diff --git a/src/java/com/jogamp/common/net/PiggybackURLContext.java b/src/java/com/jogamp/common/net/PiggybackURLContext.java
index 2cb48b5..9e3db69 100644
--- a/src/java/com/jogamp/common/net/PiggybackURLContext.java
+++ b/src/java/com/jogamp/common/net/PiggybackURLContext.java
@@ -8,11 +8,11 @@ import java.net.URLConnection;
*/
public interface PiggybackURLContext {
- /** Returns the specific protocol, constant for this implementation. */
+ /** Returns the specific protocol, constant for this implementation. */
public String getImplementedProtocol();
-
- /**
- * Resolving path to a URL sub protocol and return it's open URLConnection
+
+ /**
+ * Resolving path to a URL sub protocol and return it's open URLConnection
**/
- public URLConnection resolve(String path) throws IOException;
+ public URLConnection resolve(String path) throws IOException;
}
diff --git a/src/java/com/jogamp/common/net/asset/Handler.java b/src/java/com/jogamp/common/net/asset/Handler.java
index 1063797..d622221 100644
--- a/src/java/com/jogamp/common/net/asset/Handler.java
+++ b/src/java/com/jogamp/common/net/asset/Handler.java
@@ -8,12 +8,12 @@ import java.net.URLStreamHandler;
import com.jogamp.common.net.AssetURLConnection;
import com.jogamp.common.net.AssetURLContext;
-/**
+/**
* {@link URLStreamHandler} to handle the asset protocol.
- *
+ *
*
* This is the asset URLStreamHandler variation
- * using this class ClassLoader for the pkg factory model.
+ * using this class ClassLoader for the pkg factory model.
*
*/
public class Handler extends URLStreamHandler {
@@ -23,16 +23,16 @@ public class Handler extends URLStreamHandler {
return Handler.class.getClassLoader();
}
};
-
+
public Handler() {
super();
}
-
+
@Override
protected URLConnection openConnection(URL u) throws IOException {
final AssetURLConnection c = new AssetURLConnection(u, localCL);
c.connect();
return c;
}
-
+
}
diff --git a/src/java/com/jogamp/common/nio/AbstractBuffer.java b/src/java/com/jogamp/common/nio/AbstractBuffer.java
index 4afff2a..4213a4d 100644
--- a/src/java/com/jogamp/common/nio/AbstractBuffer.java
+++ b/src/java/com/jogamp/common/nio/AbstractBuffer.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 Saturday, March 27 2010 11:55
*/
@@ -51,7 +51,7 @@ public abstract class AbstractBuffer implements Native
Platform.initSingleton(); // loads native gluegen-rt library
}
- /**
+ /**
* capacity and elementSize should be match the equation w/ target buffer type
*
* capacity = elementSizeInBytes(buffer) * buffer.capacity() ) / elementSize
@@ -64,14 +64,14 @@ public abstract class AbstractBuffer implements Native
this.buffer = buffer;
this.elementSize = elementSize;
this.capacity = capacity;
-
+
this.position = 0;
}
public final int elementSize() {
return elementSize;
}
-
+
public final int limit() {
return capacity;
}
@@ -113,7 +113,7 @@ public abstract class AbstractBuffer implements Native
public final boolean isDirect() {
return buffer.isDirect();
}
-
+
public final boolean hasArray() {
return buffer.hasArray();
}
@@ -129,7 +129,7 @@ public abstract class AbstractBuffer implements Native
public Object array() throws UnsupportedOperationException {
return buffer.array();
}
-
+
@Override
public String toString() {
return "AbstractBuffer[direct "+isDirect()+", hasArray "+hasArray()+", capacity "+capacity+", position "+position+", elementSize "+elementSize+", buffer[capacity "+buffer.capacity()+", lim "+buffer.limit()+", pos "+buffer.position()+"]]";
diff --git a/src/java/com/jogamp/common/nio/Buffers.java b/src/java/com/jogamp/common/nio/Buffers.java
index 851aa69..c63a094 100644
--- a/src/java/com/jogamp/common/nio/Buffers.java
+++ b/src/java/com/jogamp/common/nio/Buffers.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.
*/
@@ -47,7 +47,7 @@ import com.jogamp.common.util.ValueConv;
/**
* Utility methods allowing easy {@link java.nio.Buffer} manipulations.
- *
+ *
* @author Kenneth Russel
* @author Sven Gothel
* @author Michael Bien
@@ -213,7 +213,7 @@ public class Buffers {
/**
* Calls slice on the specified buffer while maintaining the byteorder.
- * @see #slice(java.nio.Buffer, int, int)
+ * @see #slice(java.nio.Buffer, int, int)
*/
@SuppressWarnings("unchecked")
public static B slice(B buffer) {
@@ -264,22 +264,22 @@ public class Buffers {
* The returned sliced buffer's start position is not necessarily zero,
* but the float position within the host ByteBuffer.
*
- *
+ *
* The returned sliced buffer is {@link FloatBuffer#mark() marked} at it's starting position. Hence
- * {@link FloatBuffer#reset()} will rewind it to start after applying relative operations like {@link FloatBuffer#get()}.
+ * {@link FloatBuffer#reset()} will rewind it to start after applying relative operations like {@link FloatBuffer#get()}.
*
- *
- * Using a ByteBuffer as the source guarantees
- * keeping the source native order programmatically.
- * This works around Honeycomb / Android 3.0 Issue 16434.
+ *
+ * Using a ByteBuffer as the source guarantees
+ * keeping the source native order programmatically.
+ * This works around Honeycomb / Android 3.0 Issue 16434.
* This bug is resolved at least in Android 3.2.
*
- *
- * @param buf source Buffer, maybe ByteBuffer (recommended) or FloatBuffer or null.
+ *
+ * @param buf source Buffer, maybe ByteBuffer (recommended) or FloatBuffer or null.
* Buffer's position is ignored and floatPos is being used.
* @param backing source float array or null
* @param floatPos {@link Buffers#SIZEOF_FLOAT} position
- * @param floatSize {@link Buffers#SIZEOF_FLOAT} size
+ * @param floatSize {@link Buffers#SIZEOF_FLOAT} size
* @return FloatBuffer w/ native byte order as given ByteBuffer
*/
public static final FloatBuffer slice2Float(Buffer buf, float[] backing, int floatPos, int floatSize) {
@@ -318,7 +318,7 @@ public class Buffers {
return res;
}
-
+
/**
* Helper routine to set a ByteBuffer to the native byte order, if
* that operation is supported by the underlying NIO
@@ -329,7 +329,7 @@ public class Buffers {
}
/**
- * Returns the size of a single element of the given buffer in bytes
+ * Returns the size of a single element of the given buffer in bytes
* or 0 if the given buffer is null.
*/
public static int sizeOfBufferElem(Object buffer) {
@@ -358,7 +358,7 @@ public class Buffers {
/**
* Returns the number of remaining elements of the given anonymous buffer.
- *
+ *
* @param buffer Anonymous Buffer of type {@link NativeBuffer} or a derivation of {@link Buffer}.
* @return If buffer is null, returns 0, otherwise the remaining size in elements.
* @throws IllegalArgumentException if buffer is of invalid type.
@@ -375,10 +375,10 @@ public class Buffers {
throw new IllegalArgumentException("Unsupported anonymous buffer type: "+buffer.getClass().getCanonicalName());
}
}
-
+
/**
* Returns the number of remaining bytes of the given anonymous buffer.
- *
+ *
* @param buffer Anonymous Buffer of type {@link NativeBuffer} or a derivation of {@link Buffer}.
* @return If buffer is null, returns 0, otherwise the remaining size in bytes.
* @throws IllegalArgumentException if buffer is of invalid type.
@@ -434,11 +434,11 @@ public class Buffers {
if (buf instanceof ByteBuffer) {
return ((ByteBuffer) buf).isDirect();
} else if (buf instanceof IntBuffer) {
- return ((IntBuffer) buf).isDirect();
+ return ((IntBuffer) buf).isDirect();
} else if (buf instanceof ShortBuffer) {
- return ((ShortBuffer) buf).isDirect();
+ return ((ShortBuffer) buf).isDirect();
} else if (buf instanceof FloatBuffer) {
- return ((FloatBuffer) buf).isDirect();
+ return ((FloatBuffer) buf).isDirect();
} else if (buf instanceof DoubleBuffer) {
return ((DoubleBuffer) buf).isDirect();
} else if (buf instanceof LongBuffer) {
@@ -490,7 +490,7 @@ public class Buffers {
* Helper routine to return the array backing store reference from
* a Buffer object.
* @throws UnsupportedOperationException if the passed Object does not have an array backing store
- * @throws IllegalArgumentException if the passed Object is neither of type {@link java.nio.Buffer} or {@link NativeBuffer}.
+ * @throws IllegalArgumentException if the passed Object is neither of type {@link java.nio.Buffer} or {@link NativeBuffer}.
*/
public static Object getArray(Object buf) throws UnsupportedOperationException, IllegalArgumentException {
if (buf == null) {
@@ -557,7 +557,7 @@ public class Buffers {
ByteBuffer dest = newDirectByteBuffer(orig.remaining());
dest.put(orig);
dest.rewind();
- orig.position(op0);
+ orig.position(op0);
return dest;
}
@@ -752,8 +752,8 @@ public class Buffers {
//----------------------------------------------------------------------
// Convenient put methods with generic target Buffer w/o value range conversion, i.e. normalization
- //
-
+ //
+
@SuppressWarnings("unchecked")
public static B put(B dest, Buffer src) {
if ((dest instanceof ByteBuffer) && (src instanceof ByteBuffer)) {
@@ -841,7 +841,7 @@ public class Buffers {
throw new IllegalArgumentException("Float doesn't match Buffer Class: " + dest);
}
}
-
+
@SuppressWarnings("unchecked")
public static B putd(B dest, double v) {
if (dest instanceof FloatBuffer) {
@@ -855,15 +855,15 @@ public class Buffers {
// Convenient put methods with generic target Buffer and value range conversion, i.e. normalization
//
- /**
+ /**
* Store byte source value in given buffer after normalizing it to the destination value range
* considering signed and unsigned source and destination representation.
- *
+ *
* @param dest One of {@link ByteBuffer}, {@link ShortBuffer}, {@link IntBuffer}, {@link FloatBuffer}
* @param dSigned true if destination buffer holds signed values, false if destination buffer holds unsigned values
* @param v source byte value to be put in dest buffer
* @param sSigned true if source represents a signed value, false if source represents an unsigned value
- */
+ */
@SuppressWarnings("unchecked")
public static B putNb(B dest, boolean dSigned, byte v, boolean sSigned) {
if (dest instanceof ByteBuffer) {
@@ -872,22 +872,22 @@ public class Buffers {
return (B) ((ShortBuffer) dest).put( ValueConv.byte_to_short(v, sSigned, dSigned) );
} else if (dest instanceof IntBuffer) {
return (B) ((IntBuffer) dest).put( ValueConv.byte_to_int(v, sSigned, dSigned) );
- } else if (dest instanceof FloatBuffer) {
+ } else if (dest instanceof FloatBuffer) {
return (B) ((FloatBuffer) dest).put( ValueConv.byte_to_float(v, sSigned) );
} else {
throw new IllegalArgumentException("Byte doesn't match Buffer Class: " + dest);
}
}
- /**
+ /**
* Store short source value in given buffer after normalizing it to the destination value range
* considering signed and unsigned source and destination representation.
- *
+ *
* @param dest One of {@link ByteBuffer}, {@link ShortBuffer}, {@link IntBuffer}, {@link FloatBuffer}
* @param dSigned true if destination buffer holds signed values, false if destination buffer holds unsigned values
* @param v source short value to be put in dest buffer
* @param sSigned true if source represents a signed value, false if source represents an unsigned value
- */
+ */
@SuppressWarnings("unchecked")
public static B putNs(B dest, boolean dSigned, short v, boolean sSigned) {
if (dest instanceof ByteBuffer) {
@@ -896,22 +896,22 @@ public class Buffers {
return (B) ((ShortBuffer) dest).put( v );
} else if (dest instanceof IntBuffer) {
return (B) ((IntBuffer) dest).put( ValueConv.short_to_int(v, sSigned, dSigned) );
- } else if (dest instanceof FloatBuffer) {
+ } else if (dest instanceof FloatBuffer) {
return (B) ((FloatBuffer) dest).put( ValueConv.short_to_float(v, sSigned) );
} else {
throw new IllegalArgumentException("Byte doesn't match Buffer Class: " + dest);
}
}
-
- /**
+
+ /**
* Store short source value in given buffer after normalizing it to the destination value range
* considering signed and unsigned source and destination representation.
- *
+ *
* @param dest One of {@link ByteBuffer}, {@link ShortBuffer}, {@link IntBuffer}, {@link FloatBuffer}
* @param dSigned true if destination buffer holds signed values, false if destination buffer holds unsigned values
* @param v source short value to be put in dest buffer
* @param sSigned true if source represents a signed value, false if source represents an unsigned value
- */
+ */
@SuppressWarnings("unchecked")
public static B putNi(B dest, boolean dSigned, int v, boolean sSigned) {
if (dest instanceof ByteBuffer) {
@@ -920,21 +920,21 @@ public class Buffers {
return (B) ((ShortBuffer) dest).put( ValueConv.int_to_short(v, sSigned, dSigned) );
} else if (dest instanceof IntBuffer) {
return (B) ((IntBuffer) dest).put( v );
- } else if (dest instanceof FloatBuffer) {
+ } else if (dest instanceof FloatBuffer) {
return (B) ((FloatBuffer) dest).put( ValueConv.int_to_float(v, sSigned) );
} else {
throw new IllegalArgumentException("Byte doesn't match Buffer Class: " + dest);
}
}
-
- /**
+
+ /**
* Store float source value in given buffer after normalizing it to the destination value range
* considering signed and unsigned destination representation.
- *
+ *
* @param dest One of {@link ByteBuffer}, {@link ShortBuffer}, {@link IntBuffer}, {@link FloatBuffer}
* @param dSigned true if destination buffer holds signed values, false if destination buffer holds unsigned values
* @param v source float value to be put in dest buffer
- */
+ */
@SuppressWarnings("unchecked")
public static B putNf(B dest, boolean dSigned, float v) {
if (dest instanceof ByteBuffer) {
@@ -943,17 +943,17 @@ public class Buffers {
return (B) ((ShortBuffer) dest).put( ValueConv.float_to_short(v, dSigned) );
} else if (dest instanceof IntBuffer) {
return (B) ((IntBuffer) dest).put( ValueConv.float_to_int(v, dSigned) );
- } else if (dest instanceof FloatBuffer) {
+ } else if (dest instanceof FloatBuffer) {
return (B) ((FloatBuffer) dest).put( v );
} else {
throw new IllegalArgumentException("Byte doesn't match Buffer Class: " + dest);
}
}
-
+
//----------------------------------------------------------------------
- // Range check methods
+ // Range check methods
//
-
+
public static void rangeCheck(byte[] array, int offset, int minElementsRemaining) {
if (array == null) {
return;
@@ -1049,13 +1049,13 @@ public class Buffers {
throw new IndexOutOfBoundsException("Required " + minBytesRemaining + " remaining bytes in buffer, only had " + bytesRemaining);
}
}
-
+
/**
* Appends Buffer details inclusive data to a StringBuilder instance.
* @param sb optional pass through StringBuilder
- * @param f optional format string of one element, i.e. "%10.5f" for {@link FloatBuffer}, see {@link java.util.Formatter},
- * or null for unformatted output.
- * Note: Caller is responsible to match the format string w/ the data type as expected in the given buffer.
+ * @param f optional format string of one element, i.e. "%10.5f" for {@link FloatBuffer}, see {@link java.util.Formatter},
+ * or null for unformatted output.
+ * Note: Caller is responsible to match the format string w/ the data type as expected in the given buffer.
* @param buffer Any valid Buffer instance
* @return the modified StringBuilder containing the Buffer details
*/
@@ -1073,74 +1073,74 @@ public class Buffers {
for(int i=0; ifactories created with createSynchronized(...) are threadsafe
*
*
- *
+ *
* @author Michael Bien
*/
public class CachedBufferFactory {
@@ -67,20 +67,20 @@ public class CachedBufferFactory {
* default size for internal buffer allocation.
*/
public static final int DEFAULT_ALLOCATION_SIZE = 1024 * 1024;
-
+
private final int ALLOCATION_SIZE;
private ByteBuffer currentBuffer;
-
+
private CachedBufferFactory() {
this(DEFAULT_ALLOCATION_SIZE, DEFAULT_ALLOCATION_SIZE);
}
-
+
private CachedBufferFactory(int initialSize, int allocationSize) {
currentBuffer = Buffers.newDirectByteBuffer(initialSize);
ALLOCATION_SIZE = allocationSize;
}
-
-
+
+
/**
* Creates a factory with initial size and allocation size set to
* {@link #DEFAULT_ALLOCATION_SIZE}.
@@ -88,7 +88,7 @@ public class CachedBufferFactory {
public static CachedBufferFactory create() {
return new CachedBufferFactory();
}
-
+
/**
* Creates a factory with the specified initial size. The allocation size is set to
* {@link #DEFAULT_ALLOCATION_SIZE}.
@@ -96,7 +96,7 @@ public class CachedBufferFactory {
public static CachedBufferFactory create(int initialSize) {
return new CachedBufferFactory(initialSize, DEFAULT_ALLOCATION_SIZE);
}
-
+
/**
* Creates a factory with the specified initial size. The allocation size is set to
* {@link #DEFAULT_ALLOCATION_SIZE}.
@@ -106,43 +106,43 @@ public class CachedBufferFactory {
public static CachedBufferFactory create(int initialSize, boolean fixed) {
return new CachedBufferFactory(initialSize, fixed?-1:DEFAULT_ALLOCATION_SIZE);
}
-
+
/**
* Creates a factory with the specified initial size and allocation size.
*/
public static CachedBufferFactory create(int initialSize, int allocationSize) {
return new CachedBufferFactory(initialSize, allocationSize);
}
-
-
+
+
/**
* Synchronized version of {@link #create()}.
*/
public static CachedBufferFactory createSynchronized() {
return new SynchronizedCachedBufferFactory();
}
-
+
/**
* Synchronized version of {@link #create(int)}.
*/
public static CachedBufferFactory createSynchronized(int initialSize) {
return new SynchronizedCachedBufferFactory(initialSize, DEFAULT_ALLOCATION_SIZE);
}
-
+
/**
* Synchronized version of {@link #create(int, boolean)}.
*/
public static CachedBufferFactory createSynchronized(int initialSize, boolean fixed) {
return new SynchronizedCachedBufferFactory(initialSize, fixed?-1:DEFAULT_ALLOCATION_SIZE);
}
-
+
/**
* Synchronized version of {@link #create(int, int)}.
*/
public static CachedBufferFactory createSynchronized(int initialSize, int allocationSize) {
return new CachedBufferFactory(initialSize, allocationSize);
}
-
+
/**
* Returns true only if this factory does not allow to allocate more buffers
* as limited by the initial size.
@@ -150,7 +150,7 @@ public class CachedBufferFactory {
public boolean isFixed() {
return ALLOCATION_SIZE == -1;
}
-
+
/**
* Returns the allocation size used to create new internal buffers.
* 0 means that the buffer will not grows, see {@link #isFixed()}.
@@ -158,7 +158,7 @@ public class CachedBufferFactory {
public int getAllocationSize() {
return ALLOCATION_SIZE;
}
-
+
/**
* @return true if buffer cannot grow, otherwise false
*/
@@ -175,7 +175,7 @@ public class CachedBufferFactory {
}
}
public ByteBuffer newDirectByteBuffer(int size) {
-
+
// if large enough... just create it
if (size > currentBuffer.capacity()) {
checkIfFixed();
@@ -194,7 +194,7 @@ public class CachedBufferFactory {
currentBuffer.limit(currentBuffer.capacity());
return result;
}
-
+
public ByteBuffer newDirectByteBuffer(byte[] values, int offset, int lenght) {
return (ByteBuffer)newDirectByteBuffer(lenght).put(values, offset, lenght).rewind();
@@ -326,8 +326,8 @@ public class CachedBufferFactory {
public String toString() {
return getClass().getName()+"[static:"+isFixed()+" alloc size:"+getAllocationSize()+"]";
}
-
-
+
+
// nothing special, just synchronized
private static class SynchronizedCachedBufferFactory extends CachedBufferFactory {
@@ -338,12 +338,12 @@ public class CachedBufferFactory {
private SynchronizedCachedBufferFactory(int size, int step) {
super(size, step);
}
-
+
@Override
public synchronized ByteBuffer newDirectByteBuffer(int size) {
return super.newDirectByteBuffer(size);
}
-
+
}
}
diff --git a/src/java/com/jogamp/common/nio/NativeBuffer.java b/src/java/com/jogamp/common/nio/NativeBuffer.java
index 0273976..d81da9d 100644
--- a/src/java/com/jogamp/common/nio/NativeBuffer.java
+++ b/src/java/com/jogamp/common/nio/NativeBuffer.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 Tuesday, March 30 2010 18:22
*/
@@ -43,7 +43,7 @@ import java.nio.Buffer;
public interface NativeBuffer {
public int elementSize();
-
+
public int limit();
public int capacity();
@@ -66,8 +66,8 @@ public interface NativeBuffer {
* otherwise 0.
*/
public int arrayOffset();
-
- /**
+
+ /**
* @return the primitive backup array of the buffer if {@link #hasArray()} is true,
* otherwise it throws {@link java.lang.UnsupportedOperationException}.
* The returned primitive array maybe of type int[] or long[], etc ..
diff --git a/src/java/com/jogamp/common/nio/PointerBuffer.java b/src/java/com/jogamp/common/nio/PointerBuffer.java
index df1c4b1..4a479f0 100644
--- a/src/java/com/jogamp/common/nio/PointerBuffer.java
+++ b/src/java/com/jogamp/common/nio/PointerBuffer.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.
@@ -60,22 +60,22 @@ public class PointerBuffer extends AbstractBuffer {
static PointerBuffer create(ByteBuffer bb) {
return Platform.is32Bit() ? new PointerBuffer( bb.asIntBuffer() ) : new PointerBuffer( bb.asLongBuffer() );
}
-
+
/** supports backup array */
PointerBuffer(IntBuffer b) {
super(b, ELEMENT_SIZE, b.capacity());
}
-
+
/** supports backup array */
PointerBuffer(LongBuffer b) {
super(b, ELEMENT_SIZE, b.capacity());
}
-
+
private final void validateDataMap() {
if(null == dataMap) {
dataMap = new LongObjectHashMap();
- dataMap.setKeyNotFoundValue(null);
- }
+ dataMap.setKeyNotFoundValue(null);
+ }
}
/** Returns a non direct PointerBuffer in native order, having a backup array */
@@ -84,7 +84,7 @@ public class PointerBuffer extends AbstractBuffer {
return new PointerBuffer(IntBuffer.wrap(new int[size]));
} else {
return new PointerBuffer(LongBuffer.wrap(new long[size]));
- }
+ }
}
/** Returns a direct PointerBuffer in native order, w/o backup array */
@@ -113,9 +113,9 @@ public class PointerBuffer extends AbstractBuffer {
npb.position = position;
return npb;
}
-
- /**
- * Relative bulk get method. Copy the source values src[position .. capacity] [
+
+ /**
+ * Relative bulk get method. Copy the source values src[position .. capacity] [
* to this buffer and increment the position by capacity-position. */
public final PointerBuffer put(PointerBuffer src) {
if (remaining() < src.remaining()) {
@@ -145,7 +145,7 @@ public class PointerBuffer extends AbstractBuffer {
}
return this;
}
-
+
/** Relative get method. Get the pointer value at the current position and increment the position by one. */
public final long get() {
long r = get(position);
@@ -164,9 +164,9 @@ public class PointerBuffer extends AbstractBuffer {
return ((LongBuffer) buffer).get(idx);
}
}
-
- /**
- * Relative bulk get method. Copy the pointer values [ position .. position+length [
+
+ /**
+ * Relative bulk get method. Copy the pointer values [ position .. position+length [
* to the destination array [ dest[offset] .. dest[offset+length] [
* and increment the position by length. */
public final PointerBuffer get(long[] dest, int offset, int length) {
@@ -203,8 +203,8 @@ public class PointerBuffer extends AbstractBuffer {
return this;
}
- /**
- * Relative bulk put method. Put the pointer values [ src[offset] .. src[offset+length] [
+ /**
+ * Relative bulk put method. Put the pointer values [ src[offset] .. src[offset+length] [
* at the current position and increment the position by length. */
public final PointerBuffer put(long[] src, int offset, int length) {
if (src.length {
/** Put the address of the given direct Buffer at the given position
of this pointer array.
Adding a reference of the given direct Buffer to this object.
-
- @throws IllegalArgumentException if bb is null or not a direct buffer
+
+ @throws IllegalArgumentException if bb is null or not a direct buffer
*/
public final PointerBuffer referenceBuffer(int index, Buffer bb) {
if(null==bb) {
@@ -239,7 +239,7 @@ public class PointerBuffer extends AbstractBuffer {
throw new RuntimeException("Couldn't determine native address of given Buffer: "+bb);
}
validateDataMap();
- put(index, bbAddr);
+ put(index, bbAddr);
dataMap.put(bbAddr, bb);
return this;
}
diff --git a/src/java/com/jogamp/common/nio/StructAccessor.java b/src/java/com/jogamp/common/nio/StructAccessor.java
index eef9dc5..d6df083 100644
--- a/src/java/com/jogamp/common/nio/StructAccessor.java
+++ b/src/java/com/jogamp/common/nio/StructAccessor.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.
*/
@@ -58,7 +58,7 @@ public class StructAccessor {
return bb;
}
- /**
+ /**
* Returns a slice of the current ByteBuffer starting at the
* specified byte offset and extending the specified number of
* bytes. Note that this method is not thread-safe with respect to
@@ -116,11 +116,11 @@ public class StructAccessor {
/** Retrieves the int at the specified byteOffset. */
public final int getIntAt(int byteOffset, int nativeSizeInBytes) {
switch(nativeSizeInBytes) {
- case 2:
+ case 2:
return (int) bb.getShort(byteOffset) & 0x0000FFFF ;
- case 4:
+ case 4:
return bb.getInt(byteOffset);
- case 8:
+ case 8:
return (int) ( bb.getLong(byteOffset) & 0x00000000FFFFFFFFL ) ;
default:
throw new InternalError("invalid nativeSizeInBytes "+nativeSizeInBytes);
@@ -130,20 +130,20 @@ public class StructAccessor {
/** Puts a int at the specified byteOffset. */
public final void setIntAt(int byteOffset, int v, int nativeSizeInBytes) {
switch(nativeSizeInBytes) {
- case 2:
+ case 2:
bb.putShort(byteOffset, (short) ( v & 0x0000FFFF ) );
break;
- case 4:
+ case 4:
bb.putInt(byteOffset, v);
break;
- case 8:
+ case 8:
bb.putLong(byteOffset, (long)v & 0x00000000FFFFFFFFL );
break;
default:
throw new InternalError("invalid nativeSizeInBytes "+nativeSizeInBytes);
}
}
-
+
/** Retrieves the float at the specified byteOffset. */
public final float getFloatAt(int byteOffset) {
return bb.getFloat(byteOffset);
@@ -173,13 +173,13 @@ public class StructAccessor {
public final void setLongAt(int byteOffset, long v) {
bb.putLong(byteOffset, v);
}
-
+
/** Retrieves the long at the specified byteOffset. */
public final long getLongAt(int byteOffset, int nativeSizeInBytes) {
switch(nativeSizeInBytes) {
- case 4:
+ case 4:
return (long) bb.getInt(byteOffset) & 0x00000000FFFFFFFFL;
- case 8:
+ case 8:
return bb.getLong(byteOffset);
default:
throw new InternalError("invalid nativeSizeInBytes "+nativeSizeInBytes);
@@ -189,17 +189,17 @@ public class StructAccessor {
/** Puts a long at the specified byteOffset. */
public final void setLongAt(int byteOffset, long v, int nativeSizeInBytes) {
switch(nativeSizeInBytes) {
- case 4:
+ case 4:
bb.putInt(byteOffset, (int) ( v & 0x00000000FFFFFFFFL ) );
break;
- case 8:
+ case 8:
bb.putLong(byteOffset, v);
break;
default:
throw new InternalError("invalid nativeSizeInBytes "+nativeSizeInBytes);
}
}
-
+
public final void setBytesAt(int byteOffset, byte[] v) {
for (int i = 0; i < v.length; i++) {
bb.put(byteOffset++, v[i]);
@@ -225,18 +225,18 @@ public class StructAccessor {
}
return v;
}
-
+
public final void setShortsAt(int byteOffset, short[] v) {
for (int i = 0; i < v.length; i++, byteOffset+=2) {
bb.putShort(byteOffset, v[i]);
- }
+ }
}
-
+
public final short[] getShortsAt(int byteOffset, short[] v) {
for (int i = 0; i < v.length; i++, byteOffset+=2) {
v[i] = bb.getShort(byteOffset);
}
- return v;
+ return v;
}
public final void setIntsAt(int byteOffset, int[] v) {
diff --git a/src/java/com/jogamp/common/os/AndroidVersion.java b/src/java/com/jogamp/common/os/AndroidVersion.java
index d2afbbc..a710310 100644
--- a/src/java/com/jogamp/common/os/AndroidVersion.java
+++ b/src/java/com/jogamp/common/os/AndroidVersion.java
@@ -34,25 +34,25 @@ import com.jogamp.common.util.ReflectionUtil;
public class AndroidVersion {
public static final boolean isAvailable;
-
- /** Development codename, or the string "REL" for official release */
+
+ /** Development codename, or the string "REL" for official release */
public static final String CODENAME;
-
+
/** internal build value used by the underlying source control. */
public static final String INCREMENTAL;
-
+
/** official build version string */
public static final String RELEASE;
-
+
/** SDK Version number, key to VERSION_CODES */
public static final int SDK_INT;
/** SDK Version string */
public static final String SDK_NAME;
-
+
private static final String androidBuildVersion = "android.os.Build$VERSION";
private static final String androidBuildVersionCodes = "android.os.Build$VERSION_CODES";
-
+
static {
final ClassLoader cl = AndroidVersion.class.getClassLoader();
Class> abvClass = null;
@@ -65,7 +65,7 @@ public class AndroidVersion {
abvcClass = ReflectionUtil.getClass(androidBuildVersionCodes, true, cl);
abvcObject = abvcClass.newInstance();
} catch (Exception e) { /* n/a */ }
- isAvailable = null != abvObject;
+ isAvailable = null != abvObject;
if(isAvailable) {
CODENAME = getString(abvClass, abvObject, "CODENAME");
INCREMENTAL = getString(abvClass, abvObject, "INCREMENTAL");
@@ -73,16 +73,16 @@ public class AndroidVersion {
SDK_INT = getInt(abvClass, abvObject, "SDK_INT");
final IntObjectHashMap version_codes = getVersionCodes(abvcClass, abvcObject);
final String sdk_name = (String) version_codes.get(SDK_INT);
- SDK_NAME = ( null != sdk_name ) ? sdk_name : "SDK_"+SDK_INT ;
+ SDK_NAME = ( null != sdk_name ) ? sdk_name : "SDK_"+SDK_INT ;
} else {
CODENAME = null;
INCREMENTAL = null;
RELEASE = null;
- SDK_INT = -1;
+ SDK_INT = -1;
SDK_NAME = null;
}
}
-
+
private static final IntObjectHashMap getVersionCodes(Class> cls, Object obj) {
final Field[] fields = cls.getFields();
IntObjectHashMap map = new IntObjectHashMap( 3 * fields.length / 2, 0.75f );
@@ -93,10 +93,10 @@ public class AndroidVersion {
// System.err.println(i+": "+version+": "+version_name);
map.put(new Integer(version), version_name);
} catch (Exception e) { e.printStackTrace(); /* n/a */ }
- }
+ }
return map;
}
-
+
private static final String getString(Class> cls, Object obj, String name) {
try {
Field f = cls.getField(name);
@@ -112,6 +112,6 @@ public class AndroidVersion {
} catch (Exception e) { e.printStackTrace(); /* n/a */ }
return -1;
}
-
+
// android.os.Build.VERSION
}
diff --git a/src/java/com/jogamp/common/os/DynamicLibraryBundle.java b/src/java/com/jogamp/common/os/DynamicLibraryBundle.java
index 56387b6..a69fd7a 100644
--- a/src/java/com/jogamp/common/os/DynamicLibraryBundle.java
+++ b/src/java/com/jogamp/common/os/DynamicLibraryBundle.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.
*/
-
+
package com.jogamp.common.os;
import java.util.ArrayList;
@@ -43,7 +43,7 @@ import com.jogamp.common.util.RunnableExecutor;
*
The JNI glue-code native library, eg jogl_desktop.dll. From here on this is referred as the Glue
*
*
- * An {@link DynamicLibraryBundleInfo} instance is being passed in the constructor,
+ * An {@link DynamicLibraryBundleInfo} instance is being passed in the constructor,
* providing the required information about the tool and glue libraries.
* The ClassLoader of it's implementation is also being used to help locating the native libraries.
*
@@ -65,7 +65,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
private final List> toolLibNames;
private final List glueLibNames;
private final boolean[] toolLibLoaded;
-
+
private int toolLibLoadedNumber;
private final boolean[] glueLibLoaded;
@@ -76,15 +76,15 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
private HashSet toolGetProcAddressFuncNameSet;
private List toolGetProcAddressFuncNameList;
- /** Returns an AWT-EDT {@link RunnableExecutor} implementation if AWT is available, otherwise {@link RunnableExecutor#currentThreadExecutor}. */
+ /** Returns an AWT-EDT {@link RunnableExecutor} implementation if AWT is available, otherwise {@link RunnableExecutor#currentThreadExecutor}. */
public static RunnableExecutor getDefaultRunnableExecutor() {
return RunnableExecutor.currentThreadExecutor;
}
-
- /**
+
+ /**
* Instantiates and loads all {@link NativeLibrary}s incl. JNI libraries.
*
- * The ClassLoader of the {@link DynamicLibraryBundleInfo} implementation class
+ * The ClassLoader of the {@link DynamicLibraryBundleInfo} implementation class
* is being used to help locating the native libraries.
*
*/
@@ -104,12 +104,12 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
if( toolLibNames.size() == 0 ) {
System.err.println("No Tool native library names given");
}
-
+
if( glueLibNames.size() == 0 ) {
System.err.println("No Glue native library names given");
}
}
-
+
for(int i=toolLibNames.size()-1; i>=0; i--) {
toolLibLoaded[i] = false;
}
@@ -117,17 +117,17 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
for(int i=glueLibNames.size()-1; i>=0; i--) {
glueLibLoaded[i] = false;
}
-
+
info.getLibLoaderExecutor().invoke(true, new Runnable() {
- public void run() {
+ public void run() {
loadLibraries();
- } } ) ;
-
+ } } ) ;
+
toolGetProcAddressFuncNameList = info.getToolGetProcAddressFuncNameList();
if( null != toolGetProcAddressFuncNameList ) {
toolGetProcAddressFuncNameSet = new HashSet(toolGetProcAddressFuncNameList);
toolGetProcAddressHandle = getToolGetProcAddressHandle();
- toolGetProcAddressComplete = 0 != toolGetProcAddressHandle;
+ toolGetProcAddressComplete = 0 != toolGetProcAddressHandle;
} else {
toolGetProcAddressFuncNameSet = new HashSet();
toolGetProcAddressHandle = 0;
@@ -144,7 +144,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
System.err.println(" LibLoaderExecutor: "+info.getLibLoaderExecutor().getClass().getName());
}
}
-
+
/** Unload all {@link NativeLibrary}s, and remove all references. */
public final void destroy() {
if(DEBUG) {
@@ -179,7 +179,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
/**
* @return true if all tool libraries are loaded,
* otherwise false.
- *
+ *
* @see DynamicLibraryBundleInfo#getToolLibNames()
*/
public final boolean isToolLibComplete() {
@@ -207,9 +207,9 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
/**
* @return true if the last entry has been loaded,
- * while ignoring the preload dependencies.
+ * while ignoring the preload dependencies.
* Otherwise false.
- *
+ *
* @see DynamicLibraryBundleInfo#getGlueLibNames()
*/
public final boolean isGlueLibComplete() {
@@ -241,7 +241,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
}
protected final NativeLibrary loadFirstAvailable(List libNames, ClassLoader loader, boolean global) {
- for (int i=0; i < libNames.size(); i++) {
+ for (int i=0; i < libNames.size(); i++) {
final NativeLibrary lib = NativeLibrary.open(libNames.get(i), loader, global);
if (lib != null) {
return lib;
@@ -256,7 +256,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
final ClassLoader cl = info.getClass().getClassLoader();
NativeLibrary lib = null;
- for (i=0; i < toolLibNames.size(); i++) {
+ for (i=0; i < toolLibNames.size(); i++) {
final List libNames = toolLibNames.get(i);
if( null != libNames && libNames.size() > 0 ) {
lib = loadFirstAvailable(libNames, cl, info.shallLinkGlobal());
@@ -282,7 +282,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
}
glueLibLoadedNumber = 0;
- for (i=0; i < glueLibNames.size(); i++) {
+ for (i=0; i < glueLibNames.size(); i++) {
final String libName = glueLibNames.get(i);
boolean ignoreError = true;
boolean res;
@@ -304,7 +304,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
}
}
}
-
+
private final long dynamicLookupFunctionOnLibs(String funcName) {
if(!isToolLibLoaded() || null==funcName) {
if(DEBUG_LOOKUP && !isToolLibLoaded()) {
@@ -347,7 +347,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
}
return 0;
}
-
+
@Override
public final long dynamicLookupFunction(String funcName) {
if(!isToolLibLoaded() || null==funcName) {
@@ -371,11 +371,11 @@ public class DynamicLibraryBundle implements DynamicLookupHelper {
addr = dynamicLookupFunctionOnLibs(funcName);
}
if(0==addr && !useToolGetProcAdressFirst) {
- addr = toolDynamicLookupFunction(funcName);
+ addr = toolDynamicLookupFunction(funcName);
}
return addr;
}
-
+
@Override
public final boolean isFunctionAvailable(String funcName) {
return 0 != dynamicLookupFunction(funcName);
diff --git a/src/java/com/jogamp/common/os/DynamicLibraryBundleInfo.java b/src/java/com/jogamp/common/os/DynamicLibraryBundleInfo.java
index ef44298..7be5f25 100644
--- a/src/java/com/jogamp/common/os/DynamicLibraryBundleInfo.java
+++ b/src/java/com/jogamp/common/os/DynamicLibraryBundleInfo.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.
*/
-
+
package com.jogamp.common.os;
import java.util.List;
@@ -36,10 +36,10 @@ import com.jogamp.common.util.RunnableExecutor;
public interface DynamicLibraryBundleInfo {
public static final boolean DEBUG = DynamicLibraryBundle.DEBUG;
- /**
+ /**
* If a {@link SecurityManager} is installed, user needs link permissions
* for the named libraries.
- *
+ *
* @return a list of Tool library names or alternative library name lists.
*
@@ -49,10 +49,10 @@ public interface DynamicLibraryBundleInfo {
*/
public List> getToolLibNames();
- /**
+ /**
* If a {@link SecurityManager} is installed, user needs link permissions
* for the named libraries.
- *
+ *
* @return a list of Glue library names.
*
@@ -64,15 +64,15 @@ public interface DynamicLibraryBundleInfo {
*/
public List getGlueLibNames();
- /**
+ /**
* May return the native libraries
GetProcAddressFunc
names, the first found function is being used.
* This could be eg:
glXGetProcAddressARB, glXGetProcAddressARB
.
* If your Tool does not has this facility, just return null.
* @see #toolGetProcAddress(long, String)
*/
- public List getToolGetProcAddressFuncNameList() ;
+ public List getToolGetProcAddressFuncNameList() ;
- /**
+ /**
* May implement the lookup function using the Tools facility.
* The actual function pointer is provided to allow proper bootstrapping of the ProcAddressTable,
* using one of the provided function names by {@link #getToolGetProcAddressFuncNameList()}.
@@ -81,7 +81,7 @@ public interface DynamicLibraryBundleInfo {
/**
* @param funcName
- * @return true if {@link #toolGetProcAddress(long, String)} shall be tried before
+ * @return true if {@link #toolGetProcAddress(long, String)} shall be tried before
* the system loader for the given function lookup. Otherwise false.
* Default is true.
*/
@@ -90,20 +90,20 @@ public interface DynamicLibraryBundleInfo {
/** @return true if the native library symbols shall be made available for symbol resolution of subsequently loaded libraries. */
public boolean shallLinkGlobal();
- /**
+ /**
* If method returns trueand if a {@link SecurityManager} is installed, user needs link permissions
* for all libraries, i.e. for new RuntimePermission("loadLibrary.*");!
- *
- * @return true if the dynamic symbol lookup shall happen system wide, over all loaded libraries.
- * Otherwise only the loaded native libraries are used for lookup, which shall be the default.
+ *
+ * @return true if the dynamic symbol lookup shall happen system wide, over all loaded libraries.
+ * Otherwise only the loaded native libraries are used for lookup, which shall be the default.
*/
public boolean shallLookupGlobal();
-
+
/**
- * Returns a suitable {@link RunnableExecutor} implementation, which is being used
+ * Returns a suitable {@link RunnableExecutor} implementation, which is being used
* to load the tool and glue native libraries.
*
- * This allows the generic {@link DynamicLibraryBundle} implementation to
+ * This allows the generic {@link DynamicLibraryBundle} implementation to
* load the native libraries on a designated thread.
*
*
diff --git a/src/java/com/jogamp/common/os/DynamicLinker.java b/src/java/com/jogamp/common/os/DynamicLinker.java
index ed52413..3b1ec3f 100644
--- a/src/java/com/jogamp/common/os/DynamicLinker.java
+++ b/src/java/com/jogamp/common/os/DynamicLinker.java
@@ -39,10 +39,10 @@ public interface DynamicLinker {
*
* Opens the named library, allowing system wide access for other users.
*
- *
+ *
* @param pathname the full pathname for the library to open
* @param debug set to true to enable debugging
- * @return the library handle, maybe 0 if not found.
+ * @return the library handle, maybe 0 if not found.
* @throws SecurityException if user is not granted access for the named library.
*/
public long openLibraryGlobal(String pathname, boolean debug) throws SecurityException;
@@ -53,50 +53,50 @@ public interface DynamicLinker {
*
* Opens the named library, restricting access to this process.
*
- *
+ *
* @param pathname the full pathname for the library to open
* @param debug set to true to enable debugging
- * @return the library handle, maybe 0 if not found.
+ * @return the library handle, maybe 0 if not found.
* @throws SecurityException if user is not granted access for the named library.
*/
public long openLibraryLocal(String pathname, boolean debug) throws SecurityException;
-
+
/**
* If a {@link SecurityManager} is installed, user needs link permissions
* for all libraries, i.e. for new RuntimePermission("loadLibrary.*");!
- *
+ *
* @param symbolName global symbol name to lookup up system wide.
- * @return the library handle, maybe 0 if not found.
+ * @return the library handle, maybe 0 if not found.
* @throws SecurityException if user is not granted access for all libraries.
*/
public long lookupSymbolGlobal(String symbolName) throws SecurityException;
-
+
/**
- * Security checks are implicit by previous call of
+ * Security checks are implicit by previous call of
* {@link #openLibraryLocal(String, boolean)} or {@link #openLibraryGlobal(String, boolean)}
* retrieving the librarHandle.
- *
+ *
* @param libraryHandle a library handle previously retrieved via {@link #openLibraryLocal(String, boolean)} or {@link #openLibraryGlobal(String, boolean)}.
* @param symbolName global symbol name to lookup up system wide.
- * @return the library handle, maybe 0 if not found.
+ * @return the library handle, maybe 0 if not found.
* @throws IllegalArgumentException in case case libraryHandle is unknown.
*/
public long lookupSymbol(long libraryHandle, String symbolName) throws IllegalArgumentException;
-
+
/**
- * Security checks are implicit by previous call of
+ * Security checks are implicit by previous call of
* {@link #openLibraryLocal(String, boolean)} or {@link #openLibraryGlobal(String, boolean)}
* retrieving the librarHandle.
- *
+ *
* @param libraryHandle a library handle previously retrieved via {@link #openLibraryLocal(String, boolean)} or {@link #openLibraryGlobal(String, boolean)}.
* @throws IllegalArgumentException in case case libraryHandle is unknown.
*/
public void closeLibrary(long libraryHandle) throws IllegalArgumentException;
-
+
/**
- * Returns a string containing the last error.
- * Maybe called for debuging purposed if any method fails.
- * @return error string, maybe null. A null or non-null value has no semantics.
+ * Returns a string containing the last error.
+ * Maybe called for debuging purposed if any method fails.
+ * @return error string, maybe null. A null or non-null value has no semantics.
*/
public String getLastError();
}
diff --git a/src/java/com/jogamp/common/os/DynamicLookupHelper.java b/src/java/com/jogamp/common/os/DynamicLookupHelper.java
index 94a7e92..0f87351 100644
--- a/src/java/com/jogamp/common/os/DynamicLookupHelper.java
+++ b/src/java/com/jogamp/common/os/DynamicLookupHelper.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.
*/
@@ -41,7 +41,7 @@ package com.jogamp.common.os;
import jogamp.common.Debug;
-/** Interface callers may use ProcAddressHelper's
+/** Interface callers may use ProcAddressHelper's
* {@link com.jogamp.gluegen.runtime.ProcAddressTable#reset(com.jogamp.common.os.DynamicLookupHelper) reset}
* helper method to install function pointers into a
* ProcAddressTable. This must typically be written with native
@@ -49,12 +49,12 @@ import jogamp.common.Debug;
public interface DynamicLookupHelper {
public static final boolean DEBUG = Debug.debug("NativeLibrary");
public static final boolean DEBUG_LOOKUP = Debug.debug("NativeLibrary.Lookup");
-
+
/**
* Returns the function handle for function 'funcName'.
*/
public long dynamicLookupFunction(String funcName);
-
+
/**
* Queries whether function 'funcName' is available.
*/
diff --git a/src/java/com/jogamp/common/os/MachineDescription.java b/src/java/com/jogamp/common/os/MachineDescription.java
index ab0885e..aea9de1 100644
--- a/src/java/com/jogamp/common/os/MachineDescription.java
+++ b/src/java/com/jogamp/common/os/MachineDescription.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.
*/
@@ -61,14 +61,14 @@ public class MachineDescription {
X86_64_WINDOWS(Platform.CPUType.X86_64),
/** {@link Platform.CPUType#SPARC_32} Big Endian Solaris */
SPARC_32_SUNOS(Platform.CPUType.SPARC_32);
-
+
public final Platform.CPUType cpu;
ID(Platform.CPUType cpu){
this.cpu = cpu;
}
- }
-
+ }
+
/* arch os int, long, float, doubl, ldoubl, ptr, page */
private final static int[] size_armeabi = { 4, 4, 4, 8, 8, 4, 4096 };
private final static int[] size_x86_32_unix = { 4, 4, 4, 8, 12, 4, 4096 };
@@ -78,7 +78,7 @@ public class MachineDescription {
private final static int[] size_x86_64_windows = { 4, 4, 4, 8, 16, 8, 4096 };
private final static int[] size_sparc_32_sunos = { 4, 4, 4, 8, 16, 4, 8192 };
- /* arch os i8, i16, i32, i64, int, long, float, doubl, ldoubl, ptr */
+ /* arch os i8, i16, i32, i64, int, long, float, doubl, ldoubl, ptr */
private final static int[] align_armeabi = { 1, 2, 4, 8, 4, 4, 4, 8, 8, 4 };
private final static int[] align_x86_32_unix = { 1, 2, 4, 4, 4, 4, 4, 4, 4, 4 };
private final static int[] align_x86_32_macos = { 1, 2, 4, 4, 4, 4, 4, 4, 16, 4 };
@@ -86,7 +86,7 @@ public class MachineDescription {
private final static int[] align_x86_64_unix = { 1, 2, 4, 8, 4, 8, 4, 8, 16, 8 };
private final static int[] align_x86_64_windows = { 1, 2, 4, 8, 4, 4, 4, 8, 16, 8 };
private final static int[] align_sparc_32_sunos = { 1, 2, 4, 8, 4, 4, 4, 8, 8, 4 };
-
+
public enum StaticConfig {
/** {@link MachineDescription.ID#ARMle_EABI } */
ARMle_EABI(ID.ARMle_EABI, true, size_armeabi, align_armeabi),
@@ -102,10 +102,10 @@ public class MachineDescription {
X86_64_WINDOWS(ID.X86_64_WINDOWS, true, size_x86_64_windows, align_x86_64_windows),
/** {@link MachineDescription.ID#SPARC_32_SUNOS } */
SPARC_32_SUNOS(ID.SPARC_32_SUNOS, false, size_sparc_32_sunos, align_sparc_32_sunos);
-
- public final ID id;
+
+ public final ID id;
public final MachineDescription md;
-
+
StaticConfig(ID id, boolean littleEndian, int[] sizes, int[] alignments) {
this.id = id;
int i=0, j=0;
@@ -128,7 +128,7 @@ public class MachineDescription {
alignments[j++],
alignments[j++]);
}
-
+
public StringBuilder toString(StringBuilder sb) {
if(null==sb) {
sb = new StringBuilder();
@@ -137,23 +137,23 @@ public class MachineDescription {
md.toString(sb);
return sb;
}
-
+
@Override
public String toString() {
return toString(null).toString();
}
}
-
+
final private boolean runtimeValidated;
-
+
final private boolean littleEndian;
-
+
final private int int8SizeInBytes = 1;
final private int int16SizeInBytes = 2;
final private int int32SizeInBytes = 4;
final private int int64SizeInBytes = 8;
-
+
final private int intSizeInBytes;
final private int longSizeInBytes;
final private int floatSizeInBytes;
@@ -162,7 +162,7 @@ public class MachineDescription {
final private int pointerSizeInBytes;
final private int pageSizeInBytes;
final private boolean is32Bit;
-
+
final private int int8AlignmentInBytes;
final private int int16AlignmentInBytes;
final private int int32AlignmentInBytes;
@@ -176,7 +176,7 @@ public class MachineDescription {
public MachineDescription(boolean runtimeValidated,
boolean littleEndian,
-
+
int intSizeInBytes,
int longSizeInBytes,
int floatSizeInBytes,
@@ -184,7 +184,7 @@ public class MachineDescription {
int ldoubleSizeInBytes,
int pointerSizeInBytes,
int pageSizeInBytes,
-
+
int int8AlignmentInBytes,
int int16AlignmentInBytes,
int int32AlignmentInBytes,
@@ -195,16 +195,16 @@ public class MachineDescription {
int doubleAlignmentInBytes,
int ldoubleAlignmentInBytes,
int pointerAlignmentInBytes) {
- this.runtimeValidated = runtimeValidated;
+ this.runtimeValidated = runtimeValidated;
this.littleEndian = littleEndian;
-
+
this.intSizeInBytes = intSizeInBytes;
this.longSizeInBytes = longSizeInBytes;
this.floatSizeInBytes = floatSizeInBytes;
this.doubleSizeInBytes = doubleSizeInBytes;
this.ldoubleSizeInBytes = ldoubleSizeInBytes;
this.pointerSizeInBytes = pointerSizeInBytes;
- this.pageSizeInBytes = pageSizeInBytes;
+ this.pageSizeInBytes = pageSizeInBytes;
this.is32Bit = 4 == pointerSizeInBytes;
this.int8AlignmentInBytes = int8AlignmentInBytes;
@@ -218,14 +218,14 @@ public class MachineDescription {
this.ldoubleAlignmentInBytes = ldoubleAlignmentInBytes;
this.pointerAlignmentInBytes = pointerAlignmentInBytes;
}
-
+
/**
* @return true if all values are validated at runtime, otherwise false (i.e. for static compilation w/ preset values)
*/
public final boolean isRuntimeValidated() {
return runtimeValidated;
}
-
+
/**
* Returns true only if this system uses little endian byte ordering.
*/
@@ -246,7 +246,7 @@ public class MachineDescription {
public final boolean is64Bit() {
return !is32Bit;
}
-
+
public final int intSizeInBytes() { return intSizeInBytes; }
public final int longSizeInBytes() { return longSizeInBytes; }
public final int int8SizeInBytes() { return int8SizeInBytes; }
@@ -258,7 +258,7 @@ public class MachineDescription {
public final int ldoubleSizeInBytes() { return ldoubleSizeInBytes; }
public final int pointerSizeInBytes() { return pointerSizeInBytes; }
public final int pageSizeInBytes() { return pageSizeInBytes; }
-
+
public final int intAlignmentInBytes() { return intAlignmentInBytes; }
public final int longAlignmentInBytes() { return longAlignmentInBytes; }
public final int int8AlignmentInBytes() { return int8AlignmentInBytes; }
@@ -269,20 +269,20 @@ public class MachineDescription {
public final int doubleAlignmentInBytes() { return doubleAlignmentInBytes; }
public final int ldoubleAlignmentInBytes() { return ldoubleAlignmentInBytes; }
public final int pointerAlignmentInBytes() { return pointerAlignmentInBytes; }
-
+
/**
* @return number of pages required for size in bytes
*/
public int pageCount(int size) {
return ( size + ( pageSizeInBytes - 1) ) / pageSizeInBytes ; // integer arithmetic
}
-
+
/**
* @return page aligned size in bytes
*/
public int pageAlignedSize(int size) {
return pageCount(size) * pageSizeInBytes;
- }
+ }
/**
* Checks whether two size objects are equal. Two instances
@@ -294,7 +294,7 @@ public class MachineDescription {
public final boolean equals(Object obj) {
if (this == obj) { return true; }
if ( !(obj instanceof MachineDescription) ) { return false; }
- final MachineDescription md = (MachineDescription) obj;
+ final MachineDescription md = (MachineDescription) obj;
return pageSizeInBytes == md.pageSizeInBytes &&
compatible(md);
@@ -309,7 +309,7 @@ public class MachineDescription {
*/
public final boolean compatible(MachineDescription md) {
return littleEndian == md.littleEndian &&
-
+
intSizeInBytes == md.intSizeInBytes &&
longSizeInBytes == md.longSizeInBytes &&
floatSizeInBytes == md.floatSizeInBytes &&
@@ -317,7 +317,7 @@ public class MachineDescription {
ldoubleSizeInBytes == md.ldoubleSizeInBytes &&
pointerSizeInBytes == md.pointerSizeInBytes &&
is32Bit == md.is32Bit &&
-
+
int8AlignmentInBytes == md.int8AlignmentInBytes &&
int16AlignmentInBytes == md.int16AlignmentInBytes &&
int32AlignmentInBytes == md.int32AlignmentInBytes &&
@@ -329,7 +329,7 @@ public class MachineDescription {
ldoubleAlignmentInBytes == md.ldoubleAlignmentInBytes &&
pointerAlignmentInBytes == md.pointerAlignmentInBytes ;
}
-
+
public StringBuilder toString(StringBuilder sb) {
if(null==sb) {
sb = new StringBuilder();
@@ -345,13 +345,13 @@ public class MachineDescription {
sb.append(", double ").append(doubleSizeInBytes) .append(" / ").append(doubleAlignmentInBytes);
sb.append(", ldouble ").append(ldoubleSizeInBytes).append(" / ").append(ldoubleAlignmentInBytes).append(Platform.getNewline());
sb.append(" pointer ").append(pointerSizeInBytes).append(" / ").append(pointerAlignmentInBytes);
- sb.append(", page ").append(pageSizeInBytes);
+ sb.append(", page ").append(pageSizeInBytes);
return sb;
}
-
+
@Override
public String toString() {
return toString(null).toString();
}
-
+
}
diff --git a/src/java/com/jogamp/common/os/NativeLibrary.java b/src/java/com/jogamp/common/os/NativeLibrary.java
index 3d81479..df59611 100644
--- a/src/java/com/jogamp/common/os/NativeLibrary.java
+++ b/src/java/com/jogamp/common/os/NativeLibrary.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2011 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.
*/
@@ -72,7 +72,7 @@ import com.jogamp.common.util.cache.TempJarCache;
ProcAddressTable glue code generation style without additional
supporting code needed in the generated library. */
-public final class NativeLibrary implements DynamicLookupHelper {
+public final class NativeLibrary implements DynamicLookupHelper {
private static final DynamicLinker dynLink;
private static final String[] prefixes;
private static final String[] suffixes;
@@ -85,7 +85,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
prefixes = new String[] { "" };
suffixes = new String[] { ".dll" };
break;
-
+
case MACOS:
dynLink = new MacOSXDynamicLinkerImpl();
prefixes = new String[] { "lib" };
@@ -97,12 +97,12 @@ public final class NativeLibrary implements DynamicLookupHelper {
prefixes = new String[] { "lib" };
suffixes = new String[] { ".so" };
break;
-
+
/*
case FREEBSD:
case SUNOS:
- case HPUX:
- case OPENKODE:
+ case HPUX:
+ case OPENKODE:
case LINUX: */
default:
dynLink = new PosixDynamicLinkerImpl();
@@ -119,7 +119,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
// May as well keep around the path to the library we opened
private final String libraryPath;
-
+
private final boolean global;
// Private constructor to prevent arbitrary instances from floating around
@@ -218,7 +218,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
if( null != t ) {
t.printStackTrace();
}
- }
+ }
}
if (DEBUG) {
@@ -290,10 +290,10 @@ public final class NativeLibrary implements DynamicLookupHelper {
/**
* Comparison of prefix and suffix of the given libName's basename
* is performed case insensitive
- *
- * @param libName the full path library name with prefix and suffix
+ *
+ * @param libName the full path library name with prefix and suffix
* @param isLowerCaseAlready indicates if libName is already lower-case
- *
+ *
* @return basename of libName w/o path, ie. /usr/lib/libDrinkBeer.so -> DrinkBeer on Unix systems, but null on Windows.
*/
public static final String isValidNativeLibraryName(String libName, boolean isLowerCaseAlready) {
@@ -305,7 +305,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
}
final String libBaseNameLC = isLowerCaseAlready ? libBaseName : libBaseName.toLowerCase();
int prefixIdx = -1;
- for(int i=0; i prefixIdx; i++) {
+ for(int i=0; i prefixIdx; i++) {
if (libBaseNameLC.startsWith(prefixes[i])) {
prefixIdx = i;
}
@@ -319,9 +319,9 @@ public final class NativeLibrary implements DynamicLookupHelper {
}
}
}
- return null;
+ return null;
}
-
+
/** Given the base library names (no prefixes/suffixes) for the
various platforms, enumerate the possible locations and names of
the indicated native library on the system. */
@@ -377,7 +377,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
if (searchSystemPathFirst) {
if(null != sysPath) {
res[i++] = sysPath;
- }
+ }
}
if(null != usrPath) {
res[i++] = usrPath;
@@ -385,7 +385,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
if (!searchSystemPathFirst) {
if(null != sysPath) {
res[i++] = sysPath;
- }
+ }
}
return res;
}
@@ -422,7 +422,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
// Add current location
addPaths("/System/Library/Frameworks/" + libName + ".Framework", baseNames, paths);
}
-
+
return paths;
}
@@ -433,7 +433,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
switch (PlatformPropsImpl.OS_TYPE) {
case WINDOWS:
return windowsLibName;
-
+
case MACOS:
return macOSXLibName;
@@ -441,8 +441,8 @@ public final class NativeLibrary implements DynamicLookupHelper {
case FREEBSD:
case DALVIK:
case SUNOS:
- case HPUX:
- case OPENKODE:
+ case HPUX:
+ case OPENKODE:
case LINUX: */
default:
return unixLibName;
@@ -459,9 +459,9 @@ public final class NativeLibrary implements DynamicLookupHelper {
} catch (URISyntaxException uriEx) {
throw new IllegalArgumentException(uriEx);
}
-
+
int prefixIdx = -1;
- for(int i=0; i prefixIdx; i++) {
+ for(int i=0; i prefixIdx; i++) {
if (libBaseNameLC.startsWith(prefixes[i])) {
prefixIdx = i;
}
@@ -494,7 +494,7 @@ public final class NativeLibrary implements DynamicLookupHelper {
}
}
- String[] res = new String[prefixes.length * suffixes.length +
+ String[] res = new String[prefixes.length * suffixes.length +
( PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS ? 1 : 0 )];
int idx = 0;
for (int i = 0; i < prefixes.length; i++) {
diff --git a/src/java/com/jogamp/common/os/Platform.java b/src/java/com/jogamp/common/os/Platform.java
index a01a4b4..896ea56 100644
--- a/src/java/com/jogamp/common/os/Platform.java
+++ b/src/java/com/jogamp/common/os/Platform.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.
*/
-
+
package com.jogamp.common.os;
import java.net.URI;
@@ -48,7 +48,7 @@ import jogamp.common.os.PlatformPropsImpl;
* Utility class for querying platform specific properties.
*
* Some field declarations and it's static initialization has been delegated
- * to it's super class {@link PlatformPropsImpl} to solve
+ * to it's super class {@link PlatformPropsImpl} to solve
* static initialization interdependencies w/ the GlueGen native library loading
* and it's derived information {@link #getMachineDescription()}, {@link #is32Bit()}, ..
* This mechanism is preferred in this case to avoid synchronization and locking
@@ -56,20 +56,20 @@ import jogamp.common.os.PlatformPropsImpl;
*
*/
public class Platform extends PlatformPropsImpl {
-
+
public enum OSType {
- LINUX(0), FREEBSD(1), ANDROID(2), MACOS(3), SUNOS(4), HPUX(5), WINDOWS(6), OPENKODE(7);
-
+ LINUX(0), FREEBSD(1), ANDROID(2), MACOS(3), SUNOS(4), HPUX(5), WINDOWS(6), OPENKODE(7);
+
public final int id;
OSType(int id){
this.id = id;
}
}
-
+
public enum CPUFamily {
/** AMD/Intel */
- X86( 0x00000000),
+ X86( 0x00000000),
/** ARM */
ARM( 0x00010000),
/** Power PC */
@@ -79,17 +79,17 @@ public class Platform extends PlatformPropsImpl {
/** PA RISC */
PA_RISC(0xFFFF0000),
/** Itanium */
- IA64( 0xFFFF1000);
-
+ IA64( 0xFFFF1000);
+
public final int id;
CPUFamily(int id){
this.id = id;
}
}
-
+
public enum CPUType {
- /** X86 32bit */
+ /** X86 32bit */
X86_32( CPUFamily.X86, 0x0001),
/** X86 64bit */
X86_64( CPUFamily.X86, 0x0002),
@@ -111,72 +111,72 @@ public class Platform extends PlatformPropsImpl {
IA64( CPUFamily.IA64, 0x0000),
/** PA_RISC2_0 */
PA_RISC2_0(CPUFamily.PA_RISC, 0x0001);
-
+
public final int id;
public final CPUFamily family;
-
+
CPUType(CPUFamily type, int id){
this.family = type;
this.id = id;
}
-
+
public CPUFamily getFamily() { return family; }
- }
-
+ }
+
public enum ABIType {
- GENERIC_ABI ( 0x0000 ),
- /** ARM GNU-EABI ARMEL -mfloat-abi=softfp */
+ GENERIC_ABI ( 0x0000 ),
+ /** ARM GNU-EABI ARMEL -mfloat-abi=softfp */
EABI_GNU_ARMEL ( 0x0001 ),
- /** ARM GNU-EABI ARMHF -mfloat-abi=hard */
+ /** ARM GNU-EABI ARMHF -mfloat-abi=hard */
EABI_GNU_ARMHF ( 0x0002 );
-
+
public final int id;
-
+
ABIType(int id){
this.id = id;
- }
+ }
}
-
+
private static final String useTempJarCachePropName = "jogamp.gluegen.UseTempJarCache";
-
+
/** fixed basename of JAR file and native library */
- private static final String libBaseName = "gluegen-rt";
-
+ private static final String libBaseName = "gluegen-rt";
+
//
// static initialization order:
//
-
+
/**
- * System property: 'jogamp.gluegen.UseTempJarCache',
+ * System property: 'jogamp.gluegen.UseTempJarCache',
* defaults to true if {@link #OS_TYPE} is not {@link OSType#ANDROID}.
*/
public static final boolean USE_TEMP_JAR_CACHE;
-
+
//
// post loading native lib:
//
-
+
private static final MachineDescription machineDescription;
-
+
private static final boolean is32Bit;
-
+
/** true if AWT is available and not in headless mode, otherwise false. */
public static final boolean AWT_AVAILABLE;
-
+
private static final boolean isRunningFromJarURL;
-
+
static {
final boolean[] _isRunningFromJarURL = new boolean[] { false };
final boolean[] _USE_TEMP_JAR_CACHE = new boolean[] { false };
final boolean[] _AWT_AVAILABLE = new boolean[] { false };
-
- AccessController.doPrivileged(new PrivilegedAction
* @param pollPeriod
- * @param portNumber to be used for this single instance server socket.
+ * @param portNumber to be used for this single instance server socket.
*/
public static SingletonInstance createServerSocket(long poll_ms, int portNumber) {
return new SingletonInstanceServerSocket(poll_ms, portNumber);
}
-
+
protected SingletonInstance(long poll_ms) {
this.poll_ms = Math.max(10, poll_ms);
}
-
+
public final long getPollPeriod() { return poll_ms; }
public abstract String getName();
@Override
public final String toString() { return getName(); }
-
+
@Override
public synchronized void lock() throws RuntimeException {
try {
@@ -99,7 +99,7 @@ public abstract class SingletonInstance implements Lock {
if( DEBUG ) {
final long t2 = System.currentTimeMillis();
System.err.println(infoPrefix(t2)+" +++ "+getName()+" - Locked within "+(t2-t0)+" ms, "+(i+1)+" attempts");
- }
+ }
return true;
}
if( DEBUG && 0==i ) {
@@ -118,9 +118,9 @@ public abstract class SingletonInstance implements Lock {
System.err.println(infoPrefix(t2)+" +++ EEE (2) "+getName()+" - couldn't get lock within "+(t2-t0)+" ms, "+i+" attempts");
}
return false;
- }
+ }
protected abstract boolean tryLockImpl();
-
+
@Override
public void unlock() throws RuntimeException {
final long t0 = System.currentTimeMillis();
@@ -145,7 +145,7 @@ public abstract class SingletonInstance implements Lock {
protected String infoPrefix() {
return infoPrefix(System.currentTimeMillis());
}
-
+
private final long poll_ms;
private boolean locked = false;
}
diff --git a/src/java/com/jogamp/common/util/locks/ThreadLock.java b/src/java/com/jogamp/common/util/locks/ThreadLock.java
index 65260bc..26e7475 100644
--- a/src/java/com/jogamp/common/util/locks/ThreadLock.java
+++ b/src/java/com/jogamp/common/util/locks/ThreadLock.java
@@ -33,27 +33,27 @@ package com.jogamp.common.util.locks;
*/
public interface ThreadLock extends Lock {
- /** Query whether the lock is hold by the a thread other than the current thread. */
+ /** Query whether the lock is hold by the a thread other than the current thread. */
boolean isLockedByOtherThread();
- /** Query whether the lock is hold by the given thread. */
+ /** Query whether the lock is hold by the given thread. */
boolean isOwner(Thread thread);
-
+
/**
* @return the Thread owning this lock if locked, otherwise null
*/
Thread getOwner();
/**
- * @throws RuntimeException if current thread does not hold the lock
+ * @throws RuntimeException if current thread does not hold the lock
*/
void validateLocked() throws RuntimeException;
-
+
/**
* Execute the {@link Runnable Runnable taskAfterUnlockBeforeNotify} while holding the exclusive lock.
*
* Then release the lock.
- *
+ *
*/
- void unlock(Runnable taskAfterUnlockBeforeNotify);
+ void unlock(Runnable taskAfterUnlockBeforeNotify);
}
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 canonMap) {
@@ -77,7 +77,7 @@ public class DebugEmitter implements GlueEmitter {
System.out.println("typedef " + value + " " + key + ";");
}
}
-
+
public Iterator emitFunctions(List 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 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.
*/
public class GlueGen implements GlueEmitterControls {
@@ -62,15 +62,15 @@ public class GlueGen implements GlueEmitterControls {
private List forcedStructNames = new ArrayList();
private PCPP preprocessor;
-
+
// State for SymbolFilters
private List constants;
private List 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 includePaths, List 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 void* 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 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 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 origNames = javaRenamedSymbols.get(newName);
if(null == origNames) {
origNames = new HashSet();
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 parsedEnumNames = parser.getParsedEnumNames();
final Set 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 {
*
* public abstract void FuncName(byte[] ugh, int bar, byte[] foo, byte[] goop);
*
- *
+ *
* However, if you supplied the following directive:
*
*
@@ -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[], we need to get
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 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 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 ke = symTable.keys();
Enumeration 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 extractLinesPrecedingTokenNumber( Integer toknum )
{
Vector lines = new Vector();
- 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 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 getAttributesTable() {
if(attributes == null)
attributes = new Hashtable(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 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 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 getFields() { return fields; }
void setFields(ArrayList 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()}.
* Hence we assume all method occurrences w/ same name are of equal or compatible type.
- * Deep comparison can be performed via {@link #isCompletelyEqual(Object o)};
+ * Deep comparison can be performed via {@link #isCompletelyEqual(Object o)};
*
**/
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 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 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!
*
* Caller should have checked link permissions
* for all libraries, i.e. for new RuntimePermission("loadLibrary.*");
* if exposing the field or address!
- *
+ *
*/
private final Field fieldForFunctionInSec(final String name) throws IllegalArgumentException {
return AccessController.doPrivileged(new PrivilegedAction() {
@@ -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 toMap() {
+ private final Map toMap() {
final SortedMap map = new TreeMap();
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.
*
@@ -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;
*
* User can enable DEBUG while defining property jogamp.gluegen.structgen.debug.
*
- *
+ *
* @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();
diff --git a/src/java/jogamp/common/Debug.java b/src/java/jogamp/common/Debug.java
index b826a06..460106b 100644
--- a/src/java/jogamp/common/Debug.java
+++ b/src/java/jogamp/common/Debug.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 @@ public class Debug extends PropertyAccess {
// Some common properties
private static final boolean verbose;
private static final boolean debugAll;
-
+
static {
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
diff --git a/src/java/jogamp/common/jvm/JVMUtil.java b/src/java/jogamp/common/jvm/JVMUtil.java
index af74f08..e655654 100644
--- a/src/java/jogamp/common/jvm/JVMUtil.java
+++ b/src/java/jogamp/common/jvm/JVMUtil.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
@@ -64,9 +64,9 @@ public class JVMUtil {
}
}
- /** Kicks of one-time static initialization of this class. See {@link JVMUtil}. */
+ /** Kicks of one-time static initialization of this class. See {@link JVMUtil}. */
public static void initSingleton() { }
-
+
private JVMUtil() {}
private static native boolean initialize(java.nio.ByteBuffer buffer);
diff --git a/src/java/jogamp/common/os/AndroidUtils.java b/src/java/jogamp/common/os/AndroidUtils.java
index c6d5819..bb09ba9 100644
--- a/src/java/jogamp/common/os/AndroidUtils.java
+++ b/src/java/jogamp/common/os/AndroidUtils.java
@@ -38,7 +38,7 @@ public class AndroidUtils {
private static final Method androidGetPackageInfoVersionNameMethod;
private static final Method androidGetPackageInfoVersionCodeMethod;
private static final Method androidGetTempRootMethod;
-
+
static {
if(AndroidVersion.isAvailable) {
final ClassLoader cl = AndroidUtils.class.getClassLoader();
@@ -52,10 +52,10 @@ public class AndroidUtils {
androidGetTempRootMethod = null;
}
}
-
+
/**
- * @return null if platform is not Android or no Android Context is registered
- * via {@link jogamp.common.os.android.StaticContext#init(android.content.Context) StaticContext.init(..)},
+ * @return null if platform is not Android or no Android Context is registered
+ * via {@link jogamp.common.os.android.StaticContext#init(android.content.Context) StaticContext.init(..)},
* otherwise the found package version code of packageName is returned.
*/
public static final int getPackageInfoVersionCode(String packageName) {
@@ -64,10 +64,10 @@ public class AndroidUtils {
}
return -1;
}
-
+
/**
- * @return null if platform is not Android or no Android Context is registered
- * via {@link jogamp.common.os.android.StaticContext#init(android.content.Context) StaticContext.init(..)},
+ * @return null if platform is not Android or no Android Context is registered
+ * via {@link jogamp.common.os.android.StaticContext#init(android.content.Context) StaticContext.init(..)},
* otherwise the found package version name of packageName is returned.
*/
public static final String getPackageInfoVersionName(String packageName) {
@@ -76,18 +76,18 @@ public class AndroidUtils {
}
return null;
}
-
+
/**
- * @return null if platform is not Android or no Android Context is registered
- * via {@link jogamp.common.os.android.StaticContext#init(android.content.Context) StaticContext.init(..)},
- * otherwise the context relative world readable temp directory returned.
+ * @return null if platform is not Android or no Android Context is registered
+ * via {@link jogamp.common.os.android.StaticContext#init(android.content.Context) StaticContext.init(..)},
+ * otherwise the context relative world readable temp directory returned.
*/
public static File getTempRoot()
throws RuntimeException {
if(null != androidGetTempRootMethod) {
return (File) ReflectionUtil.callMethod(null, androidGetTempRootMethod);
}
- return null;
- }
-
+ return null;
+ }
+
}
diff --git a/src/java/jogamp/common/os/BionicDynamicLinkerImpl.java b/src/java/jogamp/common/os/BionicDynamicLinkerImpl.java
index 453f200..09057f8 100644
--- a/src/java/jogamp/common/os/BionicDynamicLinkerImpl.java
+++ b/src/java/jogamp/common/os/BionicDynamicLinkerImpl.java
@@ -37,7 +37,7 @@ package jogamp.common.os;
public final class BionicDynamicLinkerImpl extends UnixDynamicLinkerImpl {
private static final long RTLD_DEFAULT = 0xffffffffL;
// static final long RTLD_NEXT = 0xfffffffeL;
-
+
private static final int RTLD_LAZY = 0x00001;
// static final int RTLD_NOW = 0x00000;
private static final int RTLD_LOCAL = 0x00000;
@@ -52,10 +52,10 @@ public final class BionicDynamicLinkerImpl extends UnixDynamicLinkerImpl {
public final long openLibraryGlobal(String pathname, boolean debug) throws SecurityException {
return this.openLibraryImpl(pathname, RTLD_LAZY | RTLD_GLOBAL, debug);
}
-
+
@Override
- public final long lookupSymbolGlobal(String symbolName) throws SecurityException {
+ public final long lookupSymbolGlobal(String symbolName) throws SecurityException {
return this.lookupSymbolGlobalImpl(RTLD_DEFAULT, symbolName);
}
-
+
}
diff --git a/src/java/jogamp/common/os/DynamicLinkerImpl.java b/src/java/jogamp/common/os/DynamicLinkerImpl.java
index 4686cd2..39c112e 100644
--- a/src/java/jogamp/common/os/DynamicLinkerImpl.java
+++ b/src/java/jogamp/common/os/DynamicLinkerImpl.java
@@ -37,9 +37,9 @@ import com.jogamp.common.util.LongObjectHashMap;
// and sealed jogamp.common.* package definition
// ensuring no abuse via subclassing.
//
-
+
private final LongObjectHashMap libHandle2Name = new LongObjectHashMap( 16 /* initialCapacity */ );
-
+
protected static final class LibRef {
public LibRef(String name) {
this.name = name;
@@ -48,18 +48,18 @@ import com.jogamp.common.util.LongObjectHashMap;
public final int incrRefCount() { return ++refCount; }
public final int decrRefCount() { return --refCount; }
public final int getRefCount() { return refCount; }
-
+
public final String getName() { return name; }
public final String toString() { return "LibRef["+name+", refCount "+refCount+"]"; }
-
+
private final String name;
private int refCount;
}
-
+
protected final synchronized LibRef getLibRef(long handle) {
return (LibRef) libHandle2Name.get(handle);
}
-
+
protected final synchronized LibRef incrLibRefCount(long handle, String libName) {
LibRef libRef = getLibRef(handle);
if( null == libRef ) {
@@ -73,7 +73,7 @@ import com.jogamp.common.util.LongObjectHashMap;
}
return libRef;
}
-
+
protected final synchronized LibRef decrLibRefCount(long handle) {
LibRef libRef = getLibRef(handle);
if( null != libRef ) {
diff --git a/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java b/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java
index 18dcf97..b2f0f31 100644
--- a/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java
+++ b/src/java/jogamp/common/os/MacOSXDynamicLinkerImpl.java
@@ -45,15 +45,15 @@ public final class MacOSXDynamicLinkerImpl extends UnixDynamicLinkerImpl {
public final long openLibraryLocal(String pathname, boolean debug) throws SecurityException {
return this.openLibraryImpl(pathname, RTLD_LAZY | RTLD_LOCAL, debug);
}
-
+
@Override
public final long openLibraryGlobal(String pathname, boolean debug) throws SecurityException {
return this.openLibraryImpl(pathname, RTLD_LAZY | RTLD_GLOBAL, debug);
}
-
+
@Override
public final long lookupSymbolGlobal(String symbolName) throws SecurityException {
return this.lookupSymbolGlobalImpl(RTLD_DEFAULT, symbolName);
}
-
+
}
diff --git a/src/java/jogamp/common/os/MachineDescriptionRuntime.java b/src/java/jogamp/common/os/MachineDescriptionRuntime.java
index a58accd..01559b9 100644
--- a/src/java/jogamp/common/os/MachineDescriptionRuntime.java
+++ b/src/java/jogamp/common/os/MachineDescriptionRuntime.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.
*/
-
+
package jogamp.common.os;
import com.jogamp.common.os.MachineDescription;
@@ -39,7 +39,7 @@ public class MachineDescriptionRuntime {
static volatile boolean smdQueried = false;
static MachineDescription.StaticConfig smd = null;
-
+
public static MachineDescription.StaticConfig getStatic() {
if(!smdQueried) {
synchronized(MachineDescription.class) { // volatile dbl-checked-locking OK
@@ -50,8 +50,8 @@ public class MachineDescriptionRuntime {
}
}
return smd;
- }
-
+ }
+
private static boolean isCPUArch32Bit() throws RuntimeException {
switch( PlatformPropsImpl.CPU_ARCH ) {
case X86_32:
@@ -71,7 +71,7 @@ public class MachineDescriptionRuntime {
throw new RuntimeException("Please port CPU detection (32/64 bit) to your platform (" + PlatformPropsImpl.OS_lower + "/" + PlatformPropsImpl.ARCH_lower + "("+PlatformPropsImpl.CPU_ARCH+"))");
}
}
-
+
private static MachineDescription.StaticConfig getStaticImpl() {
if(isCPUArch32Bit()) {
if(PlatformPropsImpl.CPU_ARCH.getFamily() == Platform.CPUFamily.ARM && PlatformPropsImpl.LITTLE_ENDIAN) {
@@ -94,7 +94,7 @@ public class MachineDescriptionRuntime {
return StaticConfig.X86_64_UNIX;
}
}
-
+
static volatile boolean rmdQueried = false;
static MachineDescription rmd = null;
@@ -108,14 +108,14 @@ public class MachineDescriptionRuntime {
}
}
return rmd;
- }
+ }
private static MachineDescription getRuntimeImpl() {
try {
Platform.initSingleton(); // loads native gluegen-rt library
} catch (UnsatisfiedLinkError err) {
return null;
}
-
+
int pointerSizeInBytes = getPointerSizeInBytesImpl();
switch(pointerSizeInBytes) {
case 4:
@@ -129,25 +129,25 @@ public class MachineDescriptionRuntime {
if(Integer.MAX_VALUE < pageSizeL) {
throw new InternalError("PageSize exceeds integer value: " + pageSizeL);
}
-
+
// size: int, long, float, double, pointer, pageSize
// alignment: int8, int16, int32, int64, int, long, float, double, pointer
- return new MachineDescription(
+ return new MachineDescription(
true /* runtime validated */, PlatformPropsImpl.LITTLE_ENDIAN,
-
+
getSizeOfIntImpl(), getSizeOfLongImpl(),
- getSizeOfFloatImpl(), getSizeOfDoubleImpl(), getSizeOfLongDoubleImpl(),
+ getSizeOfFloatImpl(), getSizeOfDoubleImpl(), getSizeOfLongDoubleImpl(),
pointerSizeInBytes, (int)pageSizeL,
-
+
getAlignmentInt8Impl(), getAlignmentInt16Impl(), getAlignmentInt32Impl(), getAlignmentInt64Impl(),
- getAlignmentIntImpl(), getAlignmentLongImpl(),
- getAlignmentFloatImpl(), getAlignmentDoubleImpl(), getAlignmentLongDoubleImpl(),
- getAlignmentPointerImpl());
+ getAlignmentIntImpl(), getAlignmentLongImpl(),
+ getAlignmentFloatImpl(), getAlignmentDoubleImpl(), getAlignmentLongDoubleImpl(),
+ getAlignmentPointerImpl());
}
private static native int getPointerSizeInBytesImpl();
private static native long getPageSizeInBytesImpl();
-
+
private static native int getAlignmentInt8Impl();
private static native int getAlignmentInt16Impl();
private static native int getAlignmentInt32Impl();
@@ -162,7 +162,7 @@ public class MachineDescriptionRuntime {
private static native int getSizeOfLongImpl();
private static native int getSizeOfPointerImpl();
private static native int getSizeOfFloatImpl();
- private static native int getSizeOfDoubleImpl();
- private static native int getSizeOfLongDoubleImpl();
+ private static native int getSizeOfDoubleImpl();
+ private static native int getSizeOfLongDoubleImpl();
}
diff --git a/src/java/jogamp/common/os/PlatformPropsImpl.java b/src/java/jogamp/common/os/PlatformPropsImpl.java
index 819fe9c..e632647 100644
--- a/src/java/jogamp/common/os/PlatformPropsImpl.java
+++ b/src/java/jogamp/common/os/PlatformPropsImpl.java
@@ -37,16 +37,16 @@ import com.jogamp.common.util.VersionNumber;
*/
public abstract class PlatformPropsImpl {
static final boolean DEBUG = Debug.debug("Platform");
-
+
//
// static initialization order:
//
-
+
/** Version 1.6. As a JVM version, it enables certain JVM 1. features. */
public static final VersionNumber Version16;
/** Version 1.7. As a JVM version, it enables certain JVM 1.7 features. */
public static final VersionNumber Version17;
-
+
public static final String OS;
public static final String OS_lower;
public static final String OS_VERSION;
@@ -62,17 +62,17 @@ public abstract class PlatformPropsImpl {
public static final String JAVA_RUNTIME_NAME;
/** True if having {@link java.nio.LongBuffer} and {@link java.nio.DoubleBuffer} available. */
public static final boolean JAVA_SE;
- /** True if being compatible w/ language level 6, e.g. JRE 1.6. Implies {@link #JAVA_SE}. Note: We claim Android is compatible. */
+ /** True if being compatible w/ language level 6, e.g. JRE 1.6. Implies {@link #JAVA_SE}. Note: We claim Android is compatible. */
public static final boolean JAVA_6;
-
+
public static final String NEWLINE;
public static final boolean LITTLE_ENDIAN;
-
+
public static final CPUType CPU_ARCH;
public static final ABIType ABI_TYPE;
public static final OSType OS_TYPE;
public static final String os_and_arch;
-
+
static {
Version16 = new VersionNumber(1, 6, 0);
Version17 = new VersionNumber(1, 7, 0);
@@ -103,10 +103,10 @@ public abstract class PlatformPropsImpl {
JAVA_RUNTIME_NAME = getJavaRuntimeNameImpl();
JAVA_SE = initIsJavaSE();
JAVA_6 = JAVA_SE && ( AndroidVersion.isAvailable || JAVA_VERSION_NUMBER.compareTo(Version16) >= 0 ) ;
-
+
NEWLINE = System.getProperty("line.separator");
LITTLE_ENDIAN = queryIsLittleEndianImpl();
-
+
CPU_ARCH = getCPUTypeImpl(ARCH_lower);
OS_TYPE = getOSTypeImpl();
ABI_TYPE = queryABITypeImpl(OS_TYPE, CPU_ARCH);
@@ -114,7 +114,7 @@ public abstract class PlatformPropsImpl {
}
protected PlatformPropsImpl() {}
-
+
private static final String getJavaRuntimeNameImpl() {
// the fast path, check property Java SE instead of traversing through the ClassLoader
return AccessController.doPrivileged(new PrivilegedAction() {
@@ -123,7 +123,7 @@ public abstract class PlatformPropsImpl {
}
});
}
-
+
private static final boolean initIsJavaSE() {
if( null != JAVA_RUNTIME_NAME && JAVA_RUNTIME_NAME.indexOf("Java SE") != -1) {
return true;
@@ -148,7 +148,7 @@ public abstract class PlatformPropsImpl {
tst_i.put(0, 0x0A0B0C0D);
return 0x0C0D == tst_s.get(0);
}
-
+
private static final CPUType getCPUTypeImpl(String archLower) {
if( archLower.equals("x86") ||
archLower.equals("i386") ||
@@ -181,10 +181,10 @@ public abstract class PlatformPropsImpl {
throw new RuntimeException("Please port CPU detection to your platform (" + OS_lower + "/" + archLower + ")");
}
}
-
+
@SuppressWarnings("unused")
private static final boolean contains(String data, String[] search) {
- if(null != data && null != search) {
+ if(null != data && null != search) {
for(int i=0; i= 0) {
return true;
@@ -193,7 +193,7 @@ public abstract class PlatformPropsImpl {
}
return false;
}
-
+
/**
* Returns the {@link ABIType} of the current platform using given {@link CPUType cpuType}
* and {@link OSType osType} as a hint.
@@ -201,33 +201,33 @@ public abstract class PlatformPropsImpl {
* Note the following queries are performed:
*
*
not {@link CPUFamily#ARM} -> {@link ABIType#GENERIC_ABI}
- *
else
- *
+ *
else
+ *
*
{@link OSType#ANDROID} -> {@link ABIType#EABI_GNU_ARMEL} (due to EACCES, Permission denied)
- *
else
- *
+ *
else
+ *
*
Elf ARM Tags -> {@link ABIType#EABI_GNU_ARMEL}, {@link ABIType#EABI_GNU_ARMHF}
*
On Error -> {@link ABIType#EABI_GNU_ARMEL}
*
- *
+ *
*
*
*
- * For Elf parsing either the current executable is used (Linux) or a found java/jvm native library.
+ * For Elf parsing either the current executable is used (Linux) or a found java/jvm native library.
*
*
* Elf ARM Tags are read using {@link ElfHeader}, .. and {@link SectionArmAttributes#abiVFPArgsAcceptsVFPVariant(byte)}.
*
* @param osType
* @param cpuType
- *
+ *
* @return
*/
private static final ABIType queryABITypeImpl(final OSType osType, final CPUType cpuType) {
if( CPUFamily.ARM != cpuType.family ) {
return ABIType.GENERIC_ABI;
}
- if( OSType.ANDROID == osType ) { // EACCES (Permission denied) - We assume a not rooted device!
+ if( OSType.ANDROID == osType ) { // EACCES (Permission denied) - We assume a not rooted device!
return ABIType.EABI_GNU_ARMEL;
}
return AccessController.doPrivileged(new PrivilegedAction() {
@@ -250,7 +250,7 @@ public abstract class PlatformPropsImpl {
if( null == file ) {
file = findSysLib("jvm");
}
- if( null != file ) {
+ if( null != file ) {
in = new RandomAccessFile(file, "r");
final ElfHeader eh = ElfHeader.read(in);
if(DEBUG) {
@@ -290,7 +290,7 @@ public abstract class PlatformPropsImpl {
res = abiVFPArgsAcceptsVFPVariant ? ABIType.EABI_GNU_ARMHF : ABIType.EABI_GNU_ARMEL;
} else {
res = ABIType.GENERIC_ABI;
- }
+ }
if(DEBUG) {
System.err.println("ELF: abiARM "+abiARM+", abiVFPArgsAcceptsVFPVariant "+abiVFPArgsAcceptsVFPVariant+" -> "+res);
}
@@ -302,7 +302,7 @@ public abstract class PlatformPropsImpl {
return file.isFile() && file.canRead();
} catch (Throwable t) { }
return false;
- }
+ }
private static File findSysLib(String libName) {
ClassLoader cl = PlatformPropsImpl.class.getClassLoader();
final List possibleLibPaths = NativeLibrary.enumerateLibraryPaths(libName, libName, libName, true, cl);
@@ -321,29 +321,29 @@ public abstract class PlatformPropsImpl {
}
return null;
}
-
+
private static final OSType getOSTypeImpl() throws RuntimeException {
if ( AndroidVersion.isAvailable ) {
return OSType.ANDROID;
}
if ( OS_lower.startsWith("linux") ) {
- return OSType.LINUX;
+ return OSType.LINUX;
}
if ( OS_lower.startsWith("freebsd") ) {
- return OSType.FREEBSD;
+ return OSType.FREEBSD;
}
if ( OS_lower.startsWith("android") ) {
- return OSType.ANDROID;
+ return OSType.ANDROID;
}
if ( OS_lower.startsWith("mac os x") ||
OS_lower.startsWith("darwin") ) {
- return OSType.MACOS;
+ return OSType.MACOS;
}
if ( OS_lower.startsWith("sunos") ) {
- return OSType.SUNOS;
+ return OSType.SUNOS;
}
if ( OS_lower.startsWith("hp-ux") ) {
- return OSType.HPUX;
+ return OSType.HPUX;
}
if ( OS_lower.startsWith("windows") ) {
return OSType.WINDOWS;
@@ -351,18 +351,18 @@ public abstract class PlatformPropsImpl {
if ( OS_lower.startsWith("kd") ) {
return OSType.OPENKODE;
}
- throw new RuntimeException("Please port OS detection to your platform (" + OS_lower + "/" + ARCH_lower + ")");
+ throw new RuntimeException("Please port OS detection to your platform (" + OS_lower + "/" + ARCH_lower + ")");
}
/**
* kick off static initialization of platform property information
*/
- public static void initSingleton() { }
-
+ public static void initSingleton() { }
+
/**
* Returns the GlueGen common name for the given OSType and CPUType
* as implemented in the build system in 'gluegen-cpptasks-base.xml'.
- *
+ *
* A list of currently supported os.and.arch strings:
*
*
freebsd-i586
@@ -386,7 +386,7 @@ public abstract class PlatformPropsImpl {
*/
public static final String getOSAndArch(OSType osType, CPUType cpuType, ABIType abiType) {
String _os_and_arch;
-
+
switch( cpuType ) {
case X86_32:
_os_and_arch = "i586";
@@ -398,7 +398,7 @@ public abstract class PlatformPropsImpl {
_os_and_arch = "armv6"; // TODO: sync with gluegen-cpptasks-base.xml
break;
case SPARC_32:
- _os_and_arch = "sparc";
+ _os_and_arch = "sparc";
break;
case PPC:
_os_and_arch = "ppc"; // TODO: sync with gluegen-cpptasks-base.xml
@@ -410,10 +410,10 @@ public abstract class PlatformPropsImpl {
_os_and_arch = "ia64";
break;
case SPARCV9_64:
- _os_and_arch = "sparcv9";
+ _os_and_arch = "sparcv9";
break;
case PA_RISC2_0:
- _os_and_arch = "risc2.0"; // TODO: sync with gluegen-cpptasks-base.xml
+ _os_and_arch = "risc2.0"; // TODO: sync with gluegen-cpptasks-base.xml
break;
default:
throw new InternalError("Complete case block");
@@ -423,33 +423,33 @@ public abstract class PlatformPropsImpl {
}
switch( osType ) {
case ANDROID:
- _os_and_arch = "android-" + _os_and_arch;
+ _os_and_arch = "android-" + _os_and_arch;
break;
case MACOS:
- _os_and_arch = "macosx-universal";
+ _os_and_arch = "macosx-universal";
break;
case WINDOWS:
- _os_and_arch = "windows-" + _os_and_arch;
+ _os_and_arch = "windows-" + _os_and_arch;
break;
case OPENKODE:
- _os_and_arch = "openkode-" + _os_and_arch; // TODO: think about that
- break;
+ _os_and_arch = "openkode-" + _os_and_arch; // TODO: think about that
+ break;
case LINUX:
- _os_and_arch = "linux-" + _os_and_arch;
+ _os_and_arch = "linux-" + _os_and_arch;
break;
case FREEBSD:
- _os_and_arch = "freebsd-" + _os_and_arch;
+ _os_and_arch = "freebsd-" + _os_and_arch;
break;
case SUNOS:
- _os_and_arch = "solaris-" + _os_and_arch;
+ _os_and_arch = "solaris-" + _os_and_arch;
break;
case HPUX:
_os_and_arch = "hpux-hppa"; // TODO: really only hppa ?
- break;
+ break;
default:
throw new InternalError("Complete case block");
}
- return _os_and_arch;
+ return _os_and_arch;
}
-
+
}
diff --git a/src/java/jogamp/common/os/PosixDynamicLinkerImpl.java b/src/java/jogamp/common/os/PosixDynamicLinkerImpl.java
index fced97f..f0f366c 100644
--- a/src/java/jogamp/common/os/PosixDynamicLinkerImpl.java
+++ b/src/java/jogamp/common/os/PosixDynamicLinkerImpl.java
@@ -31,7 +31,7 @@ public final class PosixDynamicLinkerImpl extends UnixDynamicLinkerImpl {
private static final long RTLD_DEFAULT = 0;
// static final long RTLD_NEXT = -1L;
-
+
private static final int RTLD_LAZY = 0x00001;
// static final int RTLD_NOW = 0x00002;
private static final int RTLD_LOCAL = 0x00000;
@@ -46,7 +46,7 @@ public final class PosixDynamicLinkerImpl extends UnixDynamicLinkerImpl {
public final long openLibraryGlobal(String pathname, boolean debug) throws SecurityException {
return this.openLibraryImpl(pathname, RTLD_LAZY | RTLD_GLOBAL, debug);
}
-
+
@Override
public final long lookupSymbolGlobal(String symbolName) throws SecurityException {
return this.lookupSymbolGlobalImpl(RTLD_DEFAULT, symbolName);
diff --git a/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java b/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java
index 7f10d8a..7a0e3b0 100644
--- a/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java
+++ b/src/java/jogamp/common/os/UnixDynamicLinkerImpl.java
@@ -36,7 +36,7 @@ import com.jogamp.common.util.SecurityUtil;
// and sealed jogamp.common.* package definition
// ensuring no abuse via subclassing.
//
-
+
/** Interface to C language function: int dlclose(void * ); */
protected static native int dlclose(long arg0);
@@ -59,16 +59,16 @@ import com.jogamp.common.util.SecurityUtil;
}
return handle;
}
-
+
protected final long lookupSymbolGlobalImpl(long dlSymGlobalFlag, String symbolName) throws SecurityException {
SecurityUtil.checkAllLinkPermission();
final long addr = dlsym(dlSymGlobalFlag, symbolName);
if(DEBUG_LOOKUP) {
System.err.println("DynamicLinkerImpl.lookupSymbolGlobal("+symbolName+") -> 0x"+Long.toHexString(addr));
}
- return addr;
+ return addr;
}
-
+
@Override
public final long lookupSymbol(long libraryHandle, String symbolName) throws IllegalArgumentException {
if( null == getLibRef( libraryHandle ) ) {
@@ -78,7 +78,7 @@ import com.jogamp.common.util.SecurityUtil;
if(DEBUG_LOOKUP) {
System.err.println("DynamicLinkerImpl.lookupSymbol(0x"+Long.toHexString(libraryHandle)+", "+symbolName+") -> 0x"+Long.toHexString(addr));
}
- return addr;
+ return addr;
}
@Override
@@ -88,7 +88,7 @@ import com.jogamp.common.util.SecurityUtil;
}
dlclose(libraryHandle);
}
-
+
@Override
public final String getLastError() {
return dlerror();
diff --git a/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java b/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java
index adb2492..76bb2f8 100644
--- a/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java
+++ b/src/java/jogamp/common/os/WindowsDynamicLinkerImpl.java
@@ -49,7 +49,7 @@ public final class WindowsDynamicLinkerImpl extends DynamicLinkerImpl {
// Don't know .. so it's an alias for the time being
return openLibraryGlobal(libraryName, debug);
}
-
+
@Override
public final long openLibraryGlobal(String libraryName, boolean debug) throws SecurityException {
SecurityUtil.checkLinkPermission(libraryName);
@@ -62,7 +62,7 @@ public final class WindowsDynamicLinkerImpl extends DynamicLinkerImpl {
}
return handle;
}
-
+
@Override
public final long lookupSymbolGlobal(String symbolName) throws SecurityException {
SecurityUtil.checkAllLinkPermission();
@@ -95,7 +95,7 @@ public final class WindowsDynamicLinkerImpl extends DynamicLinkerImpl {
}
return addr;
}
-
+
@Override
public final void closeLibrary(long libraryHandle) throws IllegalArgumentException {
if( null == decrLibRefCount( libraryHandle ) ) {
@@ -109,5 +109,5 @@ public final class WindowsDynamicLinkerImpl extends DynamicLinkerImpl {
final int err = GetLastError();
return "Last error: 0x"+Integer.toHexString(err)+" ("+err+")";
}
-
+
}
diff --git a/src/java/jogamp/common/os/elf/ElfHeader.java b/src/java/jogamp/common/os/elf/ElfHeader.java
index 88562cf..d76dbab 100644
--- a/src/java/jogamp/common/os/elf/ElfHeader.java
+++ b/src/java/jogamp/common/os/elf/ElfHeader.java
@@ -53,7 +53,7 @@ import static jogamp.common.os.elf.IOUtils.toHexString;
public class ElfHeader {
/** Size of e_ident array - {@value} */
public static int EI_NIDENT = 16;
-
+
/** ident byte #0 - {@value} */
public static final byte ELFMAG0 = 0x7f;
/** ident byte #1 - {@value} */
@@ -62,13 +62,13 @@ public class ElfHeader {
public static final byte ELFMAG2 = 'L';
/** ident byte #3 - {@value} */
public static final byte ELFMAG3 = 'F';
-
+
/** ident byte #4 */
public static final int EI_CLASS = 4;
public static final byte ELFCLASSNONE = 0;
public static final byte ELFCLASS32 = 1;
public static final byte ELFCLASS64 = 2;
-
+
/** ident byte #5 */
public static final int EI_DATA = 5;
public static final byte ELFDATANONE = 0;
@@ -79,7 +79,7 @@ public class ElfHeader {
public static final int EI_VERSION = 6;
public static final byte EV_NONE = 0;
public static final byte EV_CURRENT = 1;
-
+
/** ident byte #7 */
public static final int EI_OSABI = 7;
/** Unix System V ABI - {@value} */
@@ -114,29 +114,29 @@ public class ElfHeader {
/** Amiga Research OS ABI - {@value} **/
public static final byte ELFOSABI_AROS = 15;
/** The FenixOS highly scalable multi-core OS 64-255 Architecture-specific value range - {@value} */
- public static final byte ELFOSABI_FENIXOS = 16;
-
+ public static final byte ELFOSABI_FENIXOS = 16;
+
/** ident byte #8
*
- * This byte identifies the version of the ABI to which the object is targeted.
- * This field is used to distinguish among incompatible versions of an ABI.
- * The interpretation of this version number is dependent on the ABI identified by the EI_OSABI field.
+ * This byte identifies the version of the ABI to which the object is targeted.
+ * This field is used to distinguish among incompatible versions of an ABI.
+ * The interpretation of this version number is dependent on the ABI identified by the EI_OSABI field.
* Applications conforming to this specification use the value 0.
- *
+ *
*/
public static final int EI_ABIVERSION = 8;
-
+
/**
* ident byte #9 .. ?
*
- * Start of padding.
- * These bytes are reserved and set to zero.
- * Programs which read them should ignore them.
+ * Start of padding.
+ * These bytes are reserved and set to zero.
+ * Programs which read them should ignore them.
* The value for EI_PAD will change in the future if currently unused bytes are given meanings.
*
*/
public static final int EI_PAD = 9;
-
+
/**
* This masks an 8-bit version number, the version of the ABI to which this
* ELF file conforms. This ABI is version 5. A value of 0 denotes unknown conformance.
@@ -144,27 +144,27 @@ public class ElfHeader {
*/
public static final int EF_ARM_ABIMASK = 0xFF000000;
public static final int EF_ARM_ABISHIFT = 24;
-
+
/**
* ARM ABI version 5.
* {@value}
*/
public static final int EF_ARM_ABI5 = 0x05000000;
-
+
/**
* The ELF file contains BE-8 code, suitable for execution on an ARM
* Architecture v6 processor. This flag must only be set on an executable file.
* {@value}
*/
public static final int EF_ARM_BE8 = 0x00800000;
-
+
/**
* Legacy code (ABI version 4 and earlier) generated by gcc-arm-xxx might
* use these bits.
* {@value}
*/
public static final int EF_ARM_GCCMASK = 0x00400FFF;
-
+
/**
* Set in executable file headers (e_type = ET_EXEC or ET_DYN) to note that
* the executable file was built to conform to the hardware floating-point
@@ -173,28 +173,28 @@ public class ElfHeader {
* Compatible with legacy (pre version 5) gcc use as EF_ARM_VFP_FLOAT.
*
*
- * Note: This is not used (anymore)
- *
+ * Note: This is not used (anymore)
+ *
* {@value}
*/
public static final int EF_ARM_ABI_FLOAT_HARD = 0x00000400;
-
+
/**
* Set in executable file headers (e_type = ET_EXEC or ET_DYN) to note
* explicitly that the executable file was built to conform to the software
* floating-point procedure-call standard (the base standard). If both
- * {@link #EF_ARM_ABI_FLOAT_HARD} and {@link #EF_ARM_ABI_FLOAT_SOFT} are clear,
+ * {@link #EF_ARM_ABI_FLOAT_HARD} and {@link #EF_ARM_ABI_FLOAT_SOFT} are clear,
* conformance to the base procedure-call standard is implied.
*
* Compatible with legacy (pre version 5) gcc use as EF_ARM_SOFT_FLOAT.
*
*
- * Note: This is not used (anymore)
- *
+ * Note: This is not used (anymore)
+ *
* {@value}
*/
public static final int EF_ARM_ABI_FLOAT_SOFT = 0x00000200;
-
+
/** An unknown type - {@value} */
public static final short ET_NONE = 0;
/** A relocatable file - {@value} */
@@ -205,7 +205,7 @@ public class ElfHeader {
public static final short ET_DYN = 3;
/** A core file - {@value} */
public static final short ET_CORE = 4;
-
+
public static final short EM_NONE = 0;
public static final short EM_M32 = 1;
public static final short EM_SPARC = 2;
@@ -357,34 +357,34 @@ public class ElfHeader {
public static final short EM_TILEPRO = 188;
public static final short EM_MICROBLAZE = 189;
public static final short EM_CUDA = 190;
-
+
public static final boolean isIdentityValid(byte[] ident) {
return ELFMAG0 == ident[0] &&
ELFMAG1 == ident[1] &&
ELFMAG2 == ident[2] &&
ELFMAG3 == ident[3] ;
}
-
+
/** Public access to the raw elf header */
public final Ehdr d;
-
+
/** Public access to the {@link SectionHeader} */
- public final SectionHeader[] sht;
-
+ public final SectionHeader[] sht;
+
private final String string;
-
+
/**
* Note: The input stream shall stay untouch to be able to read sections!
- *
+ *
* @param in input stream of a binary file at position zero
* @return
- * @throws IOException if reading from the given input stream fails or less then ELF Header size bytes
+ * @throws IOException if reading from the given input stream fails or less then ELF Header size bytes
* @throws IllegalArgumentException if the given input stream does not represent an ELF Header
*/
public static ElfHeader read(RandomAccessFile in) throws IOException, IllegalArgumentException {
final int eh_sz = Ehdr.size();
final byte[] buf = new byte[eh_sz];
- readBytes (in, buf, 0, eh_sz);
+ readBytes (in, buf, 0, eh_sz);
final ElfHeader eh = new ElfHeader(ByteBuffer.wrap(buf, 0, buf.length), in);
return eh;
}
@@ -392,7 +392,7 @@ public class ElfHeader {
/**
* @param buf ELF Header bytes
* @throws IllegalArgumentException if the given buffer does not represent an ELF Header
- * @throws IOException
+ * @throws IOException
*/
ElfHeader(java.nio.ByteBuffer buf, RandomAccessFile in) throws IllegalArgumentException, IOException {
d = Ehdr.create(buf);
@@ -404,11 +404,11 @@ public class ElfHeader {
}
public final short getSize() { return d.getE_ehsize(); }
-
- /**
- * Returns the architecture class in bits,
- * 32 for {@link #ELFCLASS32}, 64 for {@link #ELFCLASS64}
- * and 0 for {@link #ELFCLASSNONE}.
+
+ /**
+ * Returns the architecture class in bits,
+ * 32 for {@link #ELFCLASS32}, 64 for {@link #ELFCLASS64}
+ * and 0 for {@link #ELFCLASSNONE}.
*/
public final int getArchClassBits() {
switch( d.getE_ident()[EI_CLASS] ) {
@@ -417,48 +417,48 @@ public class ElfHeader {
default: return 0;
}
}
-
- /**
- * Returns the processor's data encoding, i.e.
- * {@link #ELFDATA2LSB}, {@link #ELFDATA2MSB} or {@link #ELFDATANONE};
+
+ /**
+ * Returns the processor's data encoding, i.e.
+ * {@link #ELFDATA2LSB}, {@link #ELFDATA2MSB} or {@link #ELFDATANONE};
*/
public final byte getDataEncodingMode() {
return d.getE_ident()[EI_DATA];
}
-
+
/** Returns the ELF file version, should be {@link #EV_CURRENT}. */
public final byte getVersion() {
return d.getE_ident()[EI_VERSION];
}
-
+
/** Returns the operating system and ABI for this file, 3 == Linux. Note: Often not used. */
public final byte getOSABI() {
return d.getE_ident()[EI_OSABI];
}
-
+
/** Returns the version of the {@link #getOSABI() OSABI} for this file. */
public final byte getOSABIVersion() {
return d.getE_ident()[EI_ABIVERSION];
}
- /** Returns the object file type, e.g. {@link #ET_EXEC}, .. */
+ /** Returns the object file type, e.g. {@link #ET_EXEC}, .. */
public final short getType() {
return d.getE_type();
}
- /** Returns the required architecture for the file, e.g. {@link #EM_386}, .. */
+ /** Returns the required architecture for the file, e.g. {@link #EM_386}, .. */
public final short getMachine() {
- return d.getE_machine();
+ return d.getE_machine();
}
-
- /**
+
+ /**
* Returns true if {@link #getMachine() machine} is a 32 or 64 bit ARM CPU
* of type {@link #EM_ARM}. */
public final boolean isArm() {
return getMachine() == EM_ARM;
}
-
- /**
+
+ /**
* Returns true if {@link #getMachine() machine} is a 32 or 64 bit Intel CPU
* of type {@link #EM_386}, {@link #EM_486} or {@link #EM_X86_64}. */
public final boolean isIntel() {
@@ -467,30 +467,30 @@ public class ElfHeader {
EM_486 == m ||
EM_X86_64 == m;
}
-
+
/** Returns the processor-specific flags associated with the file. */
public final int getFlags() {
return d.getE_flags();
}
-
+
/** Returns the ARM EABI version from {@link #getFlags() flags}, maybe 0 if not an ARM EABI. */
public byte getArmABI() {
- return (byte) ( ( ( EF_ARM_ABIMASK & d.getE_flags() ) >> EF_ARM_ABISHIFT ) & 0xff );
+ return (byte) ( ( ( EF_ARM_ABIMASK & d.getE_flags() ) >> EF_ARM_ABISHIFT ) & 0xff );
}
-
+
/** Returns the ARM EABI legacy GCC {@link #getFlags() flags}, maybe 0 if not an ARM EABI or not having legacy GCC flags. */
public int getArmLegacyGCCFlags() {
final int f = d.getE_flags();
- return 0 != ( EF_ARM_ABIMASK & f ) ? ( EF_ARM_GCCMASK & f ) : 0;
+ return 0 != ( EF_ARM_ABIMASK & f ) ? ( EF_ARM_GCCMASK & f ) : 0;
}
-
- /**
+
+ /**
* Returns the ARM EABI float mode from {@link #getFlags() flags},
* i.e. 1 for {@link #EF_ARM_ABI_FLOAT_SOFT}, 2 for {@link #EF_ARM_ABI_FLOAT_HARD}
* or 0 for none.
*
- * Note: This is not used (anymore)
- *
+ * Note: This is not used (anymore)
+ *
*/
public byte getArmFloatMode() {
final int f = d.getE_flags();
@@ -515,7 +515,7 @@ public class ElfHeader {
}
return null;
}
-
+
/** Returns the 1st occurence of matching SectionHeader {@link SectionHeader#getName() name}, or null if not exists. */
public final SectionHeader getSectionHeader(String name) {
for(int i=0; i int32-max "+toHexString(MAX_INT_VALUE));
@@ -53,46 +53,46 @@ class IOUtils {
static void checkBounds(final byte[] sb, final int offset, final int remaining) {
if( offset + remaining > sb.length ) {
throw new IndexOutOfBoundsException("Buffer of size "+sb.length+" cannot hold offset "+offset+" + remaining "+remaining);
- }
+ }
}
-
- static void readBytes(final RandomAccessFile in, final byte[] out, final int offset, final int len)
- throws IOException, IllegalArgumentException
- {
+
+ static void readBytes(final RandomAccessFile in, final byte[] out, final int offset, final int len)
+ throws IOException, IllegalArgumentException
+ {
in.readFully(out, offset, len);
}
-
+
static void seek(final RandomAccessFile in, long newPos) throws IOException {
in.seek(newPos);
}
-
+
static int readUInt32(final byte[] in, final int offset) {
final int v = readInt32(in, offset);
if( 0 > v ) {
- throw new IllegalArgumentException("Read uint32 value "+toHexString(v)+" > int32-max "+toHexString(MAX_INT_VALUE));
+ throw new IllegalArgumentException("Read uint32 value "+toHexString(v)+" > int32-max "+toHexString(MAX_INT_VALUE));
}
return v;
/** Need to fix endian for below path ..
checkBounds(in, offset, 4);
- final byte[] uint = new byte[] { 0, 0, 0, 0, in[offset+0], in[offset+1], in[offset+2], in[offset+3] };
+ final byte[] uint = new byte[] { 0, 0, 0, 0, in[offset+0], in[offset+1], in[offset+2], in[offset+3] };
final ByteBuffer b = ByteBuffer.wrap(uint, 0, 8).order(ByteOrder.nativeOrder());
return b.asLongBuffer().get(0); */
}
-
+
static int readInt32(final byte[] in, final int offset) {
checkBounds(in, offset, 4);
final ByteBuffer b = ByteBuffer.wrap(in, offset, 4).order(ByteOrder.nativeOrder());
return b.asIntBuffer().get(0);
}
-
+
/**
* @param sb byte source buffer to parse
* @param offset offset within byte source buffer to start parsing
- * @param remaining remaining numbers of bytes to parse beginning w/ sb_off,
+ * @param remaining remaining numbers of bytes to parse beginning w/ sb_off,
* which shall not exceed sb.length - offset.
* @param offset_post optional integer array holding offset post parsing
* @return the parsed string
- * @throws IndexOutOfBoundsException if offset + remaining > sb.length.
+ * @throws IndexOutOfBoundsException if offset + remaining > sb.length.
*/
static String getString(final byte[] sb, final int offset, final int remaining, int[] offset_post) throws IndexOutOfBoundsException {
checkBounds(sb, offset, remaining);
@@ -104,14 +104,14 @@ class IOUtils {
}
return s;
}
-
+
/**
* @param sb byte source buffer to parse
* @param offset offset within byte source buffer to start parsing
- * @param remaining remaining numbers of bytes to parse beginning w/ sb_off,
+ * @param remaining remaining numbers of bytes to parse beginning w/ sb_off,
* which shall not exceed sb.length - offset.
* @return the number of parsed strings
- * @throws IndexOutOfBoundsException if offset + remaining > sb.length.
+ * @throws IndexOutOfBoundsException if offset + remaining > sb.length.
*/
static int getStringCount(final byte[] sb, int offset, final int remaining) throws IndexOutOfBoundsException {
checkBounds(sb, offset, remaining);
@@ -120,21 +120,21 @@ class IOUtils {
for(; i < remaining && sb[i + offset] != 0; i++) { }
strnum++;
}
- return strnum;
+ return strnum;
}
-
+
/**
* @param sb byte source buffer to parse
* @param offset offset within byte source buffer to start parsing
- * @param remaining remaining numbers of bytes to parse beginning w/ sb_off,
+ * @param remaining remaining numbers of bytes to parse beginning w/ sb_off,
* which shall not exceed sb.length - offset.
* @return the parsed strings
- * @throws IndexOutOfBoundsException if offset + remaining > sb.length.
+ * @throws IndexOutOfBoundsException if offset + remaining > sb.length.
*/
public static String[] getStrings(final byte[] sb, int offset, final int remaining) throws IndexOutOfBoundsException {
final int strnum = getStringCount(sb, offset, remaining);
// System.err.println("XXX: strnum "+strnum+", sb_off "+sb_off+", sb_len "+sb_len);
-
+
final String[] sa = new String[strnum];
final int[] io_off = new int[] { offset };
for(int i=0; i < strnum; i++) {
@@ -142,7 +142,7 @@ class IOUtils {
sa[i] = getString(sb, io_off[0], remaining - io_off[0], io_off);
// System.err.println(".. "+io_off[0]+"[ "+sa[i]);
}
- return sa;
+ return sa;
}
-
+
}
diff --git a/src/java/jogamp/common/os/elf/Section.java b/src/java/jogamp/common/os/elf/Section.java
index 99c762c..a653668 100644
--- a/src/java/jogamp/common/os/elf/Section.java
+++ b/src/java/jogamp/common/os/elf/Section.java
@@ -32,19 +32,19 @@ public class Section {
public byte[] data;
public int offset;
public int length;
-
+
Section(SectionHeader sh, byte[] data, int offset, int length) {
this.sh = sh;
this.data = data;
this.offset = offset;
this.length = length;
}
-
+
public String toString() {
return "Section["+toSubString()+"]";
}
String toSubString() {
return sh+", data[off "+offset+", len "+length+"/"+data.length+"]";
}
-
+
}
diff --git a/src/java/jogamp/common/os/elf/SectionArmAttributes.java b/src/java/jogamp/common/os/elf/SectionArmAttributes.java
index 7b85bb9..413250a 100644
--- a/src/java/jogamp/common/os/elf/SectionArmAttributes.java
+++ b/src/java/jogamp/common/os/elf/SectionArmAttributes.java
@@ -23,17 +23,17 @@ import java.util.List;
*/
public class SectionArmAttributes extends Section {
public static final byte FORMAT_VERSION_A = 0x41; // 'A';
-
+
public static enum Type {
/** No Value */
- None,
+ None,
/** A Sub-Section - following the 4 byte sub section total size (tag + size + content) - byte order of the ELF file */
SubSection,
/** Null Terminated Byte-String */
NTBS,
ULEB128,
}
-
+
/** ULEB128 Value for {@link Tag#ABI_VFP_args}: FP parameter/result passing conforms to AAPCS, BASE variant. */
public static final byte ABI_VFP_ARGS_IS_BASE_VARIANT = 0;
/** ULEB128 Value for {@link Tag#ABI_VFP_args}: FP parameter/result passing conforms to AAPCS, VFP variant. */
@@ -41,18 +41,18 @@ public class SectionArmAttributes extends Section {
/** ULEB128 Value for {@link Tag#ABI_VFP_args}: FP parameter/result passing conforms to custom toolchain. */
public static final byte ABI_VFP_ARGS_IS_CUSTOM_VARIANT = 2;
/** ULEB128 Value for {@link Tag#ABI_VFP_args}: FP parameter/result passing conforms to both , BASE and VFP variant. */
- public static final byte ABI_VFP_ARGS_IS_BOTH_BASE_AND_VFP_VARIANT = 3;
-
- /**
+ public static final byte ABI_VFP_ARGS_IS_BOTH_BASE_AND_VFP_VARIANT = 3;
+
+ /**
* Returns true if value is either {@link #ABI_VFP_ARGS_IS_VFP_VARIANT} or {@link #ABI_VFP_ARGS_IS_BOTH_BASE_AND_VFP_VARIANT}
* @param v ULEB128 Value from {@link Tag#ABI_VFP_args} attribute
*/
public static final boolean abiVFPArgsAcceptsVFPVariant(byte v) {
return ABI_VFP_ARGS_IS_VFP_VARIANT == v || ABI_VFP_ARGS_IS_BOTH_BASE_AND_VFP_VARIANT == v;
}
-
+
public static enum Tag {
- None(0, Type.None),
+ None(0, Type.None),
File(1, Type.SubSection), Section(2, Type.SubSection), Symbol(3, Type.SubSection),
CPU_raw_name( 4, Type.NTBS ),
CPU_name( 5, Type.NTBS ),
@@ -96,10 +96,10 @@ public class SectionArmAttributes extends Section {
undefined69( 69, Type.None ),
MPextension_use_legacy( 70, Type.ULEB128 )
;
-
+
public final int id;
- public final Type type;
-
+ public final Type type;
+
/** Slow O(n) transition of a native tag value to a Tag. */
public static Tag get(final int id) {
final Tag[] tags = Tag.values();
@@ -117,16 +117,16 @@ public class SectionArmAttributes extends Section {
this.type = type;
}
}
-
+
public static class Attribute {
public final Tag tag;
private final Object value;
-
+
Attribute(Tag tag, Object value) {
this.tag = tag;
this.value = value;
}
-
+
public final boolean isNTBS() {
return Type.NTBS == tag.type;
}
@@ -136,7 +136,7 @@ public class SectionArmAttributes extends Section {
}
throw new IllegalArgumentException("Not NTBS but "+tag.type);
}
-
+
public final boolean isULEB128() {
return Type.ULEB128 == tag.type;
}
@@ -146,41 +146,41 @@ public class SectionArmAttributes extends Section {
}
throw new IllegalArgumentException("Not ULEB128 but "+tag.type);
}
-
+
public String toString() {
return tag+" = "+value;
}
}
-
+
public static class VendorAttributes {
public final String vendor;
public final List attributes;
-
+
VendorAttributes(String vendor, List attributes) {
this.vendor = vendor;
- this.attributes = attributes;
+ this.attributes = attributes;
}
-
+
public String toString() {
return vendor + attributes.toString();
}
}
public final List vendorAttributesList;
-
+
SectionArmAttributes(SectionHeader sh, byte[] data, int offset, int length) throws IndexOutOfBoundsException, IllegalArgumentException {
super(sh, data, offset, length);
this.vendorAttributesList = parse(data, offset, length);
}
-
+
public String toString() {
return "SectionArmAttributes["+super.toSubString()+", "+vendorAttributesList.toString()+"]";
}
-
+
public final Attribute get(Tag tag) {
for(int i=0; i attributes = vendorAttributesList.get(i).attributes;
for(int j=0; j get(String vendor) {
return get(vendorAttributesList, vendor);
}
-
+
static final List get(final List vendorAttributesList, String vendor) {
for(int i=0; isb_off
,
+ * @param remaining remaining numbers of bytes to parse beginning w/ sb_off,
* which shall not exceed sb.length - offset.
- * @throws IndexOutOfBoundsException if offset + remaining > sb.length.
- * @throws IllegalArgumentException if section parsing failed, i.e. incompatible version or data.
+ * @throws IndexOutOfBoundsException if offset + remaining > sb.length.
+ * @throws IllegalArgumentException if section parsing failed, i.e. incompatible version or data.
*/
static List parse(final byte[] in, final int offset, final int remaining) throws IndexOutOfBoundsException, IllegalArgumentException {
checkBounds(in, offset, remaining);
@@ -218,33 +218,33 @@ public class SectionArmAttributes extends Section {
throw new IllegalArgumentException("ShArmAttr: Not version A, but: "+toHexString(in[i]));
}
i++;
-
+
final List vendorAttributesList = new ArrayList();
-
+
while(i < remaining) {
- final int i_pre = i;
+ final int i_pre = i;
final int secLen = readUInt32(in, i); /* total section size: 4 + string + content, i.e. offset to next section */
i+=4;
-
+
final String vendor;
{
- int[] i_post = new int[] { 0 };
+ int[] i_post = new int[] { 0 };
vendor = getString(in, i, secLen - 4, i_post);
i = i_post[0];
}
-
+
final List attributes = new ArrayList();
-
+
while(i < secLen) {
- int[] i_post = new int[] { 0 };
- parseSub(in, i, secLen - i, i_post, attributes);
+ int[] i_post = new int[] { 0 };
+ parseSub(in, i, secLen - i, i_post, attributes);
i = i_post[0];
}
-
+
if( i_pre + secLen != i ) {
throw new IllegalArgumentException("ShArmAttr: Section length count mismatch, expected "+(i_pre + secLen)+", has "+i);
}
-
+
final List mergeAttribs = get(vendorAttributesList, vendor);
if( null != mergeAttribs ) {
mergeAttribs.addAll(attributes);
@@ -252,21 +252,21 @@ public class SectionArmAttributes extends Section {
vendorAttributesList.add(new VendorAttributes(vendor, attributes));
}
}
-
+
return vendorAttributesList;
}
-
+
/**
* @param in byte source buffer to parse
* @param offset offset within byte source buffer to start parsing
- * @param remaining remaining numbers of bytes to parse beginning w/ sb_off,
+ * @param remaining remaining numbers of bytes to parse beginning w/ sb_off,
* which shall not exceed sb.length - offset.
- * @throws IndexOutOfBoundsException if offset + remaining > sb.length.
- * @throws IllegalArgumentException if section parsing failed, i.e. incompatible version or data.
+ * @throws IndexOutOfBoundsException if offset + remaining > sb.length.
+ * @throws IllegalArgumentException if section parsing failed, i.e. incompatible version or data.
*/
static void parseSub(final byte[] in, final int offset, final int remaining, int[] offset_post, List attributes) throws IndexOutOfBoundsException, IllegalArgumentException {
checkBounds(in, offset, remaining);
-
+
// Starts w/ sub-section Tag
int i = offset;
final int i_sTag = in[i++];
@@ -274,7 +274,7 @@ public class SectionArmAttributes extends Section {
if( null == sTag ) {
throw new IllegalArgumentException("ShArmAttr: Invalid Sub-Section tag (NaT): "+i_sTag);
}
- final int subSecLen; // sub section total size (tag + size + content)
+ final int subSecLen; // sub section total size (tag + size + content)
switch(sTag) {
case File:
case Section:
@@ -295,7 +295,7 @@ public class SectionArmAttributes extends Section {
switch(tag.type) {
case NTBS:
{
- int[] i_post = new int[] { 0 };
+ int[] i_post = new int[] { 0 };
final String value = getString(in, i, subSecLen + offset - i, i_post);
attributes.add(new Attribute(tag, value));
i = i_post[0];
@@ -313,5 +313,5 @@ public class SectionArmAttributes extends Section {
}
}
offset_post[0] = offset + subSecLen;
- }
+ }
}
diff --git a/src/java/jogamp/common/os/elf/SectionHeader.java b/src/java/jogamp/common/os/elf/SectionHeader.java
index 18a3293..fd28d2a 100644
--- a/src/java/jogamp/common/os/elf/SectionHeader.java
+++ b/src/java/jogamp/common/os/elf/SectionHeader.java
@@ -120,7 +120,7 @@ public class SectionHeader {
* {@value}
*/
public static final int SHT_HIUSER = 0xffffffff;
-
+
/**
* {@value}
*/
@@ -141,7 +141,7 @@ public class SectionHeader {
* {@value}
*/
public static final int SHT_ARM_OVERLAYSECTION = 0x70000005;
-
+
/**
* {@value}
*/
@@ -169,14 +169,14 @@ public class SectionHeader {
/**
* {@value}
*/
- public static final short SHN_HIRESERVE = (short)0xffff;
-
+ public static final short SHN_HIRESERVE = (short)0xffff;
+
/** Public access to the raw elf section header */
public final Shdr d;
-
+
private int idx;
private String name;
-
+
SectionHeader(byte[] buf, int offset, int length, int sectionIdx) {
this( ByteBuffer.wrap(buf, 0, buf.length), sectionIdx );
}
@@ -185,11 +185,11 @@ public class SectionHeader {
this.idx = idx;
name = null;
}
-
+
public String toString() {
return "SectionHeader[idx "+idx+", name "+name+", type "+toHexString(getType())+", link "+d.getSh_link()+", info "+toHexString(d.getSh_info())+", flags "+toHexString(getFlags())+"]";
}
-
+
/**
* @param strS the {@link SectionHeader#SHT_STRTAB} section containing all strings
* @param nameOffset name offset within strS
@@ -202,7 +202,7 @@ public class SectionHeader {
public int getIndex() {
return idx;
}
-
+
/** Returns the type of this section. */
public int getType() {
return d.getSh_type();
@@ -212,7 +212,7 @@ public class SectionHeader {
public long getFlags() {
return d.getSh_flags();
}
-
+
/** Returns the size of this section. */
public long getSize() {
return d.getSh_size();
@@ -222,10 +222,10 @@ public class SectionHeader {
public String getName() {
return name;
}
-
+
/**
* Returns the Section referenced w/ this section header
- *
+ *
* @param in file owning the section
* @throws IOException if read error occurs
* @throws IllegalArgumentException if section offset or size mismatch including size > {@link Integer#MAX_VALUE}
@@ -238,10 +238,10 @@ public class SectionHeader {
final byte[] s_buf = new byte[s_size];
return readSectionImpl(in, s_buf, 0, s_size);
}
-
+
/**
* Returns the Section referenced w/ this section header using given byte array.
- *
+ *
* @param in file owning the section
* @param b destination buffer
* @param b_off offset in destination buffer
@@ -260,7 +260,7 @@ public class SectionHeader {
}
return readSectionImpl(in, b, b_off, r_len);
}
-
+
Section readSectionImpl(RandomAccessFile in, byte[] b, int b_off, int r_len) throws IOException, IllegalArgumentException {
final long s_off = d.getSh_offset();
seek(in, s_off);
@@ -270,5 +270,5 @@ public class SectionHeader {
} else {
return new Section(this, b, b_off, r_len);
}
- }
+ }
}
diff --git a/src/java/jogamp/common/util/locks/LockDebugUtil.java b/src/java/jogamp/common/util/locks/LockDebugUtil.java
index 480b143..ee0a8e8 100644
--- a/src/java/jogamp/common/util/locks/LockDebugUtil.java
+++ b/src/java/jogamp/common/util/locks/LockDebugUtil.java
@@ -50,7 +50,7 @@ public class LockDebugUtil {
dummy = new ArrayList(0);
}
}
-
+
public static List getRecursiveLockTrace() {
if(Lock.DEBUG) {
ArrayList ls = tlsLockedStacks.get();
@@ -63,7 +63,7 @@ public class LockDebugUtil {
return dummy;
}
}
-
+
public static void dumpRecursiveLockTrace(PrintStream out) {
if(Lock.DEBUG) {
List ls = getRecursiveLockTrace();
diff --git a/src/java/jogamp/common/util/locks/RecursiveLockImpl01CompleteFair.java b/src/java/jogamp/common/util/locks/RecursiveLockImpl01CompleteFair.java
index 986a7fc..f49e406 100644
--- a/src/java/jogamp/common/util/locks/RecursiveLockImpl01CompleteFair.java
+++ b/src/java/jogamp/common/util/locks/RecursiveLockImpl01CompleteFair.java
@@ -36,7 +36,7 @@ import com.jogamp.common.util.locks.RecursiveLock;
/**
* Reentrance locking toolkit, impl a complete fair FIFO scheduler
- *
+ *
*
* Sync object extends {@link AbstractOwnableSynchronizer}, hence monitoring is possible.
*/
@@ -50,7 +50,7 @@ public class RecursiveLockImpl01CompleteFair implements RecursiveLock {
final Thread thread;
boolean signaledByUnlock; // if true, it's also removed from queue
}
-
+
@SuppressWarnings("serial")
private static class Sync extends AbstractOwnableSynchronizer {
private Sync() {
@@ -68,7 +68,7 @@ public class RecursiveLockImpl01CompleteFair implements RecursiveLock {
ls.remove(lockedStack);
} else {
ls.add(s);
- }
+ }
lockedStack = s;
}
/** lock count by same thread */
@@ -79,7 +79,7 @@ public class RecursiveLockImpl01CompleteFair implements RecursiveLock {
private Throwable lockedStack = null;
}
private Sync sync = new Sync();
-
+
public RecursiveLockImpl01CompleteFair() {
}
@@ -119,7 +119,7 @@ public class RecursiveLockImpl01CompleteFair implements RecursiveLock {
public final boolean isLockedByOtherThread() {
synchronized(sync) {
final Thread o = sync.getOwner();
- return null != o && Thread.currentThread() != o ;
+ return null != o && Thread.currentThread() != o ;
}
}
@@ -175,9 +175,9 @@ public class RecursiveLockImpl01CompleteFair implements RecursiveLock {
}
return true;
}
-
+
if ( sync.getOwner() != null || ( 0= timeout ) {
// locked by other thread and no waiting requested
if(TRACE_LOCK) {
@@ -185,7 +185,7 @@ public class RecursiveLockImpl01CompleteFair implements RecursiveLock {
}
return false;
}
-
+
// enqueue at the start
WaitingThread wCur = new WaitingThread(cur);
sync.queue.add(0, wCur);
@@ -198,24 +198,24 @@ public class RecursiveLockImpl01CompleteFair implements RecursiveLock {
if( !wCur.signaledByUnlock ) {
sync.queue.remove(wCur); // O(n)
throw e; // propagate interruption not send by unlock
- } else if( cur != sync.getOwner() ) {
+ } else if( cur != sync.getOwner() ) {
// Issued by unlock, but still locked by other thread
//
timeout -= System.currentTimeMillis() - t0;
-
+
if(TRACE_LOCK) {
System.err.println("+++ LOCK 1 "+toString()+", cur "+threadName(cur)+", left "+timeout+" ms, signaled: "+wCur.signaledByUnlock);
}
-
+
if(0 < timeout) {
// not timed out, re-enque - lock was 'stolen'
wCur.signaledByUnlock = false;
sync.queue.add(sync.queue.size(), wCur);
}
- } // else: Issued by unlock, owning lock .. expected!
+ } // else: Issued by unlock, owning lock .. expected!
}
} while ( cur != sync.getOwner() && 0 < timeout ) ;
-
+
if( 0 >= timeout && cur != sync.getOwner() ) {
// timed out
if(!wCur.signaledByUnlock) {
@@ -226,7 +226,7 @@ public class RecursiveLockImpl01CompleteFair implements RecursiveLock {
}
return false;
}
-
+
++sync.holdCount;
if(TRACE_LOCK) {
System.err.println("+++ LOCK X1 "+toString()+", cur "+threadName(cur)+", left "+timeout+" ms");
@@ -237,7 +237,7 @@ public class RecursiveLockImpl01CompleteFair implements RecursiveLock {
System.err.println("+++ LOCK X0 "+toString()+", cur "+threadName(cur));
}
}
-
+
sync.setOwner(cur);
if(DEBUG) {
sync.setLockedStack(new Throwable("Previously locked by "+toString()));
@@ -245,7 +245,7 @@ public class RecursiveLockImpl01CompleteFair implements RecursiveLock {
return true;
}
}
-
+
@Override
public final void unlock() {
@@ -259,33 +259,33 @@ public class RecursiveLockImpl01CompleteFair implements RecursiveLock {
synchronized(sync) {
validateLocked();
final Thread cur = Thread.currentThread();
-
+
--sync.holdCount;
-
+
if (sync.holdCount > 0) {
if(TRACE_LOCK) {
System.err.println("--- LOCK XR "+toString()+", cur "+threadName(cur));
}
return;
}
-
+
if(DEBUG) {
sync.setLockedStack(null);
}
if(null!=taskAfterUnlockBeforeNotify) {
taskAfterUnlockBeforeNotify.run();
}
-
+
if(sync.queue.size() > 0) {
// fair, wakeup the oldest one ..
// final WaitingThread oldest = queue.removeLast();
final WaitingThread oldest = sync.queue.remove(sync.queue.size()-1);
- sync.setOwner(oldest.thread);
-
+ sync.setOwner(oldest.thread);
+
if(TRACE_LOCK) {
System.err.println("--- LOCK X1 "+toString()+", cur "+threadName(cur)+", signal: "+threadName(oldest.thread));
}
-
+
oldest.signaledByUnlock = true;
oldest.thread.interrupt(); // Propagate SecurityException if it happens
} else {
@@ -293,24 +293,24 @@ public class RecursiveLockImpl01CompleteFair implements RecursiveLock {
if(TRACE_LOCK) {
System.err.println("--- LOCK X0 "+toString()+", cur "+threadName(cur)+", signal any");
}
- sync.notify();
+ sync.notify();
}
}
}
-
+
@Override
public final int getQueueLength() {
synchronized(sync) {
return sync.queue.size();
}
}
-
+
@Override
public String toString() {
return syncName()+"[count "+sync.holdCount+
", qsz "+sync.queue.size()+", owner "+threadName(sync.getOwner())+"]";
}
-
+
private final String syncName() {
return "<"+Integer.toHexString(this.hashCode())+", "+Integer.toHexString(sync.hashCode())+">";
}
diff --git a/src/java/jogamp/common/util/locks/RecursiveLockImpl01Unfairish.java b/src/java/jogamp/common/util/locks/RecursiveLockImpl01Unfairish.java
index e8fecb1..8c9f720 100644
--- a/src/java/jogamp/common/util/locks/RecursiveLockImpl01Unfairish.java
+++ b/src/java/jogamp/common/util/locks/RecursiveLockImpl01Unfairish.java
@@ -37,9 +37,9 @@ import com.jogamp.common.util.locks.RecursiveLock;
* Reentrance locking toolkit, impl a non-complete fair FIFO scheduler.
*
* Fair scheduling is not guaranteed due to the usage of {@link Object#notify()},
- * however new lock-applicants will wait if queue is not empty for {@link #lock()}
+ * however new lock-applicants will wait if queue is not empty for {@link #lock()}
* and {@link #tryLock(long) tryLock}(timeout>0).
- *
+ *
*
* Sync object extends {@link AbstractOwnableSynchronizer}, hence monitoring is possible.
*/
@@ -49,19 +49,19 @@ public class RecursiveLockImpl01Unfairish implements RecursiveLock {
Thread getOwner();
boolean isOwner(Thread t);
void setOwner(Thread t);
-
+
Throwable getLockedStack();
void setLockedStack(Throwable s);
-
+
int getHoldCount();
void incrHoldCount(Thread t);
void decrHoldCount(Thread t);
-
+
int getQSz();
void incrQSz();
void decrQSz();
}
-
+
@SuppressWarnings("serial")
/* package */ static class SingleThreadSync extends AbstractOwnableSynchronizer implements Sync {
/* package */ SingleThreadSync() {
@@ -90,7 +90,7 @@ public class RecursiveLockImpl01Unfairish implements RecursiveLock {
ls.remove(lockedStack);
} else {
ls.add(s);
- }
+ }
lockedStack = s;
}
@Override
@@ -99,14 +99,14 @@ public class RecursiveLockImpl01Unfairish implements RecursiveLock {
public void incrHoldCount(Thread t) { holdCount++; }
@Override
public void decrHoldCount(Thread t) { holdCount--; }
-
+
@Override
public final int getQSz() { return qsz; }
@Override
public final void incrQSz() { qsz++; }
@Override
public final void decrQSz() { qsz--; }
-
+
/** lock count by same thread */
private int holdCount = 0;
/** queue size of waiting threads */
@@ -114,13 +114,13 @@ public class RecursiveLockImpl01Unfairish implements RecursiveLock {
/** stack trace of the lock, only used if DEBUG */
private Throwable lockedStack = null;
}
-
+
protected final Sync sync;
-
+
public RecursiveLockImpl01Unfairish(Sync sync) {
this.sync = sync;
}
-
+
public RecursiveLockImpl01Unfairish() {
this(new SingleThreadSync());
}
@@ -217,9 +217,9 @@ public class RecursiveLockImpl01Unfairish implements RecursiveLock {
}
return true;
}
-
+
if ( sync.getOwner() != null || ( 0= timeout ) {
// locked by other thread and no waiting requested
if(TRACE_LOCK) {
@@ -227,7 +227,7 @@ public class RecursiveLockImpl01Unfairish implements RecursiveLock {
}
return false;
}
-
+
sync.incrQSz();
do {
final long t0 = System.currentTimeMillis();
@@ -235,7 +235,7 @@ public class RecursiveLockImpl01Unfairish implements RecursiveLock {
timeout -= System.currentTimeMillis() - t0;
} while (null != sync.getOwner() && 0 < timeout) ;
sync.decrQSz();
-
+
if( 0 >= timeout && sync.getOwner() != null ) {
// timed out
if(TRACE_LOCK) {
@@ -243,24 +243,24 @@ public class RecursiveLockImpl01Unfairish implements RecursiveLock {
}
return false;
}
-
+
if(TRACE_LOCK) {
System.err.println("+++ LOCK X1 "+toString()+", cur "+threadName(cur)+", left "+timeout+" ms");
}
} else if(TRACE_LOCK) {
System.err.println("+++ LOCK X0 "+toString()+", cur "+threadName(cur));
}
-
+
sync.setOwner(cur);
sync.incrHoldCount(cur);
-
+
if(DEBUG) {
sync.setLockedStack(new Throwable("Previously locked by "+toString()));
}
return true;
}
}
-
+
@Override
public final void unlock() {
@@ -274,16 +274,16 @@ public class RecursiveLockImpl01Unfairish implements RecursiveLock {
synchronized(sync) {
validateLocked();
final Thread cur = Thread.currentThread();
-
+
sync.decrHoldCount(cur);
-
+
if (sync.getHoldCount() > 0) {
if(TRACE_LOCK) {
System.err.println("--- LOCK XR "+toString()+", cur "+threadName(cur));
}
return;
}
-
+
sync.setOwner(null);
if(DEBUG) {
sync.setLockedStack(null);
@@ -291,27 +291,27 @@ public class RecursiveLockImpl01Unfairish implements RecursiveLock {
if(null!=taskAfterUnlockBeforeNotify) {
taskAfterUnlockBeforeNotify.run();
}
-
+
if(TRACE_LOCK) {
System.err.println("--- LOCK X0 "+toString()+", cur "+threadName(cur)+", signal any");
}
sync.notify();
}
}
-
+
@Override
public final int getQueueLength() {
synchronized(sync) {
return sync.getQSz();
}
}
-
+
@Override
public String toString() {
return syncName()+"[count "+sync.getHoldCount()+
", qsz "+sync.getQSz()+", owner "+threadName(sync.getOwner())+"]";
}
-
+
/* package */ final String syncName() {
return "<"+Integer.toHexString(this.hashCode())+", "+Integer.toHexString(sync.hashCode())+">";
}
diff --git a/src/java/jogamp/common/util/locks/RecursiveLockImplJava5.java b/src/java/jogamp/common/util/locks/RecursiveLockImplJava5.java
index d9bc3df..f3dfa42 100644
--- a/src/java/jogamp/common/util/locks/RecursiveLockImplJava5.java
+++ b/src/java/jogamp/common/util/locks/RecursiveLockImplJava5.java
@@ -9,11 +9,11 @@ public class RecursiveLockImplJava5 implements RecursiveLock {
volatile Thread owner = null;
ReentrantLock lock;
-
+
public RecursiveLockImplJava5(boolean fair) {
lock = new ReentrantLock(fair);
}
-
+
@Override
public void lock() {
try {
@@ -49,7 +49,7 @@ public class RecursiveLockImplJava5 implements RecursiveLock {
}
lock.unlock();
}
-
+
@Override
public boolean isLocked() {
return lock.isLocked();
diff --git a/src/java/jogamp/common/util/locks/RecursiveThreadGroupLockImpl01Unfairish.java b/src/java/jogamp/common/util/locks/RecursiveThreadGroupLockImpl01Unfairish.java
index 6c43580..7a386d6 100644
--- a/src/java/jogamp/common/util/locks/RecursiveThreadGroupLockImpl01Unfairish.java
+++ b/src/java/jogamp/common/util/locks/RecursiveThreadGroupLockImpl01Unfairish.java
@@ -31,12 +31,12 @@ import java.util.Arrays;
import com.jogamp.common.util.locks.RecursiveThreadGroupLock;
-public class RecursiveThreadGroupLockImpl01Unfairish
- extends RecursiveLockImpl01Unfairish
- implements RecursiveThreadGroupLock
+public class RecursiveThreadGroupLockImpl01Unfairish
+ extends RecursiveLockImpl01Unfairish
+ implements RecursiveThreadGroupLock
{
/* package */ @SuppressWarnings("serial")
- static class ThreadGroupSync extends SingleThreadSync {
+ static class ThreadGroupSync extends SingleThreadSync {
/* package */ ThreadGroupSync() {
super();
threadNum = 0;
@@ -44,23 +44,23 @@ public class RecursiveThreadGroupLockImpl01Unfairish
holdCountAdditionOwner = 0;
}
@Override
- public final void incrHoldCount(Thread t) {
- super.incrHoldCount(t);
- if(!isOriginalOwner(t)) {
- holdCountAdditionOwner++;
- }
+ public final void incrHoldCount(Thread t) {
+ super.incrHoldCount(t);
+ if(!isOriginalOwner(t)) {
+ holdCountAdditionOwner++;
+ }
}
@Override
- public final void decrHoldCount(Thread t) {
- super.decrHoldCount(t);
- if(!isOriginalOwner(t)) {
- holdCountAdditionOwner--;
- }
+ public final void decrHoldCount(Thread t) {
+ super.decrHoldCount(t);
+ if(!isOriginalOwner(t)) {
+ holdCountAdditionOwner--;
+ }
}
public final int getAdditionalOwnerHoldCount() {
return holdCountAdditionOwner;
}
-
+
public final boolean isOriginalOwner(Thread t) {
return super.isOwner(t);
}
@@ -76,11 +76,11 @@ public class RecursiveThreadGroupLockImpl01Unfairish
}
return false;
}
-
+
public final int getAddOwnerCount() {
return threadNum;
}
- public final void addOwner(Thread t) throws IllegalArgumentException {
+ public final void addOwner(Thread t) throws IllegalArgumentException {
if(null == threads) {
if(threadNum>0) {
throw new InternalError("XXX");
@@ -98,15 +98,15 @@ public class RecursiveThreadGroupLockImpl01Unfairish
threads[threadNum] = t;
threadNum++;
}
-
+
public final void removeAllOwners() {
for(int i=threadNum-1; 0<=i; i--) {
threads[i]=null;
}
- threadNum=0;
+ threadNum=0;
}
-
- public final void removeOwner(Thread t) throws IllegalArgumentException {
+
+ public final void removeOwner(Thread t) throws IllegalArgumentException {
for (int i = 0 ; i < threadNum ; i++) {
if (threads[i] == t) {
threadNum--;
@@ -117,7 +117,7 @@ public class RecursiveThreadGroupLockImpl01Unfairish
}
throw new IllegalArgumentException("Not an owner: "+t);
}
-
+
String addOwnerToString() {
StringBuilder sb = new StringBuilder();
for(int i=0; i0 ) {
if(TRACE_LOCK) {
System.err.println("--- LOCK XR (tg) "+toString()+", cur "+threadName(cur)+" -> owner...");
@@ -193,23 +193,23 @@ public class RecursiveThreadGroupLockImpl01Unfairish
final Thread originalOwner = tgSync.getOwner();
if(originalOwner.getState() == Thread.State.WAITING) {
originalOwner.interrupt();
- }
+ }
}
}
if(TRACE_LOCK) {
System.err.println("++ unlock(X): currentThread "+cur.getName()+", lock: "+this.toString());
System.err.println("--- LOCK X0 (tg) "+toString()+", cur "+threadName(cur)+" -> unlock!");
}
- super.unlock(taskAfterUnlockBeforeNotify);
+ super.unlock(taskAfterUnlockBeforeNotify);
}
}
-
+
@Override
public final void removeOwner(Thread t) throws RuntimeException, IllegalArgumentException {
validateLocked();
((ThreadGroupSync)sync).removeOwner(t);
}
-
+
@Override
public String toString() {
final ThreadGroupSync tgSync = (ThreadGroupSync)sync;
diff --git a/src/java/jogamp/common/util/locks/SingletonInstanceFileLock.java b/src/java/jogamp/common/util/locks/SingletonInstanceFileLock.java
index 42d125a..a3d3ac9 100644
--- a/src/java/jogamp/common/util/locks/SingletonInstanceFileLock.java
+++ b/src/java/jogamp/common/util/locks/SingletonInstanceFileLock.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.
*/
-
+
package jogamp.common.util.locks;
import java.io.File;
@@ -73,7 +73,7 @@ public class SingletonInstanceFileLock extends SingletonInstance {
@Override
public final String getName() { return file.getPath(); }
-
+
private void setupFileCleanup() {
file.deleteOnExit();
Runtime.getRuntime().addShutdownHook(new Thread() {
@@ -84,7 +84,7 @@ public class SingletonInstanceFileLock extends SingletonInstance {
}
unlock();
}
- });
+ });
}
@Override
diff --git a/src/java/jogamp/common/util/locks/SingletonInstanceServerSocket.java b/src/java/jogamp/common/util/locks/SingletonInstanceServerSocket.java
index c4f9564..a1ca2ff 100644
--- a/src/java/jogamp/common/util/locks/SingletonInstanceServerSocket.java
+++ b/src/java/jogamp/common/util/locks/SingletonInstanceServerSocket.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.
*/
-
+
package jogamp.common.util.locks;
import java.io.IOException;
@@ -39,11 +39,11 @@ public class SingletonInstanceServerSocket extends SingletonInstance {
private final Server singletonServer;
private final String fullName;
-
+
public SingletonInstanceServerSocket(long poll_ms, int portNumber) {
super(poll_ms);
-
- // Gather the local InetAddress, loopback is prioritized
+
+ // Gather the local InetAddress, loopback is prioritized
InetAddress ilh = null;
try {
ilh = InetAddress.getByName(null); // loopback
@@ -56,10 +56,10 @@ public class SingletonInstanceServerSocket extends SingletonInstance {
}
if(null == ilh) {
try {
- ilh = InetAddress.getByAddress(new byte[] { 127, 0, 0, 1 } );
+ ilh = InetAddress.getByAddress(new byte[] { 127, 0, 0, 1 } );
if(null!=ilh && !ilh.isLoopbackAddress()) { ilh = null; }
} catch (UnknownHostException e) { }
- }
+ }
if(null == ilh) {
try {
ilh = InetAddress.getLocalHost();
@@ -68,15 +68,15 @@ public class SingletonInstanceServerSocket extends SingletonInstance {
if(null == ilh) {
throw new RuntimeException(infoPrefix()+" EEE Could not determine local InetAddress");
}
-
+
fullName = ilh.toString()+":"+portNumber;
- singletonServer = new Server(ilh, portNumber);
+ singletonServer = new Server(ilh, portNumber);
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
singletonServer.kill();
}
- });
+ });
}
public final InetAddress getLocalInetAddress() {
@@ -89,13 +89,13 @@ public class SingletonInstanceServerSocket extends SingletonInstance {
@Override
public final String getName() { return fullName; }
-
+
@Override
protected boolean tryLockImpl() {
if( singletonServer.isRunning() ) {
return false; // same JVM .. server socket already installed !
}
-
+
// check if other JVM's locked the server socket ..
Socket clientSocket = singletonServer.connect();
if(null != clientSocket) {
@@ -104,11 +104,11 @@ public class SingletonInstanceServerSocket extends SingletonInstance {
} catch (IOException e) { }
return false;
}
-
+
if( !singletonServer.start() ) {
return false;
}
-
+
return true;
}
@@ -119,26 +119,26 @@ public class SingletonInstanceServerSocket extends SingletonInstance {
public class Server implements Runnable {
private final InetAddress localInetAddress;
- private final int portNumber;
-
- private volatile boolean shallQuit = false;
+ private final int portNumber;
+
+ private volatile boolean shallQuit = false;
private volatile boolean alive = false;
-
+
private Object syncOnStartStop = new Object();
private ServerSocket serverSocket = null;
private Thread serverThread = null; // allowing kill() to force-stop last server-thread
-
+
public Server(InetAddress localInetAddress, int portNumber) {
this.localInetAddress = localInetAddress;
this.portNumber = portNumber;
}
-
+
public final InetAddress getLocalInetAddress() { return localInetAddress; }
public final int getPortNumber() { return portNumber; }
-
+
public final boolean start() {
if(alive) return true;
-
+
synchronized (syncOnStartStop) {
serverThread = new Thread(this);
serverThread.setDaemon(true); // be a daemon, don't keep the JVM running
@@ -147,7 +147,7 @@ public class SingletonInstanceServerSocket extends SingletonInstance {
syncOnStartStop.wait();
} catch (InterruptedException ie) {
ie.printStackTrace();
- }
+ }
}
boolean ok = isBound();
if(!ok) {
@@ -155,10 +155,10 @@ public class SingletonInstanceServerSocket extends SingletonInstance {
}
return ok;
}
-
+
public final boolean shutdown() {
if(!alive) return true;
-
+
synchronized (syncOnStartStop) {
shallQuit = true;
connect();
@@ -166,7 +166,7 @@ public class SingletonInstanceServerSocket extends SingletonInstance {
syncOnStartStop.wait();
} catch (InterruptedException ie) {
ie.printStackTrace();
- }
+ }
}
if(alive) {
System.err.println(infoPrefix()+" EEE "+getName()+" - Unable to remove lock: ServerThread still alive ?");
@@ -175,7 +175,7 @@ public class SingletonInstanceServerSocket extends SingletonInstance {
return true;
}
- /**
+ /**
* Brutally kill server thread and close socket regardless.
* This is out last chance for JVM shutdown.
*/
@@ -196,11 +196,11 @@ public class SingletonInstanceServerSocket extends SingletonInstance {
serverSocket = null;
ss.close();
} catch (Throwable t) { }
- }
+ }
}
-
+
public final boolean isRunning() { return alive; }
-
+
public final boolean isBound() {
return alive && null != serverSocket && serverSocket.isBound() ;
}
@@ -211,14 +211,14 @@ public class SingletonInstanceServerSocket extends SingletonInstance {
} catch (Exception e) { }
return null;
}
-
+
@Override
public void run() {
{
final Thread currentThread = Thread.currentThread();
currentThread.setName(currentThread.getName() + " - SISock: "+getName());
if(DEBUG) {
- System.err.println(currentThread.getName()+" - started");
+ System.err.println(currentThread.getName()+" - started");
}
}
alive = false;
@@ -231,10 +231,10 @@ public class SingletonInstanceServerSocket extends SingletonInstance {
System.err.println(infoPrefix()+" III - Unable to install ServerSocket: "+e.getMessage());
shallQuit = true;
} finally {
- syncOnStartStop.notifyAll();
+ syncOnStartStop.notifyAll();
}
}
-
+
while (!shallQuit) {
try {
final Socket clientSocket = serverSocket.accept();
@@ -243,7 +243,7 @@ public class SingletonInstanceServerSocket extends SingletonInstance {
System.err.println(infoPrefix()+" EEE - Exception during accept: " + ioe.getMessage());
}
}
-
+
synchronized (syncOnStartStop) {
try {
if(null != serverSocket) {
--
cgit v1.2.3