public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: tdevries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>
Cc: tdevries via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Add initializers to comp_unit_head
Date: Sun, 25 Dec 2022 17:56:10 +0000	[thread overview]
Message-ID: <74dd4be1f399773c5cb7fc9ab188f358@suse.de> (raw)
In-Reply-To: <87sfh3cxc0.fsf@tromey.com>

On 2022-12-25 15:33, Tom Tromey wrote:
>>>>>> tdevries via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
>> FWIW, I've rebased the patch attached to the PR on your patch, and I'm
>> left with the patch below, which makes the length field of
>> comp_unit_head private.
> 
>>    /* Return the total length of the CU described by this header.  */
>> -  unsigned int get_length () const
>> +  unsigned int get_length (bool include_initial = true) const
>>    {
>> -    return initial_length_size + length;
>> +    unsigned int res = m_length;
>> +    if (include_initial)
>> +      res += initial_length_size;
>> +    return res;
> 
> I think that since the callers all statically decide which length they
> want, there should probably just be two methods with different names.
> 

OK, so how about:
- get_length_with_initial
- get_length_without_initial
?

Thanks,
- Tom

> Tom

  reply	other threads:[~2022-12-25 17:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-24 22:44 Tom Tromey
2022-12-25  8:06 ` tdevries
2022-12-25 15:33   ` Tom Tromey
2022-12-25 17:56     ` tdevries [this message]
2022-12-26 17:59       ` Tom Tromey
2022-12-30 12:58         ` [pushed] [gdb/symtab] Make comp_unit_head.length private Tom de Vries

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=74dd4be1f399773c5cb7fc9ab188f358@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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).