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/5f175ab0b273
branches:  trunk
changeset: 324822:5f175ab0b273
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 7eb177f3ebad -r 5f175ab0b273 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