Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libedit KNF return (\1); -> return \1;
details: https://anonhg.NetBSD.org/src/rev/d8de70ed7d68
branches: trunk
changeset: 767751:d8de70ed7d68
user: christos <christos%NetBSD.org@localhost>
date: Fri Jul 29 15:16:33 2011 +0000
description:
KNF return (\1); -> return \1;
diffstat:
lib/libedit/chared.c | 50 +++++++-------
lib/libedit/chartype.c | 6 +-
lib/libedit/common.c | 132 ++++++++++++++++++++--------------------
lib/libedit/el.c | 34 +++++-----
lib/libedit/emacs.c | 70 +++++++++++-----------
lib/libedit/filecomplete.c | 16 ++--
lib/libedit/hist.c | 26 ++++----
lib/libedit/history.c | 120 +++++++++++++++++++-------------------
lib/libedit/keymacro.c | 62 +++++++++---------
lib/libedit/map.c | 62 +++++++++---------
lib/libedit/parse.c | 36 +++++-----
lib/libedit/prompt.c | 8 +-
lib/libedit/read.c | 40 ++++++------
lib/libedit/readline.c | 142 ++++++++++++++++++++++----------------------
lib/libedit/search.c | 50 +++++++-------
lib/libedit/terminal.c | 96 +++++++++++++++---------------
lib/libedit/tokenizer.c | 32 +++++-----
lib/libedit/tty.c | 60 +++++++++---------
lib/libedit/vi.c | 116 ++++++++++++++++++------------------
19 files changed, 579 insertions(+), 579 deletions(-)
diffs (truncated from 4448 to 300 lines):
diff -r 915532db563a -r d8de70ed7d68 lib/libedit/chared.c
--- a/lib/libedit/chared.c Fri Jul 29 13:10:23 2011 +0000
+++ b/lib/libedit/chared.c Fri Jul 29 15:16:33 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: chared.c,v 1.31 2011/07/28 20:50:55 christos Exp $ */
+/* $NetBSD: chared.c,v 1.32 2011/07/29 15:16:33 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: chared.c,v 1.31 2011/07/28 20:50:55 christos Exp $");
+__RCSID("$NetBSD: chared.c,v 1.32 2011/07/29 15:16:33 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -201,7 +201,7 @@
protected int
ce__isword(Int p)
{
- return (Isalnum(p) || Strchr(STR("*?_-.[]~="), p) != NULL);
+ return Isalnum(p || Strchr(STR("*?_-.[]~="), p) != NULL);
}
@@ -225,7 +225,7 @@
protected int
cv__isWord(Int p)
{
- return (!Isspace(p));
+ return !Isspace(p);
}
@@ -249,7 +249,7 @@
if (p < low)
p = low;
/* cp now points where we want it */
- return (p);
+ return p;
}
@@ -268,7 +268,7 @@
if (p > high)
p = high;
/* p now points where we want it */
- return (p);
+ return p;
}
/* cv_next_word():
@@ -294,9 +294,9 @@
/* p now points where we want it */
if (p > high)
- return (high);
+ return high;
else
- return (p);
+ return p;
}
@@ -320,9 +320,9 @@
/* p now points where we want it */
if (p < low)
- return (low);
+ return low;
else
- return (p);
+ return p;
}
@@ -343,12 +343,12 @@
if (*++p == '^') {
*num = 1;
- return (p);
+ return p;
}
if (*p == '$') {
if (*++p != '-') {
*num = 0x7fffffff; /* Handle $ */
- return (--p);
+ return --p;
}
sign = -1; /* Handle $- */
++p;
@@ -357,7 +357,7 @@
for (i = 0; Isdigit(*p); i = 10 * i + *p++ - '0')
continue;
*num = (sign < 0 ? dval - i : i);
- return (--p);
+ return --p;
}
#endif
@@ -416,7 +416,7 @@
}
p--;
- return (p);
+ return p;
}
#endif
@@ -440,7 +440,7 @@
p++;
}
p--;
- return (p);
+ return p;
}
/* ch_init():
@@ -454,7 +454,7 @@
el->el_line.buffer = el_malloc(EL_BUFSIZ *
sizeof(*el->el_line.buffer));
if (el->el_line.buffer == NULL)
- return (-1);
+ return -1;
(void) memset(el->el_line.buffer, 0, EL_BUFSIZ *
sizeof(*el->el_line.buffer));
@@ -465,7 +465,7 @@
el->el_chared.c_undo.buf = el_malloc(EL_BUFSIZ *
sizeof(*el->el_chared.c_undo.buf));
if (el->el_chared.c_undo.buf == NULL)
- return (-1);
+ return -1;
(void) memset(el->el_chared.c_undo.buf, 0, EL_BUFSIZ *
sizeof(*el->el_chared.c_undo.buf));
el->el_chared.c_undo.len = -1;
@@ -473,7 +473,7 @@
el->el_chared.c_redo.buf = el_malloc(EL_BUFSIZ *
sizeof(*el->el_chared.c_redo.buf));
if (el->el_chared.c_redo.buf == NULL)
- return (-1);
+ return -1;
el->el_chared.c_redo.pos = el->el_chared.c_redo.buf;
el->el_chared.c_redo.lim = el->el_chared.c_redo.buf + EL_BUFSIZ;
el->el_chared.c_redo.cmd = ED_UNASSIGNED;
@@ -484,7 +484,7 @@
el->el_chared.c_kill.buf = el_malloc(EL_BUFSIZ *
sizeof(*el->el_chared.c_kill.buf));
if (el->el_chared.c_kill.buf == NULL)
- return (-1);
+ return -1;
(void) memset(el->el_chared.c_kill.buf, 0, EL_BUFSIZ *
sizeof(*el->el_chared.c_kill.buf));
el->el_chared.c_kill.mark = el->el_line.buffer;
@@ -504,8 +504,8 @@
ma->offset = 0;
ma->macro = el_malloc(EL_MAXMACRO * sizeof(*ma->macro));
if (ma->macro == NULL)
- return (-1);
- return (0);
+ return -1;
+ return 0;
}
/* ch_reset():
@@ -670,16 +670,16 @@
size_t len;
if ((len = Strlen(s)) == 0)
- return (-1);
+ return -1;
if (el->el_line.lastchar + len >= el->el_line.limit) {
if (!ch_enlargebufs(el, len))
- return (-1);
+ return -1;
}
c_insert(el, (int)len);
while (*s)
*el->el_line.cursor++ = *s++;
- return (0);
+ return 0;
}
@@ -778,7 +778,7 @@
* Find how many characters till the beginning of this line.
*/
if (el->el_line.cursor == el->el_line.buffer)
- return (0);
+ return 0;
else {
for (ptr = el->el_line.cursor - 1;
ptr >= el->el_line.buffer && *ptr != '\n';
diff -r 915532db563a -r d8de70ed7d68 lib/libedit/chartype.c
--- a/lib/libedit/chartype.c Fri Jul 29 13:10:23 2011 +0000
+++ b/lib/libedit/chartype.c Fri Jul 29 15:16:33 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: chartype.c,v 1.7 2011/07/28 20:50:55 christos Exp $ */
+/* $NetBSD: chartype.c,v 1.8 2011/07/29 15:16:33 christos Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
*/
#include "config.h"
#if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: chartype.c,v 1.7 2011/07/28 20:50:55 christos Exp $");
+__RCSID("$NetBSD: chartype.c,v 1.8 2011/07/29 15:16:33 christos Exp $");
#endif /* not lint && not SCCSID */
#include "el.h"
#include <stdlib.h>
@@ -321,7 +321,7 @@
*dst++ = tohexdigit(((unsigned int) c >> 8) & 0xf);
*dst++ = tohexdigit(((unsigned int) c >> 4) & 0xf);
*dst = tohexdigit(((unsigned int) c ) & 0xf);
- return (c > 0xffff) ? 8 : 7;
+ return c > 0xffff ? 8 : 7;
#else
*dst++ = '\\';
#define tooctaldigit(v) ((v) + '0')
diff -r 915532db563a -r d8de70ed7d68 lib/libedit/common.c
--- a/lib/libedit/common.c Fri Jul 29 13:10:23 2011 +0000
+++ b/lib/libedit/common.c Fri Jul 29 15:16:33 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: common.c,v 1.25 2011/07/28 01:05:20 christos Exp $ */
+/* $NetBSD: common.c,v 1.26 2011/07/29 15:16:33 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)common.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: common.c,v 1.25 2011/07/28 01:05:20 christos Exp $");
+__RCSID("$NetBSD: common.c,v 1.26 2011/07/29 15:16:33 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -57,7 +57,7 @@
re_goto_bottom(el);
*el->el_line.lastchar = '\0';
- return (CC_EOF);
+ return CC_EOF;
}
@@ -71,7 +71,7 @@
int count = el->el_state.argument;
if (c == '\0')
- return (CC_ERROR);
+ return CC_ERROR;
if (el->el_line.lastchar + el->el_state.argument >=
el->el_line.limit) {
@@ -99,7 +99,7 @@
if (el->el_state.inputmode == MODE_REPLACE_1)
return vi_command_mode(el, 0);
- return (CC_NORM);
+ return CC_NORM;
}
@@ -114,7 +114,7 @@
Char *cp, *p, *kp;
if (el->el_line.cursor == el->el_line.buffer)
- return (CC_ERROR);
+ return CC_ERROR;
cp = c__prev_word(el->el_line.cursor, el->el_line.buffer,
el->el_state.argument, ce__isword);
@@ -127,7 +127,7 @@
el->el_line.cursor = cp;
if (el->el_line.cursor < el->el_line.buffer)
el->el_line.cursor = el->el_line.buffer; /* bounds check */
- return (CC_REFRESH);
+ return CC_REFRESH;
}
@@ -152,24 +152,24 @@
if (el->el_line.cursor == el->el_line.buffer) {
/* if I'm also at the beginning */
#ifdef KSHVI
- return (CC_ERROR);
+ return CC_ERROR;
#else
/* then do an EOF */
terminal_writec(el, c);
- return (CC_EOF);
+ return CC_EOF;
#endif
} else {
#ifdef KSHVI
Home |
Main Index |
Thread Index |
Old Index