public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Thiago Jung Bauermann <bauerman@br.ibm.com>,
	Project Archer <archer@sourceware.org>
Subject: Re: [python][patch] Add options length parameter to value.string(...)
Date: Wed, 15 Apr 2009 09:13:00 -0000	[thread overview]
Message-ID: <49E5A535.6060608@redhat.com> (raw)
In-Reply-To: <m3bpr0ky0n.fsf@fleche.redhat.com>

Tom Tromey wrote:
>>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
>>>>>>             
>
> Phil> +   buffer in BUFFER, which should be freed by the caller.  If length
> Phil> +   is specified at -1, the string is read until a null character is
> Phil> +   found, otherwise the string is read to the length specified.  
>
> This should mention that length is in units of characters.
>
> And, it seems weird that on input length is characters and on output
> it is bytes.  Please change this to be characters uniformly.
>   

Yeah I was naively replicating the behavior from read_string which 
expects a character length and returns bytes read; but you are right it 
is totally the wrong semantics to use in this case. Thanks for spotting 
this. In this case is multiplying the number of bytes read as returned 
by read_string, and multiplying it by the width the right thing to 
return here?


Regards

Phil

  reply	other threads:[~2009-04-15  9:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-06 16:54 Phil Muldoon
2009-04-06 22:14 ` Tom Tromey
2009-04-06 22:33   ` Thiago Jung Bauermann
2009-04-09  9:58     ` Phil Muldoon
2009-04-09 16:08       ` Thiago Jung Bauermann
2009-04-09 16:28         ` Phil Muldoon
2009-04-09 18:46           ` Thiago Jung Bauermann
2009-04-09 20:28             ` Phil Muldoon
2009-04-09 20:39               ` Thiago Jung Bauermann
2009-04-09 16:12   ` Phil Muldoon
2009-04-09 20:39     ` Thiago Jung Bauermann
2009-04-09 21:29       ` Phil Muldoon
2009-04-13 22:08         ` Tom Tromey
2009-04-15  9:13           ` Phil Muldoon [this message]
2009-04-15  9:37             ` Phil Muldoon
2009-04-15 12:37               ` Tom Tromey
2009-04-15 14:52           ` Phil Muldoon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49E5A535.6060608@redhat.com \
    --to=pmuldoon@redhat.com \
    --cc=archer@sourceware.org \
    --cc=bauerman@br.ibm.com \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).