Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh NFC: better protect the INTON (etc) macros ( do { } w...



details:   https://anonhg.NetBSD.org/src/rev/323fc8673465
branches:  trunk
changeset: 320823:323fc8673465
user:      kre <kre%NetBSD.org@localhost>
date:      Sun Jul 22 20:37:52 2018 +0000

description:
NFC: better protect the INTON (etc) macros ( do { } while(0) )
This is just a kind of precaution, none of the uses actually
require the extra protection.

diffstat:

 bin/sh/error.h |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (22 lines):

diff -r f2f4fc77a5d9 -r 323fc8673465 bin/sh/error.h
--- a/bin/sh/error.h    Sun Jul 22 15:02:51 2018 +0000
+++ b/bin/sh/error.h    Sun Jul 22 20:37:52 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: error.h,v 1.19 2012/03/15 02:02:20 joerg Exp $ */
+/*     $NetBSD: error.h,v 1.20 2018/07/22 20:37:52 kre Exp $   */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -83,9 +83,9 @@
 extern volatile int intpending;
 
 #define INTOFF suppressint++
-#define INTON { if (--suppressint == 0 && intpending) onint(); }
-#define FORCEINTON {suppressint = 0; if (intpending) onint();}
-#define CLEAR_PENDING_INT intpending = 0
+#define INTON do { if (--suppressint == 0 && intpending) onint(); } while (0)
+#define FORCEINTON do { suppressint = 0; if (intpending) onint(); } while (0)
+#define CLEAR_PENDING_INT (intpending = 0)
 #define int_pending() intpending
 
 #if ! defined(SHELL_BUILTIN)



Home | Main Index | Thread Index | Old Index