From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29425 invoked by alias); 9 Apr 2009 09:58:21 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 29415 invoked by uid 22791); 9 Apr 2009 09:58:20 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Message-ID: <49DDC6B0.4080009@redhat.com> Date: Thu, 09 Apr 2009 09:58:00 -0000 From: Phil Muldoon User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Thiago Jung Bauermann CC: Tom Tromey , Project Archer Subject: Re: [python][patch] Add options length parameter to value.string(...) References: <49DA33CE.9070803@redhat.com> <1239057175.8871.30.camel@localhost.localdomain> In-Reply-To: <1239057175.8871.30.camel@localhost.localdomain> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2009-q2/txt/msg00030.txt.bz2 Thiago Jung Bauermann wrote: > El lun, 06-04-2009 a las 16:14 -0600, Tom Tromey escribió: > >>>>>>> "Phil" == Phil Muldoon writes: >>>>>>> >> The rest looks good to me. >> > > >From what we talked on IRC, in this block: > > /* If we know the size of the array, we can use it as a limit on the > number of characters to be fetched. */ > if (TYPE_NFIELDS (type) == 1 > && TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) == TYPE_CODE_RANGE) > > we want to set *length and not fetchlimit from the array size. But > probably only if *length is -1. If the caller specified a *length > already, we shouldn't override it and continue using the array size for > the fetchlimit. > I'm not sure what benefit setting the length to arraysize in the case of length -1 would achieve? Fetchlimit will be set to either unint_max or the actual bounds of the array, and -1 means return at first null or fetchlimit length within the fetchlimit? So sending length of -1, and a fetchlimit as described in the current existing logic would "do the right thing"? If I were to set length to the array bound in the -1 case, it would fetch the whole array, and not stop on the first null (which we want for -1)? Regards Phil