summaryrefslogtreecommitdiffstats
path: root/lib/libedit/emacs.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2016-01-30 12:22:20 +0000
committerschwarze <schwarze@openbsd.org>2016-01-30 12:22:20 +0000
commit28d54ee83c6affd52032b6242140cc317714b94c (patch)
tree0ef5cda3e75bd5bab700bd54a1d43f60de5abb7b /lib/libedit/emacs.c
parentExplain how to run multiple copies of the same daemon; (diff)
downloadwireguard-openbsd-28d54ee83c6affd52032b6242140cc317714b94c.tar.xz
wireguard-openbsd-28d54ee83c6affd52032b6242140cc317714b94c.zip
Fourth step in synching with NetBSD:
KNF: Remove parentheses from return lines. No object change. This makes emacs.c and prompt.c identical to the NetBSD versions. It reduces the remaining diff from +2053 -1261 to +1526 -734. OK czarkoff@
Diffstat (limited to 'lib/libedit/emacs.c')
-rw-r--r--lib/libedit/emacs.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/lib/libedit/emacs.c b/lib/libedit/emacs.c
index 011916a839d..52e5834fe3e 100644
--- a/lib/libedit/emacs.c
+++ b/lib/libedit/emacs.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: emacs.c,v 1.10 2016/01/30 00:06:39 schwarze Exp $ */
-/* $NetBSD: emacs.c,v 1.23 2009/12/30 22:37:40 christos Exp $ */
+/* $OpenBSD: emacs.c,v 1.11 2016/01/30 12:22:20 schwarze Exp $ */
+/* $NetBSD: emacs.c,v 1.25 2011/07/29 15:16:33 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -54,14 +54,14 @@ em_delete_or_list(EditLine *el, Int c)
if (el->el_line.cursor == el->el_line.buffer) {
/* and the beginning */
terminal_writec(el, c); /* then do an EOF */
- return (CC_EOF);
+ return CC_EOF;
} else {
/*
* Here we could list completions, but it is an
* error right now
*/
terminal_beep(el);
- return (CC_ERROR);
+ return CC_ERROR;
}
} else {
if (el->el_state.doingarg)
@@ -71,7 +71,7 @@ em_delete_or_list(EditLine *el, Int c)
if (el->el_line.cursor > el->el_line.lastchar)
el->el_line.cursor = el->el_line.lastchar;
/* bounds check */
- return (CC_REFRESH);
+ return CC_REFRESH;
}
}
@@ -87,7 +87,7 @@ em_delete_next_word(EditLine *el, Int c __attribute__((__unused__)))
Char *cp, *p, *kp;
if (el->el_line.cursor == el->el_line.lastchar)
- return (CC_ERROR);
+ return CC_ERROR;
cp = c__next_word(el->el_line.cursor, el->el_line.lastchar,
el->el_state.argument, ce__isword);
@@ -101,7 +101,7 @@ em_delete_next_word(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_line.cursor > el->el_line.lastchar)
el->el_line.cursor = el->el_line.lastchar;
/* bounds check */
- return (CC_REFRESH);
+ return CC_REFRESH;
}
@@ -116,12 +116,12 @@ em_yank(EditLine *el, Int c __attribute__((__unused__)))
Char *kp, *cp;
if (el->el_chared.c_kill.last == el->el_chared.c_kill.buf)
- return (CC_NORM);
+ return CC_NORM;
if (el->el_line.lastchar +
(el->el_chared.c_kill.last - el->el_chared.c_kill.buf) >=
el->el_line.limit)
- return (CC_ERROR);
+ return CC_ERROR;
el->el_chared.c_kill.mark = el->el_line.cursor;
cp = el->el_line.cursor;
@@ -137,7 +137,7 @@ em_yank(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_state.argument == 1)
el->el_line.cursor = cp;
- return (CC_REFRESH);
+ return CC_REFRESH;
}
@@ -159,7 +159,7 @@ em_kill_line(EditLine *el, Int c __attribute__((__unused__)))
/* zap! -- delete all of it */
el->el_line.lastchar = el->el_line.buffer;
el->el_line.cursor = el->el_line.buffer;
- return (CC_REFRESH);
+ return CC_REFRESH;
}
@@ -174,7 +174,7 @@ em_kill_region(EditLine *el, Int c __attribute__((__unused__)))
Char *kp, *cp;
if (!el->el_chared.c_kill.mark)
- return (CC_ERROR);
+ return CC_ERROR;
if (el->el_chared.c_kill.mark > el->el_line.cursor) {
cp = el->el_line.cursor;
@@ -192,7 +192,7 @@ em_kill_region(EditLine *el, Int c __attribute__((__unused__)))
c_delbefore(el, (int)(cp - el->el_chared.c_kill.mark));
el->el_line.cursor = el->el_chared.c_kill.mark;
}
- return (CC_REFRESH);
+ return CC_REFRESH;
}
@@ -207,7 +207,7 @@ em_copy_region(EditLine *el, Int c __attribute__((__unused__)))
Char *kp, *cp;
if (!el->el_chared.c_kill.mark)
- return (CC_ERROR);
+ return CC_ERROR;
if (el->el_chared.c_kill.mark > el->el_line.cursor) {
cp = el->el_line.cursor;
@@ -222,7 +222,7 @@ em_copy_region(EditLine *el, Int c __attribute__((__unused__)))
*kp++ = *cp++; /* copy it */
el->el_chared.c_kill.last = kp;
}
- return (CC_NORM);
+ return CC_NORM;
}
@@ -239,9 +239,9 @@ em_gosmacs_transpose(EditLine *el, Int c)
c = el->el_line.cursor[-2];
el->el_line.cursor[-2] = el->el_line.cursor[-1];
el->el_line.cursor[-1] = c;
- return (CC_REFRESH);
+ return CC_REFRESH;
} else
- return (CC_ERROR);
+ return CC_ERROR;
}
@@ -254,7 +254,7 @@ protected el_action_t
em_next_word(EditLine *el, Int c __attribute__((__unused__)))
{
if (el->el_line.cursor == el->el_line.lastchar)
- return (CC_ERROR);
+ return CC_ERROR;
el->el_line.cursor = c__next_word(el->el_line.cursor,
el->el_line.lastchar,
@@ -264,9 +264,9 @@ em_next_word(EditLine *el, Int c __attribute__((__unused__)))
if (el->el_map.type == MAP_VI)
if (el->el_chared.c_vcmd.action != NOP) {
cv_delfini(el);
- return (CC_REFRESH);
+ return CC_REFRESH;
}
- return (CC_CURSOR);
+ return CC_CURSOR;
}
@@ -290,7 +290,7 @@ em_upper_case(EditLine *el, Int c __attribute__((__unused__)))
el->el_line.cursor = ep;
if (el->el_line.cursor > el->el_line.lastchar)
el->el_line.cursor = el->el_line.lastchar;
- return (CC_REFRESH);
+ return CC_REFRESH;
}
@@ -322,7 +322,7 @@ em_capitol_case(EditLine *el, Int c __attribute__((__unused__)))
el->el_line.cursor = ep;
if (el->el_line.cursor > el->el_line.lastchar)
el->el_line.cursor = el->el_line.lastchar;
- return (CC_REFRESH);
+ return CC_REFRESH;
}
@@ -346,7 +346,7 @@ em_lower_case(EditLine *el, Int c __attribute__((__unused__)))
el->el_line.cursor = ep;
if (el->el_line.cursor > el->el_line.lastchar)
el->el_line.cursor = el->el_line.lastchar;
- return (CC_REFRESH);
+ return CC_REFRESH;
}
@@ -360,7 +360,7 @@ em_set_mark(EditLine *el, Int c __attribute__((__unused__)))
{
el->el_chared.c_kill.mark = el->el_line.cursor;
- return (CC_NORM);
+ return CC_NORM;
}
@@ -377,7 +377,7 @@ em_exchange_mark(EditLine *el, Int c __attribute__((__unused__)))
cp = el->el_line.cursor;
el->el_line.cursor = el->el_chared.c_kill.mark;
el->el_chared.c_kill.mark = cp;
- return (CC_CURSOR);
+ return CC_CURSOR;
}
@@ -391,10 +391,10 @@ em_universal_argument(EditLine *el, Int c __attribute__((__unused__)))
{ /* multiply current argument by 4 */
if (el->el_state.argument > 1000000)
- return (CC_ERROR);
+ return CC_ERROR;
el->el_state.doingarg = 1;
el->el_state.argument *= 4;
- return (CC_ARGHACK);
+ return CC_ARGHACK;
}
@@ -408,7 +408,7 @@ em_meta_next(EditLine *el, Int c __attribute__((__unused__)))
{
el->el_state.metanext = 1;
- return (CC_ARGHACK);
+ return CC_ARGHACK;
}
@@ -422,7 +422,7 @@ em_toggle_overwrite(EditLine *el, Int c __attribute__((__unused__)))
el->el_state.inputmode = (el->el_state.inputmode == MODE_INSERT) ?
MODE_REPLACE : MODE_INSERT;
- return (CC_NORM);
+ return CC_NORM;
}
@@ -436,7 +436,7 @@ em_copy_prev_word(EditLine *el, Int c __attribute__((__unused__)))
Char *cp, *oldc, *dp;
if (el->el_line.cursor == el->el_line.buffer)
- return (CC_ERROR);
+ return CC_ERROR;
oldc = el->el_line.cursor;
/* does a bounds check */
@@ -449,7 +449,7 @@ em_copy_prev_word(EditLine *el, Int c __attribute__((__unused__)))
el->el_line.cursor = dp;/* put cursor at end */
- return (CC_REFRESH);
+ return CC_REFRESH;
}
@@ -462,7 +462,7 @@ em_inc_search_next(EditLine *el, Int c __attribute__((__unused__)))
{
el->el_search.patlen = 0;
- return (ce_inc_search(el, ED_SEARCH_NEXT_HISTORY));
+ return ce_inc_search(el, ED_SEARCH_NEXT_HISTORY);
}
@@ -475,7 +475,7 @@ em_inc_search_prev(EditLine *el, Int c __attribute__((__unused__)))
{
el->el_search.patlen = 0;
- return (ce_inc_search(el, ED_SEARCH_PREV_HISTORY));
+ return ce_inc_search(el, ED_SEARCH_PREV_HISTORY);
}
@@ -489,7 +489,7 @@ em_delete_prev_char(EditLine *el, Int c __attribute__((__unused__)))
{
if (el->el_line.cursor <= el->el_line.buffer)
- return (CC_ERROR);
+ return CC_ERROR;
if (el->el_state.doingarg)
c_delbefore(el, el->el_state.argument);
@@ -498,5 +498,5 @@ em_delete_prev_char(EditLine *el, Int c __attribute__((__unused__)))
el->el_line.cursor -= el->el_state.argument;
if (el->el_line.cursor < el->el_line.buffer)
el->el_line.cursor = el->el_line.buffer;
- return (CC_REFRESH);
+ return CC_REFRESH;
}