delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/02/27/17:23:51

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:reply-to:subject:to:references:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=m1WFaNXwZ3qGu6a+
9fXa3BuZ6Fmx4o/LqjWlgmR5q42o9aQERcLlsIXeCPgm1HryBVbAKXeyZaoO3Py+
5deaxz9PeHWr/fNvul418ElQE9c8HcD+RbeUvY0gayS8d9ln5v8GsE/6+nfq8eOX
YdRQa7/Y20oNzYQLn9IcA0DVeQw=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:reply-to:subject:to:references:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=u+eFC/z/iFBe5PoKw4Mnk/
4qD+s=; b=DU200n+BeZQiHwG/LJH01WpsnfpO+2ekVksBN+tYc/C3vncyaBBWna
cZ5XNZeIFVBTjfnoNBND2iwFPK6GCto5Z0LGdCOL2m2ibRAlNLXtXDWqlpt0hKCE
flZhmYltmS3lD5noJLm+g0YETKC8bI7ecupSg2ZslvekfWWIuJMpY=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-15.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=Reader, HContent-Transfer-Encoding:8bit
X-HELO: smtp-out-so.shaw.ca
Reply-To: cygwin AT cygwin DOT com
Subject: Re: [PATCH] Properly encapsulate multi-statement macro.
To: cygwin AT cygwin DOT com
References: <6e96e314-0a4c-d3fa-83e3-902fb85d86c9 AT t-online DOT de> <7de8b3a1-d724-c451-979c-9067c8f78710 AT t-online DOT de>
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Message-ID: <ac550d19-5183-9e55-246e-6262b1526219@SystematicSw.ab.ca>
Date: Thu, 27 Feb 2020 15:22:52 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2
MIME-Version: 1.0
In-Reply-To: <7de8b3a1-d724-c451-979c-9067c8f78710@t-online.de>
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019