This is the mail archive of the
mailing list for the Archer project.
Re: [python][patch] Add options length parameter to value.string(...)
Thiago Jung Bauermann wrote:
El lun, 06-04-2009 a las 16:14 -0600, Tom Tromey escribiÃ: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)?
The rest looks good to me.
"Phil" == Phil Muldoon <firstname.lastname@example.org> writes:
>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