I'm committing the attached patch which fixes the -Werror
build of the new VMURLConnection code.  Unused parameters are
now marked as such.  This also entails changing the check_jni_methods
script slightly, so that one declaration in the header file matches
up with an arbitrary number in the implementation (as there are now
two function declarations, one when MAGIC.H is present and one when not).

Changelog:

2006-05-26  Andrew John Hughes  <[EMAIL PROTECTED]>

        * native/jni/java-net/java_net_VMURLConnection.c:
        Fix function declarations to specify unused parameters.
        * scripts/check_jni_methods.sh:
        Remove copies of the same function using uniq.

-- 
Andrew :-)

Please avoid sending me Microsoft Office (e.g. Word, PowerPoint) attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html

If you use Microsoft Office, support movement towards the end of vendor lock-in:
http://opendocumentfellowship.org/petition/

"Value your freedom, or you will lose it, teaches history. 
`Don't bother us with politics' respond those who don't want to learn." 
-- Richard Stallman

Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html
public class gcj extends Freedom implements Java { ... }
Index: native/jni/java-net/java_net_VMURLConnection.c
===================================================================
RCS file: 
/cvsroot/classpath/classpath/native/jni/java-net/java_net_VMURLConnection.c,v
retrieving revision 1.1
diff -u -3 -p -u -r1.1 java_net_VMURLConnection.c
--- native/jni/java-net/java_net_VMURLConnection.c      27 May 2006 02:05:43 
-0000      1.1
+++ native/jni/java-net/java_net_VMURLConnection.c      27 May 2006 18:18:20 
-0000
@@ -48,7 +48,8 @@ static magic_t cookie;
 #endif /* HAVE_MAGIC_H */
 
 void
-Java_java_net_VMURLConnection_init (JNIEnv *env, jclass klass)
+Java_java_net_VMURLConnection_init (JNIEnv *env __attribute__ ((__unused__)),
+                                   jclass klass __attribute__ ((__unused__)))
 {
 #ifdef HAVE_MAGIC_H
   cookie = magic_open (MAGIC_MIME);
@@ -62,13 +63,14 @@ Java_java_net_VMURLConnection_init (JNIE
 #endif /* HAVE_MAGIC_H */
 }
 
+#ifdef HAVE_MAGIC_H
 jstring
 Java_java_net_VMURLConnection_guessContentTypeFromBuffer (JNIEnv *env,
-                                                         jclass klass,
+                                                         jclass klass
+                                                         __attribute__ 
((__unused__)),
                                                          jbyteArray bytes,
                                                          jint valid)
 {
-#ifdef HAVE_MAGIC_H
   jbyte *elements;
   const char *result;
 
@@ -85,6 +87,16 @@ Java_java_net_VMURLConnection_guessConte
     return NULL;
   return (*env)->NewStringUTF (env, result);
 #else
+jstring
+Java_java_net_VMURLConnection_guessContentTypeFromBuffer (JNIEnv *env
+                                                         __attribute__ 
((__unused__)),
+                                                         jclass klass
+                                                         __attribute__ 
((__unused__)),
+                                                         jbyteArray bytes
+                                                         __attribute__ 
((__unused__)),
+                                                         jint valid
+                                                         __attribute__ 
((__unused__)))
+{
   return NULL;
 #endif /* HAVE_MAGIC_H */
 }
Index: scripts/check_jni_methods.sh
===================================================================
RCS file: /cvsroot/classpath/classpath/scripts/check_jni_methods.sh,v
retrieving revision 1.10
diff -u -3 -p -u -r1.10 check_jni_methods.sh
--- scripts/check_jni_methods.sh        5 Sep 2005 18:46:16 -0000       1.10
+++ scripts/check_jni_methods.sh        27 May 2006 18:18:20 -0000
@@ -29,7 +29,7 @@ find native/jni -name \*.cpp | \
        cut -f4 -d\  | \
         LC_ALL=C sed -e 's,^\JNIEXPORT .* JNICALL \(Java_[a-z_A-Z0-9]*\) 
*(.*$,\1,' >> $TMPFILE2
 mv $TMPFILE2 $TMPFILE3
-sort $TMPFILE3 > $TMPFILE2
+sort $TMPFILE3 | uniq > $TMPFILE2
 rm $TMPFILE3
 
 # Write temporary ignore file.

Attachment: signature.asc
Description: Digital signature

Reply via email to