aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/games/gluegen
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/java/games/gluegen')
-rw-r--r--src/net/java/games/gluegen/CMethodBindingEmitter.java6
-rw-r--r--src/net/java/games/gluegen/GlueGen.java3
-rw-r--r--src/net/java/games/gluegen/StructLayout.java1
-rw-r--r--src/net/java/games/gluegen/cgram/types/CompoundType.java7
4 files changed, 10 insertions, 7 deletions
diff --git a/src/net/java/games/gluegen/CMethodBindingEmitter.java b/src/net/java/games/gluegen/CMethodBindingEmitter.java
index b9cc0091e..8abcdcd78 100644
--- a/src/net/java/games/gluegen/CMethodBindingEmitter.java
+++ b/src/net/java/games/gluegen/CMethodBindingEmitter.java
@@ -609,7 +609,7 @@ public class CMethodBindingEmitter extends FunctionEmitter
writer.print(" ");
emitGetStringUTFChars(writer,
"(jstring) _tmpObj",
- "(const char*)"+convName+"_copy[_copyIndex]");
+ convName+"_copy[_copyIndex]");
}
else if (isNIOBufferClass(subArrayElementJavaType))
{
@@ -781,7 +781,7 @@ public class CMethodBindingEmitter extends FunctionEmitter
}
// free the main array
- writer.print(" free(");
+ writer.print(" free((void*) ");
writer.print(convName+"_copy");
writer.println(");");
} // end of cleaning up copied data
@@ -1251,7 +1251,7 @@ public class CMethodBindingEmitter extends FunctionEmitter
Class elementType = javaType.getJavaClass().getComponentType();
if (javaType.isArray() &&
javaType.getJavaClass().getComponentType() == java.lang.String.class) {
- writer.print(" char **");
+ writer.print(" const char **");
} else {
writer.print(ptrTypeString);
}
diff --git a/src/net/java/games/gluegen/GlueGen.java b/src/net/java/games/gluegen/GlueGen.java
index 6c343a5ee..1197741cb 100644
--- a/src/net/java/games/gluegen/GlueGen.java
+++ b/src/net/java/games/gluegen/GlueGen.java
@@ -144,7 +144,8 @@ public class GlueGen implements GlueEmitterControls {
MachineDescription machDesc;
String os = System.getProperty("os.name").toLowerCase();
String cpu = System.getProperty("os.arch").toLowerCase();
- if (os.startsWith("linux") && cpu.equals("amd64")) {
+ if ((os.startsWith("linux") && cpu.equals("amd64")) ||
+ (os.startsWith("linux") && cpu.equals("ia64"))) {
machDesc = new MachineDescription64Bit();
} else {
machDesc = new MachineDescription32Bit();
diff --git a/src/net/java/games/gluegen/StructLayout.java b/src/net/java/games/gluegen/StructLayout.java
index ebbace6b5..df612c3b5 100644
--- a/src/net/java/games/gluegen/StructLayout.java
+++ b/src/net/java/games/gluegen/StructLayout.java
@@ -124,6 +124,7 @@ public class StructLayout {
if ((os.startsWith("windows") && cpu.equals("x86")) ||
(os.startsWith("linux") && cpu.equals("i386")) ||
(os.startsWith("linux") && cpu.equals("amd64")) ||
+ (os.startsWith("linux") && cpu.equals("ia64")) ||
(os.startsWith("sunos") && cpu.equals("sparc")) ||
(os.startsWith("sunos") && cpu.equals("x86")) ||
(os.startsWith("mac os") && cpu.equals("ppc")) ||
diff --git a/src/net/java/games/gluegen/cgram/types/CompoundType.java b/src/net/java/games/gluegen/cgram/types/CompoundType.java
index d86fa9148..e57400e33 100644
--- a/src/net/java/games/gluegen/cgram/types/CompoundType.java
+++ b/src/net/java/games/gluegen/cgram/types/CompoundType.java
@@ -76,7 +76,7 @@ public class CompoundType extends Type {
} else if (getName() != null) {
hashcode = getName().hashCode();
} else {
- hashcode = System.identityHashCode(this);
+ hashcode = 0;
}
computedHashcode = true;
@@ -90,8 +90,9 @@ public class CompoundType extends Type {
}
CompoundType t = (CompoundType) arg;
return (super.equals(arg) &&
- kind == t.kind &&
- listsEqual(fields, t.fields));
+ (structName == t.structName || (structName != null && structName.equals(t.structName))) &&
+ kind == t.kind &&
+ listsEqual(fields, t.fields));
}
/** Returns the struct name of this CompoundType, i.e. the "foo" in