classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] Fix pkg check detection and add some C compiler warnings


From: Mark Wielaard
Subject: [cp-patches] Fix pkg check detection and add some C compiler warnings
Date: Sun, 02 Jan 2005 14:49:57 +0100

Hi,

I made a small mistake in the pkg check macros that detect the correct
version of libxml2 and libxslt. This fix should detect whether the
correct versions are installed on all systems (note that we do need very
recent versions, that is why --enable-xmlj is not on by default).

C code in GNU Classpath is normally compiled with as many compiler as
possible and when configure is given the --enable-Werror flag those
warnings are turned into compiler failures. That is the default on some
autobuilders. I fixed a couple of easy ones, but not all. So
ERROR_CFLAGS is turned off by default for the native/jni/xmlj directory.
I would like to fix all issues and turn it on in the future (after 0.13
is released).

2005-01-02  Mark Wielaard  <address@hidden>

        * configure.ac: Fix pkg checks for libxml-2.0 and libxslt.
        * native/jni/xmlj/Makefile.am (AM_CFLAGS): Add STRICT_WARNING_CFLAGS
        but disable ERROR_CFLAGS.
        * native/jni/xmlj/xmlj_dom.c: Add __attribute__ ((__unused__)) where
        obvious.
        * native/jni/xmlj/xmlj_sax.c: Likewise.
        * native/jni/xmlj/xmlj_transform.c: Likewise.
        * native/jni/xmlj/xmlj_xpath.c: Likewise.

Committed,

Mark
Index: configure.ac
===================================================================
RCS file: /cvsroot/classpath/classpath/configure.ac,v
retrieving revision 1.64
diff -u -r1.64 configure.ac
--- configure.ac        29 Dec 2004 21:39:36 -0000      1.64
+++ configure.ac        2 Jan 2005 13:39:05 -0000
@@ -214,8 +214,8 @@
   dnl Check for libxml and libxslt libraries (when xmlj is enabled).
   if test "x${COMPILE_XMLJ}" = xyes
   then
-    PKG_CHECK_MODULES(XML, xml2 >= 2-2.6.8)
-    PKG_CHECK_MODULES(XSLT, xslt >= 1.1.11)
+    PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.6.8)
+    PKG_CHECK_MODULES(XSLT, libxslt >= 1.1.11)
     AC_SUBST(XML_LIBS)
     AC_SUBST(XML_CFLAGS)
     AC_SUBST(XSLT_LIBS)
Index: native/jni/xmlj/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/xmlj/Makefile.am,v
retrieving revision 1.1
diff -u -r1.1 Makefile.am
--- native/jni/xmlj/Makefile.am 29 Dec 2004 21:39:36 -0000      1.1
+++ native/jni/xmlj/Makefile.am 2 Jan 2005 13:39:06 -0000
@@ -19,4 +19,5 @@
 AM_LDFLAGS = @CLASSPATH_MODULE@ @XML_LIBS@ @XSLT_LIBS@
 AM_CPPFLAGS = @CLASSPATH_INCLUDES@
 
