public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: "Alexandra Hájková" <ahajkova@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] remote.c: Make packet_check_result return a structure
Date: Tue, 09 Jan 2024 12:01:20 -0700	[thread overview]
Message-ID: <87edequy9r.fsf@tromey.com> (raw)
In-Reply-To: <20240107150213.888213-1-ahajkova@redhat.com> ("Alexandra =?utf-8?B?SMOhamtvdsOhIidz?= message of "Sun, 7 Jan 2024 15:56:51 +0100")

>>>>> "Alexandra" == Alexandra Hájková <ahajkova@redhat.com> writes:

Alexandra> +  packet_result (enum packet_status status, std::string err_msg):
Alexandra> +    m_status (status), m_err_msg (std::move (err_msg))

gdb normally puts the ":" on the next line.

Alexandra> +  const char *err_msg () const
Alexandra> +    {
Alexandra> +      gdb_assert (this->m_status == PACKET_ERROR);

Braces are indented too much here.

Alexandra>        if (buf[0] == 'E' && buf[1] == '.')
Alexandra> -	return PACKET_ERROR;
Alexandra> +      {
Alexandra> +	return { PACKET_ERROR, buf + 2 };
Alexandra> +      }

Braces look like they aren't indented properly here.
However I don't think those outer braces are needed at all since they
only wrap a return statement.

Tom

  reply	other threads:[~2024-01-09 19:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-07 14:56 Alexandra Hájková
2024-01-09 19:01 ` Tom Tromey [this message]
2024-01-19 11:56 [PATCH v2 0/6] Add vDefaultInferiorFd feature Alexandra Hájková
2024-01-19 11:56 ` [PATCH v2] remote.c: Make packet_check_result return a structure Alexandra Hájková
2024-02-22 14:37   ` Alexandra Petlanova Hajkova
2024-02-23 16:19     ` Tom Tromey

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=87edequy9r.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=ahajkova@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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).