diff options
author | Harvey Harrison <[email protected]> | 2013-10-17 21:06:56 -0700 |
---|---|---|
committer | Harvey Harrison <[email protected]> | 2013-10-17 21:06:56 -0700 |
commit | 791a2749886f02ec7b8db25bf8862e8269b96da5 (patch) | |
tree | c9be31d0bbbe8033b4a6a0cfad91a22b6575ced1 /src/java/com/jogamp/common/os | |
parent | 5b77e15500b7b19d35976603dd71e8b997b2d8ea (diff) |
gluegen: remove trailing whitespace
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src/java/com/jogamp/common/os')
-rw-r--r-- | src/java/com/jogamp/common/os/AndroidVersion.java | 28 | ||||
-rw-r--r-- | src/java/com/jogamp/common/os/DynamicLibraryBundle.java | 58 | ||||
-rw-r--r-- | src/java/com/jogamp/common/os/DynamicLibraryBundleInfo.java | 40 | ||||
-rw-r--r-- | src/java/com/jogamp/common/os/DynamicLinker.java | 36 | ||||
-rw-r--r-- | src/java/com/jogamp/common/os/DynamicLookupHelper.java | 20 | ||||
-rw-r--r-- | src/java/com/jogamp/common/os/MachineDescription.java | 82 | ||||
-rw-r--r-- | src/java/com/jogamp/common/os/NativeLibrary.java | 58 | ||||
-rw-r--r-- | src/java/com/jogamp/common/os/Platform.java | 148 |
8 files changed, 235 insertions, 235 deletions
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; * <li>The JNI glue-code native library, eg jogl_desktop.dll. From here on this is referred as the Glue</li> * </ul> * <p> - * 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. * </p> @@ -65,7 +65,7 @@ public class DynamicLibraryBundle implements DynamicLookupHelper { private final List<List<String>> toolLibNames; private final List<String> glueLibNames; private final boolean[] toolLibLoaded; - + private int toolLibLoadedNumber; private final boolean[] glueLibLoaded; @@ -76,15 +76,15 @@ public class DynamicLibraryBundle implements DynamicLookupHelper { private HashSet<String> toolGetProcAddressFuncNameSet; private List<String> 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. * <p> - * 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. * </p> */ @@ -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<String>(toolGetProcAddressFuncNameList); toolGetProcAddressHandle = getToolGetProcAddressHandle(); - toolGetProcAddressComplete = 0 != toolGetProcAddressHandle; + toolGetProcAddressComplete = 0 != toolGetProcAddressHandle; } else { toolGetProcAddressFuncNameSet = new HashSet<String>(); 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<String> 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<String> 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.<br> * <ul> * <li>GL/GLU example Unix: [ [ "libGL.so.1", "libGL.so", "GL" ], [ "libGLU.so", "GLU" ] ] </li> @@ -49,10 +49,10 @@ public interface DynamicLibraryBundleInfo { */ public List<List<String>> getToolLibNames(); - /** + /** * If a {@link SecurityManager} is installed, user needs link permissions * for the named libraries. - * + * * @return a list of Glue library names.<br> * <ul> * <li>GL: [ "nativewindow_x11", "jogl_gl2es12", "jogl_desktop" ] </li> @@ -64,15 +64,15 @@ public interface DynamicLibraryBundleInfo { */ public List<String> getGlueLibNames(); - /** + /** * May return the native libraries <pre>GetProcAddressFunc</pre> names, the first found function is being used.<br> * This could be eg: <pre> glXGetProcAddressARB, glXGetProcAddressARB </pre>.<br> * If your Tool does not has this facility, just return null. * @see #toolGetProcAddress(long, String) */ - public List<String> getToolGetProcAddressFuncNameList() ; + public List<String> getToolGetProcAddressFuncNameList() ; - /** + /** * May implement the lookup function using the Tools facility.<br> * The actual function pointer is provided to allow proper bootstrapping of the ProcAddressTable, * using one of the provided function names by {@link #getToolGetProcAddressFuncNameList()}.<br> @@ -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 <b>true</b>. */ @@ -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 <code>true</code> <i>and</i> if a {@link SecurityManager} is installed, user needs link permissions * for <b>all</b> libraries, i.e. for <code>new RuntimePermission("loadLibrary.*");</code>! - * - * @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 <code>tool</code> and <code>glue</code> native libraries. * <p> - * This allows the generic {@link DynamicLibraryBundle} implementation to + * This allows the generic {@link DynamicLibraryBundle} implementation to * load the native libraries on a designated thread. * </p> * <p> 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 { * <p> * Opens the named library, allowing system wide access for other <i>users</i>. * </p> - * + * * @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 { * <p> * Opens the named library, restricting access to this process. * </p> - * + * * @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 <b>all</b> libraries, i.e. for <code>new RuntimePermission("loadLibrary.*");</code>! - * + * * @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 <code>librarHandle</code>. - * + * * @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 <code>libraryHandle</code> 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 <code>librarHandle</code>. - * + * * @param libraryHandle a library handle previously retrieved via {@link #openLibraryLocal(String, boolean)} or {@link #openLibraryGlobal(String, boolean)}. * @throws IllegalArgumentException in case case <code>libraryHandle</code> 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 <br> - * - * @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<prefixes.length && 0 > prefixIdx; i++) { + for(int i=0; i<prefixes.length && 0 > 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<prefixes.length && 0 > prefixIdx; i++) { + for(int i=0; i<prefixes.length && 0 > 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. * <p> * 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()}, ..<br> * This mechanism is preferred in this case to avoid synchronization and locking @@ -56,20 +56,20 @@ import jogamp.common.os.PlatformPropsImpl; * </p> */ 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; - + /** <code>true</code> if AWT is available and not in headless mode, otherwise <code>false</code>. */ 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<Object>() { + + AccessController.doPrivileged(new PrivilegedAction<Object>() { public Object run() { - + PlatformPropsImpl.initSingleton(); // documenting the order of static initialization - + final ClassLoader cl = Platform.class.getClassLoader(); - + final URI platformClassJarURI; { URI _platformClassJarURI = null; @@ -185,11 +185,11 @@ public class Platform extends PlatformPropsImpl { } catch (Exception e) { } platformClassJarURI = _platformClassJarURI; } - _isRunningFromJarURL[0] = null != platformClassJarURI; - + _isRunningFromJarURL[0] = null != platformClassJarURI; + _USE_TEMP_JAR_CACHE[0] = ( OS_TYPE != OSType.ANDROID ) && ( null != platformClassJarURI ) && Debug.getBooleanProperty(useTempJarCachePropName, true, true); - + // load GluegenRT native library if(_USE_TEMP_JAR_CACHE[0] && TempJarCache.initSingleton()) { try { @@ -200,13 +200,13 @@ public class Platform extends PlatformPropsImpl { } } DynamicLibraryBundle.GlueJNILibLoader.loadLibrary(libBaseName, false, cl); - + // JVM bug workaround JVMUtil.initSingleton(); // requires gluegen-rt, one-time init. - + // AWT Headless determination if( !Debug.getBooleanProperty("java.awt.headless", true) && - ReflectionUtil.isClassAvailable(ReflectionUtil.AWTNames.ComponentClass, cl) && + ReflectionUtil.isClassAvailable(ReflectionUtil.AWTNames.ComponentClass, cl) && ReflectionUtil.isClassAvailable(ReflectionUtil.AWTNames.GraphicsEnvironmentClass, cl) ) { try { _AWT_AVAILABLE[0] = false == ((Boolean)ReflectionUtil.callStaticMethod(ReflectionUtil.AWTNames.GraphicsEnvironmentClass, ReflectionUtil.AWTNames.isHeadlessMethod, null, null, cl)).booleanValue(); @@ -217,7 +217,7 @@ public class Platform extends PlatformPropsImpl { isRunningFromJarURL = _isRunningFromJarURL[0]; USE_TEMP_JAR_CACHE = _USE_TEMP_JAR_CACHE[0]; AWT_AVAILABLE = _AWT_AVAILABLE[0]; - + MachineDescription md = MachineDescriptionRuntime.getRuntime(); if(null == md) { MachineDescription.StaticConfig smd = MachineDescriptionRuntime.getStatic(); @@ -232,7 +232,7 @@ public class Platform extends PlatformPropsImpl { } } machineDescription = md; - is32Bit = machineDescription.is32Bit(); + is32Bit = machineDescription.is32Bit(); } private Platform() {} @@ -240,15 +240,15 @@ public class Platform extends PlatformPropsImpl { /** * @return true if we're running from a Jar URL, otherwise false */ - public static final boolean isRunningFromJarURL() { + public static final boolean isRunningFromJarURL() { return isRunningFromJarURL; } - + /** * kick off static initialization of <i>platform property information</i> and <i>native gluegen-rt lib loading</i> */ - public static void initSingleton() { } - + public static void initSingleton() { } + /** * Returns true only if having {@link java.nio.LongBuffer} and {@link java.nio.DoubleBuffer} available. */ @@ -263,12 +263,12 @@ public class Platform extends PlatformPropsImpl { * </p> * <p> * <i>Note</i>: We claim Android is compatible. - * </p> + * </p> */ public static boolean isJava6() { return JAVA_6; } - + /** * Returns true if this machine is little endian, otherwise false. */ @@ -283,7 +283,7 @@ public class Platform extends PlatformPropsImpl { public static String getOSName() { return OS; } - + /** * Returns the OS version. */ @@ -312,38 +312,38 @@ public class Platform extends PlatformPropsImpl { public static OSType getOSType() { return OS_TYPE; } - + /** * Returns the CPU type. */ public static CPUFamily getCPUFamily() { return CPU_ARCH.getFamily(); } - + /** * Returns the CPU architecture. */ public static CPUType getCPUType() { return CPU_ARCH; } - + /** * Returns the (guessed) ABI. */ public static ABIType getABIType() { return ABI_TYPE; } - + /** * Returns the GlueGen common name for the currently running OSType and CPUType * as implemented in the build system in 'gluegen-cpptasks-base.xml'.<br> - * + * * @see #getOSAndArch(OSType, CPUType) */ public static String getOSAndArch() { return os_and_arch; } - + /** * Returns the JAVA vendor. */ @@ -357,14 +357,14 @@ public class Platform extends PlatformPropsImpl { public static String getJavaVMName() { return JAVA_VM_NAME; } - + /** * Returns the JAVA runtime name. */ public static String getJavaRuntimeName() { return JAVA_RUNTIME_NAME; } - + /** * Returns the JAVA vendor url. */ @@ -417,7 +417,7 @@ public class Platform extends PlatformPropsImpl { public static MachineDescription getMachineDescription() { return machineDescription; } - + /** Returns <code>true</code> if AWT is available and not in headless mode, otherwise <code>false</code>. */ public static boolean isAWTAvailable() { return AWT_AVAILABLE; @@ -426,23 +426,23 @@ public class Platform extends PlatformPropsImpl { // // time / jitter // - - /** + + /** * Returns the unix based current time in milliseconds, based on <code>gettimeofday(..)</code>. * <p> * This is an alternative to {@link System#currentTimeMillis()} and {@link System#nanoTime()}. - * While the named {@link System} methods do provide the required precision, + * While the named {@link System} methods do provide the required precision, * <code>gettimeofday()</code> <i>also</i> guarantees time accuracy, i.e. update interval. * </p> * @see #currentTimeMicros() */ public static native long currentTimeMillis(); - - /** + + /** * Returns the unix based current time in microseconds, based on <code>gettimeofday(..)</code>. * <p> * This is an alternative to {@link System#currentTimeMillis()} and {@link System#nanoTime()}. - * While the named {@link System} methods do provide the required precision, + * While the named {@link System} methods do provide the required precision, * <code>gettimeofday()</code> <i>also</i> guarantees time accuracy, i.e. update interval. * </p> * @see #currentTimeMillis() @@ -458,7 +458,7 @@ public class Platform extends PlatformPropsImpl { public static synchronized long getCurrentSleepJitter() { getCurrentSleepJitterImpl(TimeUnit.MILLISECONDS.toNanos(10), 10); // warm-up return getCurrentSleepJitterImpl(TimeUnit.MILLISECONDS.toNanos(10), 10); - } + } private static long getCurrentSleepJitterImpl(final long nsDuration, final int splitInLoops) { final long nsPeriod = nsDuration / splitInLoops; final long t0_ns = System.nanoTime(); |