diff options
author | 2016-01-30 12:22:20 +0000 | |
---|---|---|
committer | 2016-01-30 12:22:20 +0000 | |
commit | 28d54ee83c6affd52032b6242140cc317714b94c (patch) | |
tree | 0ef5cda3e75bd5bab700bd54a1d43f60de5abb7b /lib/libedit/terminal.c | |
parent | Explain how to run multiple copies of the same daemon; (diff) | |
download | wireguard-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/terminal.c')
-rw-r--r-- | lib/libedit/terminal.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/lib/libedit/terminal.c b/lib/libedit/terminal.c index 1bc58fd79a3..7890b8d8608 100644 --- a/lib/libedit/terminal.c +++ b/lib/libedit/terminal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: terminal.c,v 1.4 2016/01/30 02:52:41 schwarze Exp $ */ +/* $OpenBSD: terminal.c,v 1.5 2016/01/30 12:22:20 schwarze Exp $ */ /* $NetBSD: term.c,v 1.57 2009/12/30 22:37:40 christos Exp $ */ /*- @@ -281,7 +281,7 @@ terminal_init(EditLine *el) (void) memset(el->el_terminal.t_val, 0, T_val * sizeof(int)); (void) terminal_set(el, NULL); terminal_init_arrow(el); - return (0); + return 0; fail5: free(el->el_terminal.t_str); el->el_terminal.t_str = NULL; @@ -295,7 +295,7 @@ fail2: free(el->el_terminal.t_buf); el->el_terminal.t_buf = NULL; fail: - return (-1); + return -1; } /* terminal_end(): @@ -399,8 +399,8 @@ terminal_rebuffer_display(EditLine *el) c->v = Val(T_li); if (terminal_alloc_display(el) == -1) - return (-1); - return (0); + return -1; + return 0; } @@ -448,7 +448,7 @@ terminal_alloc_display(EditLine *el) done: if (rv) terminal_free_display(el); - return (rv); + return rv; } @@ -933,11 +933,11 @@ terminal_set(EditLine *el, const char *term) /* get the correct window size */ (void) terminal_get_size(el, &lins, &cols); if (terminal_change_size(el, lins, cols) == -1) - return (-1); + return -1; (void) sigprocmask(SIG_SETMASK, &oset, NULL); terminal_bind_arrow(el); el->el_terminal.t_name = term; - return (i <= 0 ? -1 : 0); + return i <= 0 ? -1 : 0; } @@ -974,7 +974,7 @@ terminal_get_size(EditLine *el, int *lins, int *cols) } } #endif - return (Val(T_co) != *cols || Val(T_li) != *lins); + return Val(T_co) != *cols || Val(T_li) != *lins; } @@ -992,9 +992,9 @@ terminal_change_size(EditLine *el, int lins, int cols) /* re-make display buffers */ if (terminal_rebuffer_display(el) == -1) - return (-1); + return -1; re_clear_display(el); - return (0); + return 0; } @@ -1102,9 +1102,9 @@ terminal_set_arrow(EditLine *el, const Char *name, keymacro_value_t *fun, if (Strcmp(name, arrow[i].name) == 0) { arrow[i].fun = *fun; arrow[i].type = type; - return (0); + return 0; } - return (-1); + return -1; } @@ -1120,9 +1120,9 @@ terminal_clear_arrow(EditLine *el, const Char *name) for (i = 0; i < A_K_NKEYS; i++) if (Strcmp(name, arrow[i].name) == 0) { arrow[i].type = XK_NOD; - return (0); + return 0; } - return (-1); + return -1; } @@ -1311,7 +1311,7 @@ terminal_telltc(EditLine *el, int argc __attribute__((__unused__)), t->long_name, t->name, ub); } (void) fputc('\n', el->el_outfile); - return (0); + return 0; } @@ -1407,7 +1407,7 @@ terminal_gettc(EditLine *el, int argc __attribute__((__unused__)), char **argv) void *how; if (argv == NULL || argv[1] == NULL || argv[2] == NULL) - return (-1); + return -1; what = argv[1]; how = argv[2]; @@ -1469,7 +1469,7 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)), area = buf; if (argv == NULL || argv[1] == NULL) - return (-1); + return -1; argv++; if (argv[0][0] == '-') { @@ -1487,31 +1487,31 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)), argv++; } if (!*argv || *argv[0] == '\0') - return (0); + return 0; if (Strcmp(*argv, STR("tabs")) == 0) { (void) fprintf(el->el_outfile, fmts, EL_CAN_TAB ? "yes" : "no"); - return (0); + return 0; } else if (Strcmp(*argv, STR("meta")) == 0) { (void) fprintf(el->el_outfile, fmts, Val(T_km) ? "yes" : "no"); - return (0); + return 0; } else if (Strcmp(*argv, STR("xn")) == 0) { (void) fprintf(el->el_outfile, fmts, EL_HAS_MAGIC_MARGINS ? "yes" : "no"); - return (0); + return 0; } else if (Strcmp(*argv, STR("am")) == 0) { (void) fprintf(el->el_outfile, fmts, EL_HAS_AUTO_MARGINS ? "yes" : "no"); - return (0); + return 0; } else if (Strcmp(*argv, STR("baud")) == 0) { (void) fprintf(el->el_outfile, fmtd, (int)el->el_tty.t_speed); - return (0); + return 0; } else if (Strcmp(*argv, STR("rows")) == 0 || Strcmp(*argv, STR("lines")) == 0) { (void) fprintf(el->el_outfile, fmtd, Val(T_li)); - return (0); + return 0; } else if (Strcmp(*argv, STR("cols")) == 0) { (void) fprintf(el->el_outfile, fmtd, Val(T_co)); - return (0); + return 0; } /* * Try to use our local definition first @@ -1532,7 +1532,7 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)), (void) fprintf(el->el_errfile, "echotc: Termcap parameter `" FSTR "' not found.\n", *argv); - return (-1); + return -1; } /* * Count home many values we need for this capability. @@ -1575,7 +1575,7 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)), (void) fprintf(el->el_errfile, "echotc: Warning: Extra argument `" FSTR "'.\n", *argv); - return (-1); + return -1; } terminal_tputs(el, scap, 1); break; @@ -1585,7 +1585,7 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)), if (!silent) (void) fprintf(el->el_errfile, "echotc: Warning: Missing argument.\n"); - return (-1); + return -1; } arg_cols = 0; i = Strtol(*argv, &ep, 10); @@ -1594,7 +1594,7 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)), (void) fprintf(el->el_errfile, "echotc: Bad value `" FSTR "' for rows.\n", *argv); - return (-1); + return -1; } arg_rows = (int) i; argv++; @@ -1603,7 +1603,7 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)), (void) fprintf(el->el_errfile, "echotc: Warning: Extra argument `" FSTR "'.\n", *argv); - return (-1); + return -1; } terminal_tputs(el, tgoto(scap, arg_cols, arg_rows), 1); break; @@ -1620,7 +1620,7 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)), if (!silent) (void) fprintf(el->el_errfile, "echotc: Warning: Missing argument.\n"); - return (-1); + return -1; } i = Strtol(*argv, &ep, 10); if (*ep != '\0' || i < 0) { @@ -1628,7 +1628,7 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)), (void) fprintf(el->el_errfile, "echotc: Bad value `" FSTR "' for cols.\n", *argv); - return (-1); + return -1; } arg_cols = (int) i; argv++; @@ -1636,7 +1636,7 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)), if (!silent) (void) fprintf(el->el_errfile, "echotc: Warning: Missing argument.\n"); - return (-1); + return -1; } i = Strtol(*argv, &ep, 10); if (*ep != '\0' || i < 0) { @@ -1644,14 +1644,14 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)), (void) fprintf(el->el_errfile, "echotc: Bad value `" FSTR "' for rows.\n", *argv); - return (-1); + return -1; } arg_rows = (int) i; if (*ep != '\0') { if (!silent) (void) fprintf(el->el_errfile, "echotc: Bad value `" FSTR "'.\n", *argv); - return (-1); + return -1; } argv++; if (*argv && *argv[0]) { @@ -1659,10 +1659,10 @@ terminal_echotc(EditLine *el, int argc __attribute__((__unused__)), (void) fprintf(el->el_errfile, "echotc: Warning: Extra argument `" FSTR "'.\n", *argv); - return (-1); + return -1; } terminal_tputs(el, tgoto(scap, arg_cols, arg_rows), arg_rows); break; } - return (0); + return 0; } |