* [PATCH] Properly encapsulate multi-statement macro.
[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
0 siblings, 1 reply; 2+ messages in thread
From: Hans-Bernhard Bröker @ 2020-02-27 19:47 UTC (permalink / raw)
To: cygwin
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 { \
wpbuf[wpixput++] = x; \
if (wpixput > WPBUF_LEN) \
- wpixput--;
+ wpixput--; \
+} while(0)
static void
beep ()
--
2.21.0
--
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Properly encapsulate multi-statement macro.
2020-02-27 19:47 ` [PATCH] Properly encapsulate multi-statement macro Hans-Bernhard Bröker
@ 2020-02-27 22:22 ` Brian Inglis
0 siblings, 0 replies; 2+ messages in thread
From: Brian Inglis @ 2020-02-27 22:22 UTC (permalink / raw)
To: cygwin
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-02-27 22:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <6e96e314-0a4c-d3fa-83e3-902fb85d86c9@t-online.de>
2020-02-27 19:47 ` [PATCH] Properly encapsulate multi-statement macro Hans-Bernhard Bröker
2020-02-27 22:22 ` Brian Inglis
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).