Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/dist/nvi Don't use loops with empty body.
details: https://anonhg.NetBSD.org/src/rev/3e428e29a2d8
branches: trunk
changeset: 777601:3e428e29a2d8
user: joerg <joerg%NetBSD.org@localhost>
date: Sat Feb 25 00:13:00 2012 +0000
description:
Don't use loops with empty body.
diffstat:
dist/nvi/ex/ex_tag.c | 4 ++--
dist/nvi/vi/vs_msg.c | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diffs (37 lines):
diff -r b4cd0b27550e -r 3e428e29a2d8 dist/nvi/ex/ex_tag.c
--- a/dist/nvi/ex/ex_tag.c Fri Feb 24 22:41:12 2012 +0000
+++ b/dist/nvi/ex/ex_tag.c Sat Feb 25 00:13:00 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ex_tag.c,v 1.10 2011/08/17 12:56:55 christos Exp $ */
+/* $NetBSD: ex_tag.c,v 1.11 2012/02/25 00:13:00 joerg Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -1411,7 +1411,7 @@
#define GREATER 1
#define LESS (-1)
-#define SKIP_PAST_NEWLINE(p, back) while (p < back && *p++ != '\n');
+#define SKIP_PAST_NEWLINE(p, back) while (p < back && *p++ != '\n') continue;
static char *
binary_search(register char *string, register char *front, register char *back)
diff -r b4cd0b27550e -r 3e428e29a2d8 dist/nvi/vi/vs_msg.c
--- a/dist/nvi/vi/vs_msg.c Fri Feb 24 22:41:12 2012 +0000
+++ b/dist/nvi/vi/vs_msg.c Sat Feb 25 00:13:00 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vs_msg.c,v 1.4 2010/05/13 17:52:11 tnozaki Exp $ */
+/* $NetBSD: vs_msg.c,v 1.5 2012/02/25 00:13:00 joerg Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -897,7 +897,8 @@
if ((mp_c = gp->msgq.lh_first) == NULL) {
LIST_INSERT_HEAD(&gp->msgq, mp_n, q);
} else {
- for (; mp_c->q.le_next != NULL; mp_c = mp_c->q.le_next);
+ while (mp_c->q.le_next != NULL)
+ mp_c = mp_c->q.le_next;
LIST_INSERT_AFTER(mp_c, mp_n, q);
}
return;
Home |
Main Index |
Thread Index |
Old Index