From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29705 invoked by alias); 9 Aug 2012 10:49:10 -0000 Received: (qmail 29694 invoked by uid 22791); 9 Aug 2012 10:49:09 -0000 X-SWARE-Spam-Status: No, hits=-3.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_BX,TW_GC,TW_IB,TW_JB,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx3-phx2.redhat.com (HELO mx3-phx2.redhat.com) (209.132.183.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Aug 2012 10:48:53 +0000 Received: from zmail17.collab.prod.int.phx2.redhat.com (zmail17.collab.prod.int.phx2.redhat.com [10.5.83.19]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q79Amrot008859; Thu, 9 Aug 2012 06:48:53 -0400 Date: Thu, 09 Aug 2012 10:49:00 -0000 From: Andrew Hughes To: Andrew Haley Cc: GCJ-patches , Dodji Seketeli Message-ID: <1881397545.2449318.1344509333013.JavaMail.root@redhat.com> In-Reply-To: <50237E0B.6030701@redhat.com> Subject: Re: [PATCH, libjava] Use accessor functions to manipulate xmlOutputBuffer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2012-q3/txt/msg00014.txt.bz2 ----- Original Message ----- > On 08/08/2012 11:08 PM, Dodji Seketeli wrote: > > Hello, > > > > This is a fix to prepare the xmlj_io.c file of gnu classpath to a > > coming > > API change in libxml2. > > > > Basically, we were previously accessing fields inside the > > xmlOutputBuffer struct of libxml2. In a coming version of libxml2, > > that won't be possible anymore. Client code will have to use > > accessor > > functions instead. For the gory details, there is an interestin > > note > > of Daniel Veillard (author of libxml2) at > > https://mail.gnome.org/archives/desktop-devel-list/2012-August/msg00007.html. > > > > This patch defines too accessor macros that, depending on the > > version > > of libxml2 we are using will either access the fields of > > xmlOutputBuffer directly, or use the new accessor function. > > > > Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk. > > > > OK to commit? > > OK. > As this is a GNU Classpath change, it should go in there first to avoid creating a divergence which will cause later problems in merging. Classpath is regularly merged into gcj as a whole. I found several patches during the last merge which had only been added to gcj (some without ChangeLog entries) and this slowed the process down considerably. Dodji, I can push this to Classpath on your behalf if you don't have commit access. > Thanks, > Andrew. > > > > libjava/classpath/ > > > > * native/jni/xmlj/xmlj_io.c (GET_XML_OUTPUT_BUFFER_CONTENT) > > (GET_XML_OUTPUT_BUFFER_SIZE): New macros. > > (xmljOutputWriteCallback): Use them. > > --- > > libjava/classpath/native/jni/xmlj/xmlj_io.c | 20 > > +++++++++++++++++--- > > 1 files changed, 17 insertions(+), 3 deletions(-) > > > > diff --git a/libjava/classpath/native/jni/xmlj/xmlj_io.c > > b/libjava/classpath/native/jni/xmlj/xmlj_io.c > > index aa2964d..a55e48d 100644 > > --- a/libjava/classpath/native/jni/xmlj/xmlj_io.c > > +++ b/libjava/classpath/native/jni/xmlj/xmlj_io.c > > @@ -102,6 +102,19 @@ xmljFreeOutputStreamContext > > (OutputStreamContext * outContext); > > xmlCharEncoding > > xmljDetectCharEncoding (JNIEnv * env, jbyteArray buffer); > > > > + > > +#ifdef LIBXML2_NEW_BUFFER > > +#define GET_XML_OUTPUT_BUFFER_CONTENT(buf) (gchar *) \ > > + (char *) xmlOutputBufferGetContent(buf) > > +#define GET_XML_OUTPUT_BUFFER_SIZE(buf) \ > > + xmlOutputBufferGetSize(buf) > > +#else > > +#define GET_XML_OUTPUT_BUFFER_CONTENT(buf) \ > > + (buf)->buffer->content > > +#define GET_XML_OUTPUT_BUFFER_SIZE(buf) \ > > + (buf)->buffer->use > > +#endif > > + > > int > > xmljOutputWriteCallback (void *context, const char *buffer, int > > len) > > { > > @@ -752,9 +765,10 @@ xmljLoadExternalEntity (const char *URL, const > > char *ID, > > inputStream->directory = NULL; > > inputStream->buf = inputBuffer; > > > > - inputStream->base = inputStream->buf->buffer->content; > > - inputStream->cur = inputStream->buf->buffer->content; > > - inputStream->end = > > &inputStream->base[inputStream->buf->buffer->use]; > > + inputStream->base = GET_XML_OUTPUT_BUFFER_CONTENT > > (inputStream->buf); > > + inputStream->cur = GET_XML_OUTPUT_BUFFER_CONTENT > > (inputStream->buf); > > + inputStream->end = > > + &inputStream->base[GET_XML_OUTPUT_BUFFER_SIZE > > (inputStream->buf)]; > > if ((ctxt->directory == NULL) && (inputStream->directory != > > NULL)) > > ctxt->directory = > > (char *) xmlStrdup ((const xmlChar *) > > inputStream->directory); > > > > Thanks, -- Andrew :) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) PGP Key: 248BDC07 (https://keys.indymedia.org/) Fingerprint = EC5A 1F5E C0AD 1D15 8F1F 8F91 3B96 A578 248B DC07