diff options
author | 2016-03-20 20:35:38 +0000 | |
---|---|---|
committer | 2016-03-20 20:35:38 +0000 | |
commit | b2589f0b3286bc81be0a2044650199e8c9df0b5c (patch) | |
tree | 7745d39c923c07ecd2096e0fd865f9eecb27392b /lib/libedit/tty.c | |
parent | Get rid of "#ifdef WIDECHAR" and one goto in read_char(), (diff) | |
download | wireguard-openbsd-b2589f0b3286bc81be0a2044650199e8c9df0b5c.tar.xz wireguard-openbsd-b2589f0b3286bc81be0a2044650199e8c9df0b5c.zip |
Delete the useless Int datatype and always use the standard wint_t
directly. This is not a problem because <wchar_t> is required all
over the place anyway, even when WIDECHAR is not defined.
No functional change except that it fixes a few printf(3)
format string issues, %c vs. %lc.
OK czarkoff@
Diffstat (limited to 'lib/libedit/tty.c')
-rw-r--r-- | lib/libedit/tty.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libedit/tty.c b/lib/libedit/tty.c index 7ddfa8ec597..3a9ce30e7f2 100644 --- a/lib/libedit/tty.c +++ b/lib/libedit/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.18 2016/01/30 12:22:20 schwarze Exp $ */ +/* $OpenBSD: tty.c,v 1.19 2016/03/20 20:35:38 schwarze Exp $ */ /* $NetBSD: tty.c,v 1.34 2011/01/27 23:11:40 christos Exp $ */ /*- @@ -52,7 +52,7 @@ typedef struct ttymodes_t { } ttymodes_t; typedef struct ttymap_t { - Int nch, och; /* Internal and termio rep of chars */ + wint_t nch, och; /* Internal and termio rep of chars */ el_action_t bind[3]; /* emacs, vi, and vi-cmd */ } ttymap_t; @@ -148,7 +148,7 @@ private const ttymap_t tty_map[] = { {C_LNEXT, VLNEXT, {ED_QUOTED_INSERT, ED_QUOTED_INSERT, ED_UNASSIGNED}}, #endif /* VLNEXT */ - {-1, -1, + {(wint_t)-1, (wint_t)-1, {ED_UNASSIGNED, ED_UNASSIGNED, ED_UNASSIGNED}} }; @@ -889,7 +889,7 @@ tty_bind_char(EditLine *el, int force) dalt = NULL; } - for (tp = tty_map; tp->nch != -1; tp++) { + for (tp = tty_map; tp->nch != (wint_t)-1; tp++) { new[0] = t_n[tp->nch]; old[0] = t_o[tp->och]; if (new[0] == old[0] && !force) @@ -1162,7 +1162,7 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)), const Char **argv) break; default: (void) fprintf(el->el_errfile, - "%s: Unknown switch `%c'.\n", + "%s: Unknown switch `%lc'.\n", name, argv[0][1]); return -1; } |