public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: Christian Biesinger <cbiesinger@google.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/3] sim: callback: add a getpid interface
Date: Mon, 21 Jun 2021 19:50:45 -0400	[thread overview]
Message-ID: <YNEl1b2ZXlw4QekT@vapier> (raw)
In-Reply-To: <CAPTJ0XHiWFcH2okEWo-3JNvDOHTah7gVjD-PUvrUq4fd22n+ZQ@mail.gmail.com>

On 21 Jun 2021 17:58, Christian Biesinger wrote:
> On Sun, Jun 20, 2021 at 10:55 PM Mike Frysinger wrote:
> > --- a/sim/common/callback.c
> > +++ b/sim/common/callback.c
> > @@ -556,6 +556,17 @@ os_truncate (host_callback *p, const char *file, int64_t len)
> >  #endif
> >  }
> >
> > +static int
> > +os_getpid (host_callback *p)
> > +{
> > +  int result;
> > +
> > +  result = getpid ();
> 
> sim is C11, right? Why not write this as "int result = getpid ();"?

just maintaining copy & paste style in this module, and because (iiuc), GNU
style wants a blank line after decls.  so imo it looks nicer to have business
logic grouped together.

{
  int result = getpid ();

  p->last_errno = errno;
  return result;
}

{
  int result;
  
  result = getpid ();
  p->last_errno = errno;
  return result;
}
-mike

      reply	other threads:[~2021-06-21 23:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21  3:55 Mike Frysinger
2021-06-21  3:55 ` [PATCH 2/3] sim: callback: generate signal map Mike Frysinger
2021-06-21  3:55 ` [PATCH 3/3] sim: callback: add missing cb_target_to_host_signal Mike Frysinger
2021-06-21 22:58 ` [PATCH 1/3] sim: callback: add a getpid interface Christian Biesinger
2021-06-21 23:50   ` Mike Frysinger [this message]

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=YNEl1b2ZXlw4QekT@vapier \
    --to=vapier@gentoo.org \
    --cc=cbiesinger@google.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).