From 57b593f06e39e92b4c41b12e53862ca30e8a41bf Mon Sep 17 00:00:00 2001
From: Kenneth Russel <kbrussel@alum.mit.edu>
Date: Mon, 4 Apr 2005 18:34:03 +0000
Subject: 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
---
 src/net/java/games/gluegen/CMethodBindingEmitter.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/net/java/games/gluegen/CMethodBindingEmitter.java')

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);
       }
-- 
cgit v1.2.3