aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmake/Manifest-rt-cdc3
-rwxr-xr-xmake/build.xml25
-rwxr-xr-xsrc/java/com/sun/gluegen/runtime/PointerBuffer.java.javame_cdc_fp2
-rwxr-xr-xsrc/java/com/sun/gluegen/runtime/PointerBuffer.java.javase2
-rw-r--r--src/java/com/sun/gluegen/test/TestPointerBufferEndian.java (renamed from test/TestPointerBufferEndian.java)2
-rw-r--r--src/java/com/sun/gluegen/test/TestStructAccessorEndian.java (renamed from test/TestStructAccessorEndian.java)16
6 files changed, 32 insertions, 18 deletions
diff --git a/make/Manifest-rt-cdc b/make/Manifest-rt-cdc
new file mode 100755
index 0000000..72095c0
--- /dev/null
+++ b/make/Manifest-rt-cdc
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Implementation-Title: GlueGen Run-Time CDC
+Implementation-Version: @BASEVERSION@
diff --git a/make/build.xml b/make/build.xml
index 90319d6..0c56729 100755
--- a/make/build.xml
+++ b/make/build.xml
@@ -50,9 +50,9 @@
</target>
<target name="setup.javacdc">
- <copy file="../src/java/com/sun/gluegen/runtime/BufferFactory.java.javame_cdc_fp" tofile="${src.generated-cdc.java}/com/sun/gluegen/runtime/BufferFactory.java" />
- <copy file="../src/java/com/sun/gluegen/runtime/StructAccessor.java.javame_cdc_fp" tofile="${src.generated-cdc.java}/com/sun/gluegen/runtime/StructAccessor.java" />
- <copy file="../src/java/com/sun/gluegen/runtime/PointerBuffer.java.javame_cdc_fp" tofile="${src.generated-cdc.java}/com/sun/gluegen/runtime/PointerBuffer.java" />
+ <copy file="../src/java/com/sun/gluegen/runtime/BufferFactory.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/sun/gluegen/runtime/BufferFactory.java" />
+ <copy file="../src/java/com/sun/gluegen/runtime/StructAccessor.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/sun/gluegen/runtime/StructAccessor.java" />
+ <copy file="../src/java/com/sun/gluegen/runtime/PointerBuffer.java.javame_cdc_fp" tofile="${src.generated.java-cdc}/com/sun/gluegen/runtime/PointerBuffer.java" />
</target>
<target name="init" depends="load.user.properties,setup-excludes-1,setup-excludes-2">
@@ -66,9 +66,8 @@
<!-- The generated source directories. -->
<property name="src.generated" value="${build}/gensrc" />
- <property name="src.generated-cdc" value="${build}/gensrc-cdc" />
<property name="src.generated.java" value="${src.generated}/java" />
- <property name="src.generated-cdc.java" value="${src.generated-cdc}/java" />
+ <property name="src.generated.java-cdc" value="${src.generated}/java-cdc" />
<!-- The compiler output directories. -->
<property name="classes" value="${build}/classes" />
@@ -79,11 +78,11 @@
<!-- Create the required output directories. -->
<mkdir dir="${src.generated.java}" />
- <mkdir dir="${src.generated-cdc.java}" />
+ <mkdir dir="${src.generated.java-cdc}" />
<mkdir dir="${classes}" />
<mkdir dir="${classes-cdc}" />
- <!-- Set up compilation for either Java SE or Java CDC -->
+ <!-- Set up Java SE and Java CDC files -->
<antcall target="setup.javase" inheritRefs="true" />
<antcall target="setup.javacdc" inheritRefs="true" />
@@ -427,7 +426,7 @@
excludes="${gluegen.excludes}"
bootclasspath="${javac.bootclasspath-cdc.jar}">
<src path="${src.java}" />
- <src path="${src.generated-cdc.java}" />
+ <src path="${src.generated.java-cdc}" />
<classpath refid="antlr.classpath" />
</javac>
</target>
@@ -511,6 +510,14 @@
</filterset>
</copy>
+ <copy file="Manifest-rt-cdc"
+ tofile="${build}/Manifest-rt-cdc.temp"
+ overwrite="true">
+ <filterset>
+ <filter token="BASEVERSION" value="${gluegen_base_version}"/>
+ </filterset>
+ </copy>
+
<!-- Build gluegen-rt.jar. -->
<jar destfile="${build}/gluegen-rt.jar" manifest="${build}/Manifest-rt.temp">
<fileset dir="${classes}">
@@ -528,7 +535,7 @@
<antcall target="gluegen.build.gluegen-rt-cdc" inheritRefs="true" />
<!-- Build gluegen-rt-cdc.jar. -->
- <jar destfile="${build}/gluegen-rt-cdc.jar" manifest="${build}/Manifest-rt.temp">
+ <jar destfile="${build}/gluegen-rt-cdc.jar" manifest="${build}/Manifest-rt-cdc.temp">
<fileset dir="${classes-cdc}">
<include name="com/sun/gluegen/runtime/*.class" />
<include name="com/sun/gluegen/runtime/opengl/*.class" />
diff --git a/src/java/com/sun/gluegen/runtime/PointerBuffer.java.javame_cdc_fp b/src/java/com/sun/gluegen/runtime/PointerBuffer.java.javame_cdc_fp
index 14a3d34..4ab666c 100755
--- a/src/java/com/sun/gluegen/runtime/PointerBuffer.java.javame_cdc_fp
+++ b/src/java/com/sun/gluegen/runtime/PointerBuffer.java.javame_cdc_fp
@@ -88,7 +88,7 @@ public class PointerBuffer {
}
public static PointerBuffer allocateDirect(int size) {
- return new PointerBuffer(BufferFactory.newDirectByteBuffer(size));
+ return new PointerBuffer(BufferFactory.newDirectByteBuffer(BufferFactory.SIZEOF_LONG * size));
}
public static PointerBuffer wrap(ByteBuffer src) {
diff --git a/src/java/com/sun/gluegen/runtime/PointerBuffer.java.javase b/src/java/com/sun/gluegen/runtime/PointerBuffer.java.javase
index 88531e8..4957b17 100755
--- a/src/java/com/sun/gluegen/runtime/PointerBuffer.java.javase
+++ b/src/java/com/sun/gluegen/runtime/PointerBuffer.java.javase
@@ -88,7 +88,7 @@ public class PointerBuffer {
}
public static PointerBuffer allocateDirect(int size) {
- return new PointerBuffer(BufferFactory.newDirectByteBuffer(size));
+ return new PointerBuffer(BufferFactory.newDirectByteBuffer(BufferFactory.SIZEOF_LONG * size));
}
public static PointerBuffer wrap(ByteBuffer src) {
diff --git a/test/TestPointerBufferEndian.java b/src/java/com/sun/gluegen/test/TestPointerBufferEndian.java
index 43eda84..973c89d 100644
--- a/test/TestPointerBufferEndian.java
+++ b/src/java/com/sun/gluegen/test/TestPointerBufferEndian.java
@@ -1,4 +1,6 @@
+package com.sun.gluegen.test;
+
import com.sun.gluegen.runtime.*;
import java.nio.*;
diff --git a/test/TestStructAccessorEndian.java b/src/java/com/sun/gluegen/test/TestStructAccessorEndian.java
index 9d294ed..13d7afb 100644
--- a/test/TestStructAccessorEndian.java
+++ b/src/java/com/sun/gluegen/test/TestStructAccessorEndian.java
@@ -1,28 +1,30 @@
+package com.sun.gluegen.test;
+
import com.sun.gluegen.runtime.*;
import java.nio.*;
public class TestStructAccessorEndian {
public static void main (String args[]) {
boolean ok = true;
- System.out.println("CPU is : "+ (CPU.isLittleEndian()?"little":"big") + " endian");
+ System.out.println("CPU is : "+ (BufferFactory.isLittleEndian()?"little":"big") + " endian");
ByteBuffer tst = BufferFactory.newDirectByteBuffer(BufferFactory.SIZEOF_LONG * 3);
StructAccessor acc = new StructAccessor(tst);
- acc.setLongAt(0, 0x0123456789ABCDEF);
- acc.setLongAt(1, 0x8877665544332211);
- acc.setLongAt(2, 0xAFFEDEADBEEFAFFE);
+ acc.setLongAt(0, 0x0123456789ABCDEFL);
+ acc.setLongAt(1, 0x8877665544332211L);
+ acc.setLongAt(2, 0xAFFEDEADBEEFAFFEL);
long v = acc.getLongAt(0);
- if( 0x0123456789ABCDEF != v ) {
+ if( 0x0123456789ABCDEFL != v ) {
System.out.println("Err[0] shall 0x0123456789ABCDEF, is: "+Long.toHexString(v));
ok=false;
}
v = acc.getLongAt(1);
- if( 0x8877665544332211 != v ) {
+ if( 0x8877665544332211L != v ) {
System.out.println("Err[1] shall 0x8877665544332211, is: "+Long.toHexString(v));
ok=false;
}
v = acc.getLongAt(2);
- if( 0xAFFEDEADBEEFAFFE != v ) {
+ if( 0xAFFEDEADBEEFAFFEL != v ) {
System.out.println("Err[2] shall 0xAFFEDEADBEEFAFFE, is: "+Long.toHexString(v));
ok=false;
}