public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: [PATCH] Properly encapsulate multi-statement macro.
Date: Thu, 27 Feb 2020 22:22:00 -0000	[thread overview]
Message-ID: <ac550d19-5183-9e55-246e-6262b1526219@SystematicSw.ab.ca> (raw)
In-Reply-To: <7de8b3a1-d724-c451-979c-9067c8f78710@t-online.de>

On 2020-02-27 12:47, Hans-Bernhard Bröker wrote:
> 
>  winsup/cygwin/fhandler_console.cc | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
> index 4ab9bcab8..353abd197 100644
> --- a/winsup/cygwin/fhandler_console.cc
> +++ b/winsup/cygwin/fhandler_console.cc
> @@ -63,10 +63,11 @@ static struct fhandler_base::rabuf_t con_ra;
>  static unsigned char wpbuf[WPBUF_LEN];
>  static int wpixput;
>  static unsigned char last_char;
> -#define wpbuf_put(x) \
> +#define wpbuf_put(x) do { \

Please split to avoid eye bleed:

  +#define wpbuf_put(x) \
  +do { \
>    wpbuf[wpixput++] = x; \
>    if (wpixput > WPBUF_LEN) \
> -    wpixput--;
> +    wpixput--; \
> +} while(0)
> 
>  static void
>  beep ()

and post to cygwin-patches?

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

      reply	other threads:[~2020-02-27 22:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6e96e314-0a4c-d3fa-83e3-902fb85d86c9@t-online.de>
2020-02-27 19:47 ` Hans-Bernhard Bröker
2020-02-27 22:22   ` Brian Inglis [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=ac550d19-5183-9e55-246e-6262b1526219@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.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).