summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2005-04-04 18:34:03 +0000
committerKenneth Russel <[email protected]>2005-04-04 18:34:03 +0000
commit57b593f06e39e92b4c41b12e53862ca30e8a41bf (patch)
tree9b25572d6a38b85a5cd9c10146022bd3cbc47297 /src
parentfae5b8514077f35d5bda856d6f8418d37249554e (diff)
Fixed Issue 154: Patches for build problems
Submitted patches had a couple of problems. First, the removal of the (incorrect) cast to const char* in the CMethodBindingEmitter caused build warnings on other platforms. Fixed these by making the const declarations correct for the conversion case of String[] -> char**. Second, addition of comparison of hashCodes in CompoundType.equals() seemed like too much of a hack. Fixed this by correcting potential problems in equals() and hashCode() methods; not sure whether this will solve the submitter's original problem, though. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@254 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src')
-rw-r--r--src/net/java/games/gluegen/CMethodBindingEmitter.java6
-rw-r--r--src/net/java/games/gluegen/cgram/types/CompoundType.java7
2 files changed, 7 insertions, 6 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/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