-AM_CFLAGS = @WARNING_CFLAGS@ @ERROR_CFLAGS@ @XML_CFLAGS@ @XSLT_CFLAGS@
+# Don't enable ERROR flags. Code isn't warning free yet.
+AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @XML_CFLAGS@ @XSLT_CFLAGS@
Index: native/jni/xmlj/xmlj_dom.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/xmlj/xmlj_dom.c,v
retrieving revision 1.1
diff -u -r1.1 xmlj_dom.c
--- native/jni/xmlj/xmlj_dom.c  29 Dec 2004 21:39:36 -0000      1.1
+++ native/jni/xmlj/xmlj_dom.c  2 Jan 2005 13:39:06 -0000
@@ -254,7 +254,9 @@
 
 JNIEXPORT void JNICALL
 Java_gnu_xml_libxmlj_dom_GnomeDocument_free (JNIEnv * env,
-                                             jobject self, jobject id)
+                                             jobject self
+                                            __attribute__ ((__unused__)),
+                                            jobject id)
 {
   xmlDocPtr doc;
 
@@ -712,10 +714,14 @@
 
 JNIEXPORT jobject JNICALL
 Java_gnu_xml_libxmlj_dom_GnomeDocument_renameNode (JNIEnv * env,
-                                                   jobject self,
-                                                   jobject n,
-                                                   jstring namespaceURI,
-                                                   jstring qName)
+                                                   jobject self
+                                                  __attribute__ ((__unused__)),
+                                                   jobject n
+                                                  __attribute__ ((__unused__)),
+                                                   jstring namespaceURI
+                                                  __attribute__ ((__unused__)),
+                                                   jstring qName
+                                                  __attribute__ ((__unused__)))
 {
   xmlNodePtr node;
   xmlNsPtr ns;
@@ -944,7 +950,8 @@
 
 JNIEXPORT jstring JNICALL
 Java_gnu_xml_libxmlj_dom_GnomeDocumentType_getInternalSubset (JNIEnv * env,
-                                                              jobject self)
+                                                             jobject self
+                                                            __attribute__ 
((__unused__)))
 {
   /* TODO */
   xmljThrowDOMException (env, 9, NULL); /* NOT_SUPPORTED_ERR */
@@ -1044,7 +1051,8 @@
 
 JNIEXPORT jobject JNICALL
 Java_gnu_xml_libxmlj_dom_GnomeElement_removeAttributeNode (JNIEnv * env,
-                                                           jobject self,
+                                                           jobject self
+                                                          __attribute__ 
((__unused__)),
                                                            jobject oldAttr)
 {
   xmlNodePtr attr;
@@ -1251,7 +1259,8 @@
 
 JNIEXPORT jstring JNICALL
 Java_gnu_xml_libxmlj_dom_GnomeEntity_getNotationName (JNIEnv * env,
-                                                      jobject self)
+                                                      jobject self
+                                                     __attribute__ 
((__unused__)))
 {
   /* TODO */
   xmljThrowDOMException (env, 9, NULL); /* NOT_SUPPORTED_ERR */
@@ -2517,11 +2526,16 @@
 }
 
 JNIEXPORT jboolean JNICALL 
-Java_gnu_xml_libxmlj_dom_GnomeTypeInfo_isDerivedFrom (JNIEnv *env,
-                                                      jobject self,
-                                                      jstring typeNS,
-                                                      jstring typeName,
-                                                      jint method)
+Java_gnu_xml_libxmlj_dom_GnomeTypeInfo_isDerivedFrom (JNIEnv *env
+                                                     __attribute__ 
((__unused__)),
+                                                      jobject self
+                                                     __attribute__ 
((__unused__)),
+                                                      jstring typeNS
+                                                     __attribute__ 
((__unused__)),
+                                                      jstring typeName
+                                                     __attribute__ 
((__unused__)),
+                                                      jint method
+                                                     __attribute__ 
((__unused__)))
 {
   /* TODO when XML Schema support is available */
   return 0;
Index: native/jni/xmlj/xmlj_sax.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/xmlj/xmlj_sax.c,v
retrieving revision 1.1
diff -u -r1.1 xmlj_sax.c
--- native/jni/xmlj/xmlj_sax.c  29 Dec 2004 21:39:36 -0000      1.1
+++ native/jni/xmlj/xmlj_sax.c  2 Jan 2005 13:39:06 -0000
@@ -56,7 +56,8 @@
 
 JNIEXPORT jstring JNICALL
 Java_gnu_xml_libxmlj_sax_GnomeLocator_publicId (JNIEnv * env,
-                                                jobject self,
+                                                jobject self
+                                               __attribute__((__unused__)),
                                                 jobject j_ctx,
                                                 jobject j_loc)
 {
@@ -73,7 +74,8 @@
 
 JNIEXPORT jstring JNICALL
 Java_gnu_xml_libxmlj_sax_GnomeLocator_systemId (JNIEnv * env,
-                                                jobject self,
+                                                jobject self
+                                               __attribute__((__unused__)),
                                                 jobject j_ctx,
                                                 jobject j_loc)
 {
@@ -90,7 +92,8 @@
 
 JNIEXPORT jint JNICALL
 Java_gnu_xml_libxmlj_sax_GnomeLocator_lineNumber (JNIEnv * env,
-                                                  jobject self,
+                                                  jobject self
+                                                 __attribute__((__unused__)),
                                                   jobject j_ctx,
                                                   jobject j_loc)
 {
@@ -108,7 +111,8 @@
 
 JNIEXPORT jint JNICALL
 Java_gnu_xml_libxmlj_sax_GnomeLocator_columnNumber (JNIEnv * env,
-                                                    jobject self,
+                                                    jobject self
+                                                   __attribute__((__unused__)),
                                                     jobject j_ctx,
                                                     jobject j_loc)
 {
@@ -397,7 +401,7 @@
 }
 
 xmlEntityPtr
-xmljSAXGetEntity (void *vctx, const xmlChar * name)
+xmljSAXGetEntity (void *vctx __attribute__((__unused__)), const xmlChar * name)
 {
   xmlEntityPtr ret;
   
Index: native/jni/xmlj/xmlj_transform.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/xmlj/xmlj_transform.c,v
retrieving revision 1.1
diff -u -r1.1 xmlj_transform.c
--- native/jni/xmlj/xmlj_transform.c    29 Dec 2004 21:39:36 -0000      1.1
+++ native/jni/xmlj/xmlj_transform.c    2 Jan 2005 13:39:06 -0000
@@ -608,7 +608,6 @@
   jobject inputStream;
   jbyteArray detectBuffer;
 
-  /*fprintf(stderr,"xmljDocLoader:1\n");*/
   fflush(stdout);
   env = xmljGetJNIEnv ();
   if (!env)
@@ -860,7 +859,8 @@
 /* GnomeTransformerFactory.freeLibxsltGlobal */
 JNIEXPORT void JNICALL
 Java_gnu_xml_libxmlj_transform_GnomeTransformerFactory_freeLibxsltGlobal (
-  JNIEnv *env, jclass clazz)
+  JNIEnv *env __attribute__((__unused__)),
+  jclass clazz __attribute__((__unused__)))
 {
   xsltCleanupGlobals ();
   xmlCleanupParser ();
Index: native/jni/xmlj/xmlj_xpath.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/xmlj/xmlj_xpath.c,v
retrieving revision 1.1
diff -u -r1.1 xmlj_xpath.c
--- native/jni/xmlj/xmlj_xpath.c        29 Dec 2004 21:39:37 -0000      1.1
+++ native/jni/xmlj/xmlj_xpath.c        2 Jan 2005 13:39:06 -0000
@@ -48,7 +48,7 @@
 /* Local function prototypes */
 
 xmlXPathContextPtr
-xmljCreateXPathContextPtr (JNIEnv *env, xmlNodePtr node);
+xmljCreateXPathContextPtr (xmlNodePtr node);
 
 jobject
 xmljGetXPathResult (JNIEnv *env, xmlXPathObjectPtr obj);
@@ -63,7 +63,7 @@
  * Creates an XPath context for the given node.
  */
 xmlXPathContextPtr
-xmljCreateXPathContextPtr (JNIEnv *env, xmlNodePtr node)
+xmljCreateXPathContextPtr (xmlNodePtr node)
 {
   xmlXPathContextPtr ctx;
 
@@ -160,7 +160,8 @@
 
 JNIEXPORT jobject JNICALL
 Java_gnu_xml_libxmlj_dom_GnomeDocument_evaluate (JNIEnv *env,
-                                                 jobject self,
+                                                 jobject self
+                                                __attribute__((__unused__)),
                                                  jstring expression,
                                                  jobject contextNode,
                                                  jobject resolver,
@@ -178,7 +179,7 @@
     {
       return NULL;
     }
-  ctx = xmljCreateXPathContextPtr (env, node);
+  ctx = xmljCreateXPathContextPtr (node);
   if (ctx != NULL)
     {
       eval = xmlXPathEval (str, ctx);
@@ -190,7 +191,8 @@
 
 JNIEXPORT jobject JNICALL
 Java_gnu_xml_libxmlj_dom_GnomeXPathExpression_init (JNIEnv *env,
-                                                    jobject self,
+                                                    jobject self
+                                                   __attribute__((__unused__)),
                                                     jstring expression)
 {
   const xmlChar *str;
@@ -204,7 +206,8 @@
 
 JNIEXPORT void JNICALL
 Java_gnu_xml_libxmlj_dom_GnomeXPathExpression_free (JNIEnv *env,
-                                                    jobject self,
+                                                    jobject self
+                                                   __attribute__((__unused__)),
                                                     jobject ptr)
 {
   xmlXPathCompExprPtr expr;
@@ -215,7 +218,8 @@
 
 JNIEXPORT jobject JNICALL
 Java_gnu_xml_libxmlj_dom_GnomeXPathExpression_doEvaluate (JNIEnv *env,
-                                                          jobject self,
+                                                          jobject self
+                                                         
__attribute__((__unused__)),
                                                           jobject ptr,
                                                           jobject contextNode,
                                                           jshort type,
@@ -232,7 +236,7 @@
     {
       return NULL;
     }
-  ctx = xmljCreateXPathContextPtr (env, node);
+  ctx = xmljCreateXPathContextPtr (node);
   if (ctx != NULL)
     {
       eval = xmlXPathCompiledEval (expr, ctx);
@@ -243,7 +247,8 @@
 
 JNIEXPORT void JNICALL
 Java_gnu_xml_libxmlj_dom_GnomeXPathResult_free (JNIEnv *env,
-                                                jobject self,
+                                                jobject self
+                                               __attribute__((__unused__)),
                                                 jobject obj)
 {
   xmlXPathFreeObject ((xmlXPathObjectPtr) xmljAsPointer (env, obj));
@@ -453,7 +458,7 @@
         }
     }
   xmlFree ((xmlChar *) s_name);
-  ctx = xmljCreateXPathContextPtr (env, node);
+  ctx = xmljCreateXPathContextPtr (node);
   if (ctx != NULL)
     {
       eval = xmlXPathEval (expr, ctx);
@@ -556,7 +561,7 @@
     }
   xmlFree ((xmlChar *) s_uri);
   xmlFree ((xmlChar *) s_localName);
-  ctx = xmljCreateXPathContextPtr (env, node);
+  ctx = xmljCreateXPathContextPtr (node);
   if (ctx != NULL)
     {
       eval = xmlXPathEval (expr, ctx);
@@ -567,7 +572,8 @@
 
 JNIEXPORT void JNICALL
 Java_gnu_xml_libxmlj_dom_GnomeXPathNodeList_free (JNIEnv *env,
-                                                  jobject self,
+                                                  jobject self
+                                                 __attribute__((__unused__)),
                                                   jobject obj)
 {
   xmlXPathFreeObject ((xmlXPathObjectPtr) xmljAsPointer (env, obj));

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]