Module Name: src
Committed By: christos
Date: Sun Feb 14 14:49:34 UTC 2016
Modified Files:
src/lib/libedit: chared.c chared.h chartype.h common.c emacs.c
keymacro.c makelist map.c parse.c refresh.c refresh.h search.c
search.h terminal.c terminal.h tty.c vi.c
Log Message:
>From Ingo Schwarze:
As we have seen before, "histedit.h" can never get rid of including
the <wchar.h> header because using the data types defined there is
deeply ingrained in the public interfaces of libedit.
Now POSIX unconditionally requires that <wchar.h> defines the type
wint_t. Consequently, it can be used unconditionally, no matter
whether WIDECHAR is active or not. Consequently, the #define Int
is pointless.
Note that removing it is not gratuitious churn. Auditing for
integer signedness problems is already hard when only fundamental
types like "int" and "unsigned" are involved. It gets very hard
when types come into the picture that have platform-dependent
signedness, like "char" and "wint_t". Adding yet another layer
on top, changing both the signedness and the width in a platform-
dependent way, makes auditing yet harder, which IMHO is really
dangerous. Note that while removing the #define, i already found
one bug caused by this excessive complication - in the function
re_putc() in refresh.c. If WIDECHAR was defined, it printed an
Int = wint_t value with %c. Fortunately, that bug only affects
debugging, not production. The fix is contained in the patch.
With WIDECHAR, this doesn't change anything. For the case without
WIDECHAR, i checked that none of the places wants to store values
that might not fit in wint_t.
This only changes internal interfaces; public ones remain unchanged.
To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/lib/libedit/chared.c
cvs rdiff -u -r1.22 -r1.23 src/lib/libedit/chared.h
cvs rdiff -u -r1.18 -r1.19 src/lib/libedit/chartype.h \
src/lib/libedit/makelist
cvs rdiff -u -r1.30 -r1.31 src/lib/libedit/common.c
cvs rdiff -u -r1.26 -r1.27 src/lib/libedit/emacs.c
cvs rdiff -u -r1.8 -r1.9 src/lib/libedit/keymacro.c
cvs rdiff -u -r1.36 -r1.37 src/lib/libedit/map.c
cvs rdiff -u -r1.28 -r1.29 src/lib/libedit/parse.c
cvs rdiff -u -r1.38 -r1.39 src/lib/libedit/refresh.c
cvs rdiff -u -r1.6 -r1.7 src/lib/libedit/refresh.h
cvs rdiff -u -r1.32 -r1.33 src/lib/libedit/search.c
cvs rdiff -u -r1.9 -r1.10 src/lib/libedit/search.h
cvs rdiff -u -r1.15 -r1.16 src/lib/libedit/terminal.c
cvs rdiff -u -r1.4 -r1.5 src/lib/libedit/terminal.h
cvs rdiff -u -r1.50 -r1.51 src/lib/libedit/tty.c
cvs rdiff -u -r1.47 -r1.48 src/lib/libedit/vi.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libedit/chared.c
diff -u src/lib/libedit/chared.c:1.40 src/lib/libedit/chared.c:1.41
--- src/lib/libedit/chared.c:1.40 Wed Jun 18 14:12:28 2014
+++ src/lib/libedit/chared.c Sun Feb 14 09:49:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: chared.c,v 1.40 2014/06/18 18:12:28 christos Exp $ */
+/* $NetBSD: chared.c,v 1.41 2016/02/14 14:49:34 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.40 2014/06/18 18:12:28 christos Exp $");
+__RCSID("$NetBSD: chared.c,v 1.41 2016/02/14 14:49:34 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -199,7 +199,7 @@ c_delbefore1(EditLine *el)
* Return if p is part of a word according to emacs
*/
protected int
-ce__isword(Int p)
+ce__isword(wint_t p)
{
return Isalnum(p) || Strchr(STR("*?_-.[]~="), p) != NULL;
}
@@ -209,7 +209,7 @@ ce__isword(Int p)
* Return if p is part of a word according to vi
*/
protected int
-cv__isword(Int p)
+cv__isword(wint_t p)
{
if (Isalnum(p) || p == '_')
return 1;
@@ -223,7 +223,7 @@ cv__isword(Int p)
* Return if p is part of a big word according to vi
*/
protected int
-cv__isWord(Int p)
+cv__isWord(wint_t p)
{
return !Isspace(p);
}
@@ -233,7 +233,7 @@ cv__isWord(Int p)
* Find the previous word
*/
protected Char *
-c__prev_word(Char *p, Char *low, int n, int (*wtest)(Int))
+c__prev_word(Char *p, Char *low, int n, int (*wtest)(wint_t))
{
p--;
@@ -257,7 +257,7 @@ c__prev_word(Char *p, Char *low, int n,
* Find the next word
*/
protected Char *
-c__next_word(Char *p, Char *high, int n, int (*wtest)(Int))
+c__next_word(Char *p, Char *high, int n, int (*wtest)(wint_t))
{
while (n--) {
while ((p < high) && !(*wtest)(*p))
@@ -275,7 +275,7 @@ c__next_word(Char *p, Char *high, int n,
* Find the next word vi style
*/
protected Char *
-cv_next_word(EditLine *el, Char *p, Char *high, int n, int (*wtest)(Int))
+cv_next_word(EditLine *el, Char *p, Char *high, int n, int (*wtest)(wint_t))
{
int test;
@@ -304,7 +304,7 @@ cv_next_word(EditLine *el, Char *p, Char
* Find the previous word vi style
*/
protected Char *
-cv_prev_word(Char *p, Char *low, int n, int (*wtest)(Int))
+cv_prev_word(Char *p, Char *low, int n, int (*wtest)(wint_t))
{
int test;
@@ -368,7 +368,7 @@ cv_delfini(EditLine *el)
* Go to the end of this word according to vi
*/
protected Char *
-cv__endword(Char *p, Char *high, int n, int (*wtest)(Int))
+cv__endword(Char *p, Char *high, int n, int (*wtest)(wint_t))
{
int test;
Index: src/lib/libedit/chared.h
diff -u src/lib/libedit/chared.h:1.22 src/lib/libedit/chared.h:1.23
--- src/lib/libedit/chared.h:1.22 Wed Jun 18 14:12:28 2014
+++ src/lib/libedit/chared.h Sun Feb 14 09:49:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: chared.h,v 1.22 2014/06/18 18:12:28 christos Exp $ */
+/* $NetBSD: chared.h,v 1.23 2016/02/14 14:49:34 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -146,17 +146,17 @@ typedef struct el_chared_t {
#include "fcns.h"
-protected int cv__isword(Int);
-protected int cv__isWord(Int);
+protected int cv__isword(wint_t);
+protected int cv__isWord(wint_t);
protected void cv_delfini(EditLine *);
-protected Char *cv__endword(Char *, Char *, int, int (*)(Int));
-protected int ce__isword(Int);
+protected Char *cv__endword(Char *, Char *, int, int (*)(wint_t));
+protected int ce__isword(wint_t);
protected void cv_undo(EditLine *);
protected void cv_yank(EditLine *, const Char *, int);
-protected Char *cv_next_word(EditLine*, Char *, Char *, int, int (*)(Int));
-protected Char *cv_prev_word(Char *, Char *, int, int (*)(Int));
-protected Char *c__next_word(Char *, Char *, int, int (*)(Int));
-protected Char *c__prev_word(Char *, Char *, int, int (*)(Int));
+protected Char *cv_next_word(EditLine*, Char *, Char *, int, int (*)(wint_t));
+protected Char *cv_prev_word(Char *, Char *, int, int (*)(wint_t));
+protected Char *c__next_word(Char *, Char *, int, int (*)(wint_t));
+protected Char *c__prev_word(Char *, Char *, int, int (*)(wint_t));
protected void c_insert(EditLine *, int);
protected void c_delbefore(EditLine *, int);
protected void c_delbefore1(EditLine *);
Index: src/lib/libedit/chartype.h
diff -u src/lib/libedit/chartype.h:1.18 src/lib/libedit/chartype.h:1.19
--- src/lib/libedit/chartype.h:1.18 Sun Feb 14 09:47:48 2016
+++ src/lib/libedit/chartype.h Sun Feb 14 09:49:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: chartype.h,v 1.18 2016/02/14 14:47:48 christos Exp $ */
+/* $NetBSD: chartype.h,v 1.19 2016/02/14 14:49:34 christos Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -67,11 +67,9 @@
#define ct_mbstowcs mbstowcs
#define Char wchar_t
-#define Int wint_t
#define FUN(prefix,rest) prefix ## _w ## rest
#define FUNW(type) type ## _w
#define TYPE(type) type ## W
-#define FCHAR "%lc"
#define FSTR "%ls"
#define STR(x) L ## x
#define UC(c) c
@@ -121,11 +119,9 @@ size_t ct_mbrtowc(char *, const char *,
#define ct_mbstowcs(a, b, c) (strncpy(a, b, c), strlen(a))
#define Char char
-#define Int int
#define FUN(prefix,rest) prefix ## _ ## rest
#define FUNW(type) type
#define TYPE(type) type
-#define FCHAR "%c"
#define FSTR "%s"
#define STR(x) x
#define UC(c) (unsigned char)(c)
Index: src/lib/libedit/makelist
diff -u src/lib/libedit/makelist:1.18 src/lib/libedit/makelist:1.19
--- src/lib/libedit/makelist:1.18 Wed Mar 21 01:34:54 2012
+++ src/lib/libedit/makelist Sun Feb 14 09:49:34 2016
@@ -1,5 +1,5 @@
#!/bin/sh -
-# $NetBSD: makelist,v 1.18 2012/03/21 05:34:54 matt Exp $
+# $NetBSD: makelist,v 1.19 2016/02/14 14:49:34 christos Exp $
#
# Copyright (c) 1992, 1993
# The Regents of the University of California. All rights reserved.
@@ -78,7 +78,8 @@ _EOF
# XXX: need a space between name and prototype so that -fc and -fh
# parsing is much easier
#
- printf("protected el_action_t\t%s (EditLine *, Int);\n", name);
+ printf("protected el_action_t\t%s (EditLine *, wint_t);\n",
+ name);
}
}
END {
@@ -162,7 +163,7 @@ _EOF
END {
printf("#define\t%-30.30s\t%3d\n", "EL_NUM_FCNS", count);
- printf("typedef el_action_t (*el_func_t)(EditLine *, Int);");
+ printf("typedef el_action_t (*el_func_t)(EditLine *, wint_t);");
printf("\nprotected const el_func_t* func__get(void);\n");
printf("#endif /* _h_fcns_c */\n");
}'
Index: src/lib/libedit/common.c
diff -u src/lib/libedit/common.c:1.30 src/lib/libedit/common.c:1.31
--- src/lib/libedit/common.c:1.30 Thu Feb 11 14:21:04 2016
+++ src/lib/libedit/common.c Sun Feb 14 09:49:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: common.c,v 1.30 2016/02/11 19:21:04 christos Exp $ */
+/* $NetBSD: common.c,v 1.31 2016/02/14 14:49:34 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.30 2016/02/11 19:21:04 christos Exp $");
+__RCSID("$NetBSD: common.c,v 1.31 2016/02/14 14:49:34 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -52,7 +52,7 @@ __RCSID("$NetBSD: common.c,v 1.30 2016/0
*/
protected el_action_t
/*ARGSUSED*/
-ed_end_of_file(EditLine *el, Int c __attribute__((__unused__)))
+ed_end_of_file(EditLine *el, wint_t c __attribute__((__unused__)))
{
re_goto_bottom(el);
@@ -66,7 +66,7 @@ ed_end_of_file(EditLine *el, Int c __att
* Insert a character [bound to all insert keys]
*/
protected el_action_t
-ed_insert(EditLine *el, Int c)
+ed_insert(EditLine *el, wint_t c)
{
int count = el->el_state.argument;
@@ -109,7 +109,7 @@ ed_insert(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-ed_delete_prev_word(EditLine *el, Int c __attribute__((__unused__)))
+ed_delete_prev_word(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *cp, *p, *kp;
@@ -137,7 +137,7 @@ ed_delete_prev_word(EditLine *el, Int c
*/
protected el_action_t
/*ARGSUSED*/
-ed_delete_next_char(EditLine *el, Int c __attribute__((__unused__)))
+ed_delete_next_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
#ifdef DEBUG_EDIT
#define EL el->el_line
@@ -184,7 +184,7 @@ ed_delete_next_char(EditLine *el, Int c
*/
protected el_action_t
/*ARGSUSED*/
-ed_kill_line(EditLine *el, Int c __attribute__((__unused__)))
+ed_kill_line(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *kp, *cp;
@@ -205,7 +205,7 @@ ed_kill_line(EditLine *el, Int c __attri
*/
protected el_action_t
/*ARGSUSED*/
-ed_move_to_end(EditLine *el, Int c __attribute__((__unused__)))
+ed_move_to_end(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_line.cursor = el->el_line.lastchar;
@@ -228,7 +228,7 @@ ed_move_to_end(EditLine *el, Int c __att
*/
protected el_action_t
/*ARGSUSED*/
-ed_move_to_beg(EditLine *el, Int c __attribute__((__unused__)))
+ed_move_to_beg(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_line.cursor = el->el_line.buffer;
@@ -251,7 +251,7 @@ ed_move_to_beg(EditLine *el, Int c __att
* [^T] [^T]
*/
protected el_action_t
-ed_transpose_chars(EditLine *el, Int c)
+ed_transpose_chars(EditLine *el, wint_t c)
{
if (el->el_line.cursor < el->el_line.lastchar) {
@@ -277,7 +277,7 @@ ed_transpose_chars(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-ed_next_char(EditLine *el, Int c __attribute__((__unused__)))
+ed_next_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *lim = el->el_line.lastchar;
@@ -306,7 +306,7 @@ ed_next_char(EditLine *el, Int c __attri
*/
protected el_action_t
/*ARGSUSED*/
-ed_prev_word(EditLine *el, Int c __attribute__((__unused__)))
+ed_prev_word(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_line.cursor == el->el_line.buffer)
@@ -332,7 +332,7 @@ ed_prev_word(EditLine *el, Int c __attri
*/
protected el_action_t
/*ARGSUSED*/
-ed_prev_char(EditLine *el, Int c __attribute__((__unused__)))
+ed_prev_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_line.cursor > el->el_line.buffer) {
@@ -356,7 +356,7 @@ ed_prev_char(EditLine *el, Int c __attri
* [^V] [^V]
*/
protected el_action_t
-ed_quoted_insert(EditLine *el, Int c)
+ed_quoted_insert(EditLine *el, wint_t c)
{
int num;
Char tc;
@@ -376,7 +376,7 @@ ed_quoted_insert(EditLine *el, Int c)
* Adds to argument or enters a digit
*/
protected el_action_t
-ed_digit(EditLine *el, Int c)
+ed_digit(EditLine *el, wint_t c)
{
if (!Isdigit(c))
@@ -404,7 +404,7 @@ ed_digit(EditLine *el, Int c)
* For ESC-n
*/
protected el_action_t
-ed_argument_digit(EditLine *el, Int c)
+ed_argument_digit(EditLine *el, wint_t c)
{
if (!Isdigit(c))
@@ -430,7 +430,7 @@ ed_argument_digit(EditLine *el, Int c)
protected el_action_t
/*ARGSUSED*/
ed_unassigned(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ wint_t c __attribute__((__unused__)))
{
return CC_ERROR;
@@ -448,7 +448,7 @@ ed_unassigned(EditLine *el __attribute__
protected el_action_t
/*ARGSUSED*/
ed_tty_sigint(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ wint_t c __attribute__((__unused__)))
{
return CC_NORM;
@@ -462,7 +462,7 @@ ed_tty_sigint(EditLine *el __attribute__
protected el_action_t
/*ARGSUSED*/
ed_tty_dsusp(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ wint_t c __attribute__((__unused__)))
{
return CC_NORM;
@@ -476,7 +476,7 @@ ed_tty_dsusp(EditLine *el __attribute__(
protected el_action_t
/*ARGSUSED*/
ed_tty_flush_output(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ wint_t c __attribute__((__unused__)))
{
return CC_NORM;
@@ -490,7 +490,7 @@ ed_tty_flush_output(EditLine *el __attri
protected el_action_t
/*ARGSUSED*/
ed_tty_sigquit(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ wint_t c __attribute__((__unused__)))
{
return CC_NORM;
@@ -504,7 +504,7 @@ ed_tty_sigquit(EditLine *el __attribute_
protected el_action_t
/*ARGSUSED*/
ed_tty_sigtstp(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ wint_t c __attribute__((__unused__)))
{
return CC_NORM;
@@ -518,7 +518,7 @@ ed_tty_sigtstp(EditLine *el __attribute_
protected el_action_t
/*ARGSUSED*/
ed_tty_stop_output(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ wint_t c __attribute__((__unused__)))
{
return CC_NORM;
@@ -532,7 +532,7 @@ ed_tty_stop_output(EditLine *el __attrib
protected el_action_t
/*ARGSUSED*/
ed_tty_start_output(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ wint_t c __attribute__((__unused__)))
{
return CC_NORM;
@@ -545,7 +545,7 @@ ed_tty_start_output(EditLine *el __attri
*/
protected el_action_t
/*ARGSUSED*/
-ed_newline(EditLine *el, Int c __attribute__((__unused__)))
+ed_newline(EditLine *el, wint_t c __attribute__((__unused__)))
{
re_goto_bottom(el);
@@ -561,7 +561,7 @@ ed_newline(EditLine *el, Int c __attribu
*/
protected el_action_t
/*ARGSUSED*/
-ed_delete_prev_char(EditLine *el, Int c __attribute__((__unused__)))
+ed_delete_prev_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_line.cursor <= el->el_line.buffer)
@@ -581,7 +581,7 @@ ed_delete_prev_char(EditLine *el, Int c
*/
protected el_action_t
/*ARGSUSED*/
-ed_clear_screen(EditLine *el, Int c __attribute__((__unused__)))
+ed_clear_screen(EditLine *el, wint_t c __attribute__((__unused__)))
{
terminal_clear_screen(el); /* clear the whole real screen */
@@ -597,7 +597,7 @@ ed_clear_screen(EditLine *el, Int c __at
protected el_action_t
/*ARGSUSED*/
ed_redisplay(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ wint_t c __attribute__((__unused__)))
{
return CC_REDISPLAY;
@@ -610,7 +610,7 @@ ed_redisplay(EditLine *el __attribute__(
*/
protected el_action_t
/*ARGSUSED*/
-ed_start_over(EditLine *el, Int c __attribute__((__unused__)))
+ed_start_over(EditLine *el, wint_t c __attribute__((__unused__)))
{
ch_reset(el, 0);
@@ -625,7 +625,7 @@ ed_start_over(EditLine *el, Int c __attr
protected el_action_t
/*ARGSUSED*/
ed_sequence_lead_in(EditLine *el __attribute__((__unused__)),
- Int c __attribute__((__unused__)))
+ wint_t c __attribute__((__unused__)))
{
return CC_NORM;
@@ -638,7 +638,7 @@ ed_sequence_lead_in(EditLine *el __attri
*/
protected el_action_t
/*ARGSUSED*/
-ed_prev_history(EditLine *el, Int c __attribute__((__unused__)))
+ed_prev_history(EditLine *el, wint_t c __attribute__((__unused__)))
{
char beep = 0;
int sv_event = el->el_history.eventno;
@@ -676,7 +676,7 @@ ed_prev_history(EditLine *el, Int c __at
*/
protected el_action_t
/*ARGSUSED*/
-ed_next_history(EditLine *el, Int c __attribute__((__unused__)))
+ed_next_history(EditLine *el, wint_t c __attribute__((__unused__)))
{
el_action_t beep = CC_REFRESH, rval;
@@ -703,7 +703,7 @@ ed_next_history(EditLine *el, Int c __at
*/
protected el_action_t
/*ARGSUSED*/
-ed_search_prev_history(EditLine *el, Int c __attribute__((__unused__)))
+ed_search_prev_history(EditLine *el, wint_t c __attribute__((__unused__)))
{
const Char *hp;
int h;
@@ -771,7 +771,7 @@ ed_search_prev_history(EditLine *el, Int
*/
protected el_action_t
/*ARGSUSED*/
-ed_search_next_history(EditLine *el, Int c __attribute__((__unused__)))
+ed_search_next_history(EditLine *el, wint_t c __attribute__((__unused__)))
{
const Char *hp;
int h;
@@ -825,7 +825,7 @@ ed_search_next_history(EditLine *el, Int
*/
protected el_action_t
/*ARGSUSED*/
-ed_prev_line(EditLine *el, Int c __attribute__((__unused__)))
+ed_prev_line(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *ptr;
int nchars = c_hpos(el);
@@ -868,7 +868,7 @@ ed_prev_line(EditLine *el, Int c __attri
*/
protected el_action_t
/*ARGSUSED*/
-ed_next_line(EditLine *el, Int c __attribute__((__unused__)))
+ed_next_line(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *ptr;
int nchars = c_hpos(el);
@@ -902,7 +902,7 @@ ed_next_line(EditLine *el, Int c __attri
*/
protected el_action_t
/*ARGSUSED*/
-ed_command(EditLine *el, Int c __attribute__((__unused__)))
+ed_command(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char tmpbuf[EL_BUFSIZ];
int tmplen;
Index: src/lib/libedit/emacs.c
diff -u src/lib/libedit/emacs.c:1.26 src/lib/libedit/emacs.c:1.27
--- src/lib/libedit/emacs.c:1.26 Thu Feb 11 14:21:04 2016
+++ src/lib/libedit/emacs.c Sun Feb 14 09:49:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: emacs.c,v 1.26 2016/02/11 19:21:04 christos Exp $ */
+/* $NetBSD: emacs.c,v 1.27 2016/02/14 14:49:34 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)emacs.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: emacs.c,v 1.26 2016/02/11 19:21:04 christos Exp $");
+__RCSID("$NetBSD: emacs.c,v 1.27 2016/02/14 14:49:34 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -52,7 +52,7 @@ __RCSID("$NetBSD: emacs.c,v 1.26 2016/02
*/
protected el_action_t
/*ARGSUSED*/
-em_delete_or_list(EditLine *el, Int c)
+em_delete_or_list(EditLine *el, wint_t c)
{
if (el->el_line.cursor == el->el_line.lastchar) {
@@ -88,7 +88,7 @@ em_delete_or_list(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-em_delete_next_word(EditLine *el, Int c __attribute__((__unused__)))
+em_delete_next_word(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *cp, *p, *kp;
@@ -117,7 +117,7 @@ em_delete_next_word(EditLine *el, Int c
*/
protected el_action_t
/*ARGSUSED*/
-em_yank(EditLine *el, Int c __attribute__((__unused__)))
+em_yank(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *kp, *cp;
@@ -153,7 +153,7 @@ em_yank(EditLine *el, Int c __attribute_
*/
protected el_action_t
/*ARGSUSED*/
-em_kill_line(EditLine *el, Int c __attribute__((__unused__)))
+em_kill_line(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *kp, *cp;
@@ -175,7 +175,7 @@ em_kill_line(EditLine *el, Int c __attri
*/
protected el_action_t
/*ARGSUSED*/
-em_kill_region(EditLine *el, Int c __attribute__((__unused__)))
+em_kill_region(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *kp, *cp;
@@ -208,7 +208,7 @@ em_kill_region(EditLine *el, Int c __att
*/
protected el_action_t
/*ARGSUSED*/
-em_copy_region(EditLine *el, Int c __attribute__((__unused__)))
+em_copy_region(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *kp, *cp;
@@ -237,7 +237,7 @@ em_copy_region(EditLine *el, Int c __att
* Gosling emacs transpose chars [^T]
*/
protected el_action_t
-em_gosmacs_transpose(EditLine *el, Int c)
+em_gosmacs_transpose(EditLine *el, wint_t c)
{
if (el->el_line.cursor > &el->el_line.buffer[1]) {
@@ -257,7 +257,7 @@ em_gosmacs_transpose(EditLine *el, Int c
*/
protected el_action_t
/*ARGSUSED*/
-em_next_word(EditLine *el, Int c __attribute__((__unused__)))
+em_next_word(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_line.cursor == el->el_line.lastchar)
return CC_ERROR;
@@ -282,7 +282,7 @@ em_next_word(EditLine *el, Int c __attri
*/
protected el_action_t
/*ARGSUSED*/
-em_upper_case(EditLine *el, Int c __attribute__((__unused__)))
+em_upper_case(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *cp, *ep;
@@ -306,7 +306,7 @@ em_upper_case(EditLine *el, Int c __attr
*/
protected el_action_t
/*ARGSUSED*/
-em_capitol_case(EditLine *el, Int c __attribute__((__unused__)))
+em_capitol_case(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *cp, *ep;
@@ -338,7 +338,7 @@ em_capitol_case(EditLine *el, Int c __at
*/
protected el_action_t
/*ARGSUSED*/
-em_lower_case(EditLine *el, Int c __attribute__((__unused__)))
+em_lower_case(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *cp, *ep;
@@ -362,7 +362,7 @@ em_lower_case(EditLine *el, Int c __attr
*/
protected el_action_t
/*ARGSUSED*/
-em_set_mark(EditLine *el, Int c __attribute__((__unused__)))
+em_set_mark(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_chared.c_kill.mark = el->el_line.cursor;
@@ -376,7 +376,7 @@ em_set_mark(EditLine *el, Int c __attrib
*/
protected el_action_t
/*ARGSUSED*/
-em_exchange_mark(EditLine *el, Int c __attribute__((__unused__)))
+em_exchange_mark(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *cp;
@@ -393,7 +393,7 @@ em_exchange_mark(EditLine *el, Int c __a
*/
protected el_action_t
/*ARGSUSED*/
-em_universal_argument(EditLine *el, Int c __attribute__((__unused__)))
+em_universal_argument(EditLine *el, wint_t c __attribute__((__unused__)))
{ /* multiply current argument by 4 */
if (el->el_state.argument > 1000000)
@@ -410,7 +410,7 @@ em_universal_argument(EditLine *el, Int
*/
protected el_action_t
/*ARGSUSED*/
-em_meta_next(EditLine *el, Int c __attribute__((__unused__)))
+em_meta_next(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_state.metanext = 1;
@@ -423,7 +423,7 @@ em_meta_next(EditLine *el, Int c __attri
*/
protected el_action_t
/*ARGSUSED*/
-em_toggle_overwrite(EditLine *el, Int c __attribute__((__unused__)))
+em_toggle_overwrite(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_state.inputmode = (el->el_state.inputmode == MODE_INSERT) ?
@@ -437,7 +437,7 @@ em_toggle_overwrite(EditLine *el, Int c
*/
protected el_action_t
/*ARGSUSED*/
-em_copy_prev_word(EditLine *el, Int c __attribute__((__unused__)))
+em_copy_prev_word(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *cp, *oldc, *dp;
@@ -464,7 +464,7 @@ em_copy_prev_word(EditLine *el, Int c __
*/
protected el_action_t
/*ARGSUSED*/
-em_inc_search_next(EditLine *el, Int c __attribute__((__unused__)))
+em_inc_search_next(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_search.patlen = 0;
@@ -477,7 +477,7 @@ em_inc_search_next(EditLine *el, Int c _
*/
protected el_action_t
/*ARGSUSED*/
-em_inc_search_prev(EditLine *el, Int c __attribute__((__unused__)))
+em_inc_search_prev(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_search.patlen = 0;
@@ -491,7 +491,7 @@ em_inc_search_prev(EditLine *el, Int c _
*/
protected el_action_t
/*ARGSUSED*/
-em_delete_prev_char(EditLine *el, Int c __attribute__((__unused__)))
+em_delete_prev_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_line.cursor <= el->el_line.buffer)
Index: src/lib/libedit/keymacro.c
diff -u src/lib/libedit/keymacro.c:1.8 src/lib/libedit/keymacro.c:1.9
--- src/lib/libedit/keymacro.c:1.8 Thu Feb 11 14:21:04 2016
+++ src/lib/libedit/keymacro.c Sun Feb 14 09:49:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: keymacro.c,v 1.8 2016/02/11 19:21:04 christos Exp $ */
+/* $NetBSD: keymacro.c,v 1.9 2016/02/14 14:49:34 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)key.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: keymacro.c,v 1.8 2016/02/11 19:21:04 christos Exp $");
+__RCSID("$NetBSD: keymacro.c,v 1.9 2016/02/14 14:49:34 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -85,7 +85,7 @@ private int node_trav(EditLine *, keym
keymacro_value_t *);
private int node__try(EditLine *, keymacro_node_t *, const Char *,
keymacro_value_t *, int);
-private keymacro_node_t *node__get(Int);
+private keymacro_node_t *node__get(wint_t);
private void node__free(keymacro_node_t *);
private void node__put(EditLine *, keymacro_node_t *);
private int node__delete(EditLine *, keymacro_node_t **,
@@ -458,7 +458,7 @@ node__put(EditLine *el, keymacro_node_t
* Returns pointer to a keymacro_node_t for ch.
*/
private keymacro_node_t *
-node__get(Int ch)
+node__get(wint_t ch)
{
keymacro_node_t *ptr;
Index: src/lib/libedit/map.c
diff -u src/lib/libedit/map.c:1.36 src/lib/libedit/map.c:1.37
--- src/lib/libedit/map.c:1.36 Thu Feb 11 14:21:04 2016
+++ src/lib/libedit/map.c Sun Feb 14 09:49:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: map.c,v 1.36 2016/02/11 19:21:04 christos Exp $ */
+/* $NetBSD: map.c,v 1.37 2016/02/14 14:49:34 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: map.c,v 1.36 2016/02/11 19:21:04 christos Exp $");
+__RCSID("$NetBSD: map.c,v 1.37 2016/02/14 14:49:34 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -48,7 +48,7 @@ __RCSID("$NetBSD: map.c,v 1.36 2016/02/1
#include "el.h"
private void map_print_key(EditLine *, el_action_t *, const Char *);
-private void map_print_some_keys(EditLine *, el_action_t *, Int, Int);
+private void map_print_some_keys(EditLine *, el_action_t *, wint_t, wint_t);
private void map_print_all_keys(EditLine *);
private void map_init_nls(EditLine *);
private void map_init_meta(EditLine *);
@@ -1142,7 +1142,7 @@ map_print_key(EditLine *el, el_action_t
* Print keys from first to last
*/
private void
-map_print_some_keys(EditLine *el, el_action_t *map, Int first, Int last)
+map_print_some_keys(EditLine *el, el_action_t *map, wint_t first, wint_t last)
{
el_bindings_t *bp, *ep;
Char firstbuf[2], lastbuf[2];
@@ -1300,8 +1300,8 @@ map_bind(EditLine *el, int argc, const C
return 0;
default:
(void) fprintf(el->el_errfile,
- "" FSTR ": Invalid switch `" FCHAR "'.\n",
- argv[0], (Int)p[1]);
+ "" FSTR ": Invalid switch `%lc'.\n",
+ argv[0], (wint_t)p[1]);
}
else
break;
Index: src/lib/libedit/parse.c
diff -u src/lib/libedit/parse.c:1.28 src/lib/libedit/parse.c:1.29
--- src/lib/libedit/parse.c:1.28 Thu Feb 11 14:21:04 2016
+++ src/lib/libedit/parse.c Sun Feb 14 09:49:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.28 2016/02/11 19:21:04 christos Exp $ */
+/* $NetBSD: parse.c,v 1.29 2016/02/14 14:49:34 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: parse.c,v 1.28 2016/02/11 19:21:04 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.29 2016/02/14 14:49:34 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -139,7 +139,7 @@ protected int
parse__escape(const Char **ptr)
{
const Char *p;
- Int c;
+ wint_t c;
p = *ptr;
Index: src/lib/libedit/refresh.c
diff -u src/lib/libedit/refresh.c:1.38 src/lib/libedit/refresh.c:1.39
--- src/lib/libedit/refresh.c:1.38 Thu Feb 11 14:21:04 2016
+++ src/lib/libedit/refresh.c Sun Feb 14 09:49:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: refresh.c,v 1.38 2016/02/11 19:21:04 christos Exp $ */
+/* $NetBSD: refresh.c,v 1.39 2016/02/14 14:49:34 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)refresh.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: refresh.c,v 1.38 2016/02/11 19:21:04 christos Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.39 2016/02/14 14:49:34 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -52,11 +52,11 @@ __RCSID("$NetBSD: refresh.c,v 1.38 2016/
#include "el.h"
private void re_nextline(EditLine *);
-private void re_addc(EditLine *, Int);
+private void re_addc(EditLine *, wint_t);
private void re_update_line(EditLine *, Char *, Char *, int);
private void re_insert (EditLine *, Char *, int, int, Char *, int);
private void re_delete(EditLine *, Char *, int, int, int);
-private void re_fastputc(EditLine *, Int);
+private void re_fastputc(EditLine *, wint_t);
private void re_clear_eol(EditLine *, int, int, int);
private void re__strncopy(Char *, Char *, size_t);
private void re__copy_and_pad(Char *, const Char *, size_t);
@@ -125,7 +125,7 @@ re_nextline(EditLine *el)
* Draw c, expanding tabs, control chars etc.
*/
private void
-re_addc(EditLine *el, Int c)
+re_addc(EditLine *el, wint_t c)
{
switch (ct_chr_class((Char)c)) {
case CHTYPE_TAB: /* expand the tab */
@@ -161,10 +161,10 @@ re_addc(EditLine *el, Int c)
* Draw the character given
*/
protected void
-re_putc(EditLine *el, Int c, int shift)
+re_putc(EditLine *el, wint_t c, int shift)
{
int i, w = Width(c);
- ELRE_DEBUG(1, (__F, "printing %5x '%c'\r\n", c, c));
+ ELRE_DEBUG(1, (__F, "printing %5x '%lc'\r\n", c, c));
while (shift && (el->el_refresh.r_cursor.h + w > el->el_terminal.t_size.h))
re_putc(el, ' ', 1);
@@ -1052,7 +1052,7 @@ re_refresh_cursor(EditLine *el)
* Add a character fast.
*/
private void
-re_fastputc(EditLine *el, Int c)
+re_fastputc(EditLine *el, wint_t c)
{
int w = Width((Char)c);
while (w > 1 && el->el_cursor.h + w > el->el_terminal.t_size.h)
Index: src/lib/libedit/refresh.h
diff -u src/lib/libedit/refresh.h:1.6 src/lib/libedit/refresh.h:1.7
--- src/lib/libedit/refresh.h:1.6 Wed Dec 30 17:37:40 2009
+++ src/lib/libedit/refresh.h Sun Feb 14 09:49:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: refresh.h,v 1.6 2009/12/30 22:37:40 christos Exp $ */
+/* $NetBSD: refresh.h,v 1.7 2016/02/14 14:49:34 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -48,7 +48,7 @@ typedef struct {
int r_newcv;
} el_refresh_t;
-protected void re_putc(EditLine *, Int, int);
+protected void re_putc(EditLine *, wint_t, int);
protected void re_clear_lines(EditLine *);
protected void re_clear_display(EditLine *);
protected void re_refresh(EditLine *);
Index: src/lib/libedit/search.c
diff -u src/lib/libedit/search.c:1.32 src/lib/libedit/search.c:1.33
--- src/lib/libedit/search.c:1.32 Thu Feb 11 14:21:04 2016
+++ src/lib/libedit/search.c Sun Feb 14 09:49:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: search.c,v 1.32 2016/02/11 19:21:04 christos Exp $ */
+/* $NetBSD: search.c,v 1.33 2016/02/14 14:49:34 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)search.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: search.c,v 1.32 2016/02/11 19:21:04 christos Exp $");
+__RCSID("$NetBSD: search.c,v 1.33 2016/02/14 14:49:34 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -567,7 +567,7 @@ ce_search_line(EditLine *el, int dir)
* Vi repeat search
*/
protected el_action_t
-cv_repeat_srch(EditLine *el, Int c)
+cv_repeat_srch(EditLine *el, wint_t c)
{
#ifdef SDEBUG
@@ -593,14 +593,14 @@ cv_repeat_srch(EditLine *el, Int c)
* Vi character search
*/
protected el_action_t
-cv_csearch(EditLine *el, int direction, Int ch, int count, int tflag)
+cv_csearch(EditLine *el, int direction, wint_t ch, int count, int tflag)
{
Char *cp;
if (ch == 0)
return CC_ERROR;
- if (ch == (Int)-1) {
+ if (ch == (wint_t)-1) {
Char c;
if (FUN(el,getc)(el, &c) != 1)
return ed_end_of_file(el, 0);
@@ -614,14 +614,14 @@ cv_csearch(EditLine *el, int direction,
cp = el->el_line.cursor;
while (count--) {
- if ((Int)*cp == ch)
+ if ((wint_t)*cp == ch)
cp += direction;
for (;;cp += direction) {
if (cp >= el->el_line.lastchar)
return CC_ERROR;
if (cp < el->el_line.buffer)
return CC_ERROR;
- if ((Int)*cp == ch)
+ if ((wint_t)*cp == ch)
break;
}
}
Index: src/lib/libedit/search.h
diff -u src/lib/libedit/search.h:1.9 src/lib/libedit/search.h:1.10
--- src/lib/libedit/search.h:1.9 Wed Dec 30 17:37:40 2009
+++ src/lib/libedit/search.h Sun Feb 14 09:49:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: search.h,v 1.9 2009/12/30 22:37:40 christos Exp $ */
+/* $NetBSD: search.h,v 1.10 2016/02/14 14:49:34 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -60,7 +60,7 @@ protected void c_setpat(EditLine *);
protected el_action_t ce_inc_search(EditLine *, int);
protected el_action_t cv_search(EditLine *, int);
protected el_action_t ce_search_line(EditLine *, int);
-protected el_action_t cv_repeat_srch(EditLine *, Int);
-protected el_action_t cv_csearch(EditLine *, int, Int, int, int);
+protected el_action_t cv_repeat_srch(EditLine *, wint_t);
+protected el_action_t cv_csearch(EditLine *, int, wint_t, int, int);
#endif /* _h_el_search */
Index: src/lib/libedit/terminal.c
diff -u src/lib/libedit/terminal.c:1.15 src/lib/libedit/terminal.c:1.16
--- src/lib/libedit/terminal.c:1.15 Thu Feb 11 14:21:04 2016
+++ src/lib/libedit/terminal.c Sun Feb 14 09:49:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: terminal.c,v 1.15 2016/02/11 19:21:04 christos Exp $ */
+/* $NetBSD: terminal.c,v 1.16 2016/02/14 14:49:34 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95";
#else
-__RCSID("$NetBSD: terminal.c,v 1.15 2016/02/11 19:21:04 christos Exp $");
+__RCSID("$NetBSD: terminal.c,v 1.16 2016/02/14 14:49:34 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -1239,11 +1239,11 @@ terminal_tputs(EditLine *el, const char
* Add a character
*/
protected int
-terminal__putc(EditLine *el, Int c)
+terminal__putc(EditLine *el, wint_t c)
{
char buf[MB_LEN_MAX +1];
ssize_t i;
- if (c == (Int)MB_FILL_CHAR)
+ if (c == (wint_t)MB_FILL_CHAR)
return 0;
i = ct_encode_char(buf, (size_t)MB_LEN_MAX, (Char)c);
if (i <= 0)
@@ -1266,7 +1266,7 @@ terminal__flush(EditLine *el)
* Write the given character out, in a human readable form
*/
protected void
-terminal_writec(EditLine *el, Int c)
+terminal_writec(EditLine *el, wint_t c)
{
Char visbuf[VISUAL_WIDTH_MAX +1];
ssize_t vcnt = ct_visual_char(visbuf, VISUAL_WIDTH_MAX, (Char)c);
Index: src/lib/libedit/terminal.h
diff -u src/lib/libedit/terminal.h:1.4 src/lib/libedit/terminal.h:1.5
--- src/lib/libedit/terminal.h:1.4 Sat Mar 24 16:09:30 2012
+++ src/lib/libedit/terminal.h Sun Feb 14 09:49:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: terminal.h,v 1.4 2012/03/24 20:09:30 christos Exp $ */
+/* $NetBSD: terminal.h,v 1.5 2016/02/14 14:49:34 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -104,8 +104,8 @@ protected int terminal_settc(EditLine *,
protected int terminal_gettc(EditLine *, int, char **);
protected int terminal_telltc(EditLine *, int, const Char **);
protected int terminal_echotc(EditLine *, int, const Char **);
-protected void terminal_writec(EditLine *, Int);
-protected int terminal__putc(EditLine *, Int);
+protected void terminal_writec(EditLine *, wint_t);
+protected int terminal__putc(EditLine *, wint_t);
protected void terminal__flush(EditLine *);
/*
Index: src/lib/libedit/tty.c
diff -u src/lib/libedit/tty.c:1.50 src/lib/libedit/tty.c:1.51
--- src/lib/libedit/tty.c:1.50 Thu Feb 11 14:21:04 2016
+++ src/lib/libedit/tty.c Sun Feb 14 09:49:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: tty.c,v 1.50 2016/02/11 19:21:04 christos Exp $ */
+/* $NetBSD: tty.c,v 1.51 2016/02/14 14:49:34 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: tty.c,v 1.50 2016/02/11 19:21:04 christos Exp $");
+__RCSID("$NetBSD: tty.c,v 1.51 2016/02/14 14:49:34 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -59,7 +59,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;
@@ -155,7 +155,7 @@ private const ttymap_t tty_map[] = {
{C_LNEXT, VLNEXT,
{ED_QUOTED_INSERT, ED_QUOTED_INSERT, ED_UNASSIGNED}},
#endif /* VLNEXT */
- {(Int)-1, (Int)-1,
+ {(wint_t)-1, (wint_t)-1,
{ED_UNASSIGNED, ED_UNASSIGNED, ED_UNASSIGNED}}
};
@@ -902,7 +902,7 @@ tty_bind_char(EditLine *el, int force)
dalt = NULL;
}
- for (tp = tty_map; tp->nch != (Int)-1; tp++) {
+ for (tp = tty_map; tp->nch != (wint_t)-1; tp++) {
new[0] = (Char)t_n[tp->nch];
old[0] = (Char)t_o[tp->och];
if (new[0] == old[0] && !force)
@@ -1174,8 +1174,8 @@ tty_stty(EditLine *el, int argc __attrib
break;
default:
(void) fprintf(el->el_errfile,
- "%s: Unknown switch `" FCHAR "'.\n",
- name, (Int)argv[0][1]);
+ "%s: Unknown switch `%lc'.\n",
+ name, (wint_t)argv[0][1]);
return -1;
}
Index: src/lib/libedit/vi.c
diff -u src/lib/libedit/vi.c:1.47 src/lib/libedit/vi.c:1.48
--- src/lib/libedit/vi.c:1.47 Wed Oct 21 17:45:30 2015
+++ src/lib/libedit/vi.c Sun Feb 14 09:49:34 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: vi.c,v 1.47 2015/10/21 21:45:30 christos Exp $ */
+/* $NetBSD: vi.c,v 1.48 2016/02/14 14:49:34 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: vi.c,v 1.47 2015/10/21 21:45:30 christos Exp $");
+__RCSID("$NetBSD: vi.c,v 1.48 2016/02/14 14:49:34 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -51,19 +51,19 @@ __RCSID("$NetBSD: vi.c,v 1.47 2015/10/21
*/
#include "el.h"
-private el_action_t cv_action(EditLine *, Int);
-private el_action_t cv_paste(EditLine *, Int);
+private el_action_t cv_action(EditLine *, wint_t);
+private el_action_t cv_paste(EditLine *, wint_t);
/* cv_action():
* Handle vi actions.
*/
private el_action_t
-cv_action(EditLine *el, Int c)
+cv_action(EditLine *el, wint_t c)
{
if (el->el_chared.c_vcmd.action != NOP) {
/* 'cc', 'dd' and (possibly) friends */
- if (c != (Int)el->el_chared.c_vcmd.action)
+ if (c != (wint_t)el->el_chared.c_vcmd.action)
return CC_ERROR;
if (!(c & YANK))
@@ -90,7 +90,7 @@ cv_action(EditLine *el, Int c)
* Paste previous deletion before or after the cursor
*/
private el_action_t
-cv_paste(EditLine *el, Int c)
+cv_paste(EditLine *el, wint_t c)
{
c_kill_t *k = &el->el_chared.c_kill;
size_t len = (size_t)(k->last - k->buf);
@@ -122,7 +122,7 @@ cv_paste(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_paste_next(EditLine *el, Int c __attribute__((__unused__)))
+vi_paste_next(EditLine *el, wint_t c __attribute__((__unused__)))
{
return cv_paste(el, 0);
@@ -135,7 +135,7 @@ vi_paste_next(EditLine *el, Int c __attr
*/
protected el_action_t
/*ARGSUSED*/
-vi_paste_prev(EditLine *el, Int c __attribute__((__unused__)))
+vi_paste_prev(EditLine *el, wint_t c __attribute__((__unused__)))
{
return cv_paste(el, 1);
@@ -148,7 +148,7 @@ vi_paste_prev(EditLine *el, Int c __attr
*/
protected el_action_t
/*ARGSUSED*/
-vi_prev_big_word(EditLine *el, Int c __attribute__((__unused__)))
+vi_prev_big_word(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_line.cursor == el->el_line.buffer)
@@ -173,7 +173,7 @@ vi_prev_big_word(EditLine *el, Int c __a
*/
protected el_action_t
/*ARGSUSED*/
-vi_prev_word(EditLine *el, Int c __attribute__((__unused__)))
+vi_prev_word(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_line.cursor == el->el_line.buffer)
@@ -198,7 +198,7 @@ vi_prev_word(EditLine *el, Int c __attri
*/
protected el_action_t
/*ARGSUSED*/
-vi_next_big_word(EditLine *el, Int c __attribute__((__unused__)))
+vi_next_big_word(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_line.cursor >= el->el_line.lastchar - 1)
@@ -222,7 +222,7 @@ vi_next_big_word(EditLine *el, Int c __a
*/
protected el_action_t
/*ARGSUSED*/
-vi_next_word(EditLine *el, Int c __attribute__((__unused__)))
+vi_next_word(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_line.cursor >= el->el_line.lastchar - 1)
@@ -245,7 +245,7 @@ vi_next_word(EditLine *el, Int c __attri
* [~]
*/
protected el_action_t
-vi_change_case(EditLine *el, Int c)
+vi_change_case(EditLine *el, wint_t c)
{
int i;
@@ -277,7 +277,7 @@ vi_change_case(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_change_meta(EditLine *el, Int c __attribute__((__unused__)))
+vi_change_meta(EditLine *el, wint_t c __attribute__((__unused__)))
{
/*
@@ -294,7 +294,7 @@ vi_change_meta(EditLine *el, Int c __att
*/
protected el_action_t
/*ARGSUSED*/
-vi_insert_at_bol(EditLine *el, Int c __attribute__((__unused__)))
+vi_insert_at_bol(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_line.cursor = el->el_line.buffer;
@@ -310,7 +310,7 @@ vi_insert_at_bol(EditLine *el, Int c __a
*/
protected el_action_t
/*ARGSUSED*/
-vi_replace_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_replace_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_line.cursor >= el->el_line.lastchar)
@@ -329,7 +329,7 @@ vi_replace_char(EditLine *el, Int c __at
*/
protected el_action_t
/*ARGSUSED*/
-vi_replace_mode(EditLine *el, Int c __attribute__((__unused__)))
+vi_replace_mode(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_map.current = el->el_map.key;
@@ -345,7 +345,7 @@ vi_replace_mode(EditLine *el, Int c __at
*/
protected el_action_t
/*ARGSUSED*/
-vi_substitute_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_substitute_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
c_delafter(el, el->el_state.argument);
@@ -360,7 +360,7 @@ vi_substitute_char(EditLine *el, Int c _
*/
protected el_action_t
/*ARGSUSED*/
-vi_substitute_line(EditLine *el, Int c __attribute__((__unused__)))
+vi_substitute_line(EditLine *el, wint_t c __attribute__((__unused__)))
{
cv_undo(el);
@@ -378,7 +378,7 @@ vi_substitute_line(EditLine *el, Int c _
*/
protected el_action_t
/*ARGSUSED*/
-vi_change_to_eol(EditLine *el, Int c __attribute__((__unused__)))
+vi_change_to_eol(EditLine *el, wint_t c __attribute__((__unused__)))
{
cv_undo(el);
@@ -396,7 +396,7 @@ vi_change_to_eol(EditLine *el, Int c __a
*/
protected el_action_t
/*ARGSUSED*/
-vi_insert(EditLine *el, Int c __attribute__((__unused__)))
+vi_insert(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_map.current = el->el_map.key;
@@ -411,7 +411,7 @@ vi_insert(EditLine *el, Int c __attribut
*/
protected el_action_t
/*ARGSUSED*/
-vi_add(EditLine *el, Int c __attribute__((__unused__)))
+vi_add(EditLine *el, wint_t c __attribute__((__unused__)))
{
int ret;
@@ -436,7 +436,7 @@ vi_add(EditLine *el, Int c __attribute__
*/
protected el_action_t
/*ARGSUSED*/
-vi_add_at_eol(EditLine *el, Int c __attribute__((__unused__)))
+vi_add_at_eol(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_map.current = el->el_map.key;
@@ -452,7 +452,7 @@ vi_add_at_eol(EditLine *el, Int c __attr
*/
protected el_action_t
/*ARGSUSED*/
-vi_delete_meta(EditLine *el, Int c __attribute__((__unused__)))
+vi_delete_meta(EditLine *el, wint_t c __attribute__((__unused__)))
{
return cv_action(el, DELETE);
@@ -465,7 +465,7 @@ vi_delete_meta(EditLine *el, Int c __att
*/
protected el_action_t
/*ARGSUSED*/
-vi_end_big_word(EditLine *el, Int c __attribute__((__unused__)))
+vi_end_big_word(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_line.cursor == el->el_line.lastchar)
@@ -489,7 +489,7 @@ vi_end_big_word(EditLine *el, Int c __at
*/
protected el_action_t
/*ARGSUSED*/
-vi_end_word(EditLine *el, Int c __attribute__((__unused__)))
+vi_end_word(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_line.cursor == el->el_line.lastchar)
@@ -513,7 +513,7 @@ vi_end_word(EditLine *el, Int c __attrib
*/
protected el_action_t
/*ARGSUSED*/
-vi_undo(EditLine *el, Int c __attribute__((__unused__)))
+vi_undo(EditLine *el, wint_t c __attribute__((__unused__)))
{
c_undo_t un = el->el_chared.c_undo;
@@ -540,7 +540,7 @@ vi_undo(EditLine *el, Int c __attribute_
*/
protected el_action_t
/*ARGSUSED*/
-vi_command_mode(EditLine *el, Int c __attribute__((__unused__)))
+vi_command_mode(EditLine *el, wint_t c __attribute__((__unused__)))
{
/* [Esc] cancels pending action */
@@ -564,7 +564,7 @@ vi_command_mode(EditLine *el, Int c __at
* [0]
*/
protected el_action_t
-vi_zero(EditLine *el, Int c)
+vi_zero(EditLine *el, wint_t c)
{
if (el->el_state.doingarg)
@@ -585,7 +585,7 @@ vi_zero(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_delete_prev_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_delete_prev_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_line.cursor <= el->el_line.buffer)
@@ -603,7 +603,7 @@ vi_delete_prev_char(EditLine *el, Int c
*/
protected el_action_t
/*ARGSUSED*/
-vi_list_or_eof(EditLine *el, Int c)
+vi_list_or_eof(EditLine *el, wint_t c)
{
if (el->el_line.cursor == el->el_line.lastchar) {
@@ -640,7 +640,7 @@ vi_list_or_eof(EditLine *el, Int c)
*/
protected el_action_t
/*ARGSUSED*/
-vi_kill_line_prev(EditLine *el, Int c __attribute__((__unused__)))
+vi_kill_line_prev(EditLine *el, wint_t c __attribute__((__unused__)))
{
Char *kp, *cp;
@@ -661,7 +661,7 @@ vi_kill_line_prev(EditLine *el, Int c __
*/
protected el_action_t
/*ARGSUSED*/
-vi_search_prev(EditLine *el, Int c __attribute__((__unused__)))
+vi_search_prev(EditLine *el, wint_t c __attribute__((__unused__)))
{
return cv_search(el, ED_SEARCH_PREV_HISTORY);
@@ -674,7 +674,7 @@ vi_search_prev(EditLine *el, Int c __att
*/
protected el_action_t
/*ARGSUSED*/
-vi_search_next(EditLine *el, Int c __attribute__((__unused__)))
+vi_search_next(EditLine *el, wint_t c __attribute__((__unused__)))
{
return cv_search(el, ED_SEARCH_NEXT_HISTORY);
@@ -687,7 +687,7 @@ vi_search_next(EditLine *el, Int c __att
*/
protected el_action_t
/*ARGSUSED*/
-vi_repeat_search_next(EditLine *el, Int c __attribute__((__unused__)))
+vi_repeat_search_next(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_search.patlen == 0)
@@ -703,7 +703,7 @@ vi_repeat_search_next(EditLine *el, Int
*/
/*ARGSUSED*/
protected el_action_t
-vi_repeat_search_prev(EditLine *el, Int c __attribute__((__unused__)))
+vi_repeat_search_prev(EditLine *el, wint_t c __attribute__((__unused__)))
{
if (el->el_search.patlen == 0)
@@ -721,7 +721,7 @@ vi_repeat_search_prev(EditLine *el, Int
*/
protected el_action_t
/*ARGSUSED*/
-vi_next_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_next_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
return cv_csearch(el, CHAR_FWD, -1, el->el_state.argument, 0);
}
@@ -733,7 +733,7 @@ vi_next_char(EditLine *el, Int c __attri
*/
protected el_action_t
/*ARGSUSED*/
-vi_prev_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_prev_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
return cv_csearch(el, CHAR_BACK, -1, el->el_state.argument, 0);
}
@@ -745,7 +745,7 @@ vi_prev_char(EditLine *el, Int c __attri
*/
protected el_action_t
/*ARGSUSED*/
-vi_to_next_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_to_next_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
return cv_csearch(el, CHAR_FWD, -1, el->el_state.argument, 1);
}
@@ -757,7 +757,7 @@ vi_to_next_char(EditLine *el, Int c __at
*/
protected el_action_t
/*ARGSUSED*/
-vi_to_prev_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_to_prev_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
return cv_csearch(el, CHAR_BACK, -1, el->el_state.argument, 1);
}
@@ -769,7 +769,7 @@ vi_to_prev_char(EditLine *el, Int c __at
*/
protected el_action_t
/*ARGSUSED*/
-vi_repeat_next_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_repeat_next_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
return cv_csearch(el, el->el_search.chadir, el->el_search.chacha,
@@ -783,7 +783,7 @@ vi_repeat_next_char(EditLine *el, Int c
*/
protected el_action_t
/*ARGSUSED*/
-vi_repeat_prev_char(EditLine *el, Int c __attribute__((__unused__)))
+vi_repeat_prev_char(EditLine *el, wint_t c __attribute__((__unused__)))
{
el_action_t r;
int dir = el->el_search.chadir;
@@ -801,7 +801,7 @@ vi_repeat_prev_char(EditLine *el, Int c
*/
protected el_action_t
/*ARGSUSED*/
-vi_match(EditLine *el, Int c __attribute__((__unused__)))
+vi_match(EditLine *el, wint_t c __attribute__((__unused__)))
{
const Char match_chars[] = STR("()[]{}");
Char *cp;
@@ -848,7 +848,7 @@ vi_match(EditLine *el, Int c __attribute
*/
protected el_action_t
/*ARGSUSED*/
-vi_undo_line(EditLine *el, Int c __attribute__((__unused__)))
+vi_undo_line(EditLine *el, wint_t c __attribute__((__unused__)))
{
cv_undo(el);
@@ -862,7 +862,7 @@ vi_undo_line(EditLine *el, Int c __attri
*/
protected el_action_t
/*ARGSUSED*/
-vi_to_column(EditLine *el, Int c __attribute__((__unused__)))
+vi_to_column(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_line.cursor = el->el_line.buffer;
@@ -876,7 +876,7 @@ vi_to_column(EditLine *el, Int c __attri
*/
protected el_action_t
/*ARGSUSED*/
-vi_yank_end(EditLine *el, Int c __attribute__((__unused__)))
+vi_yank_end(EditLine *el, wint_t c __attribute__((__unused__)))
{
cv_yank(el, el->el_line.cursor,
@@ -890,7 +890,7 @@ vi_yank_end(EditLine *el, Int c __attrib
*/
protected el_action_t
/*ARGSUSED*/
-vi_yank(EditLine *el, Int c __attribute__((__unused__)))
+vi_yank(EditLine *el, wint_t c __attribute__((__unused__)))
{
return cv_action(el, YANK);
@@ -902,7 +902,7 @@ vi_yank(EditLine *el, Int c __attribute_
*/
protected el_action_t
/*ARGSUSED*/
-vi_comment_out(EditLine *el, Int c __attribute__((__unused__)))
+vi_comment_out(EditLine *el, wint_t c __attribute__((__unused__)))
{
el->el_line.cursor = el->el_line.buffer;
@@ -920,7 +920,7 @@ vi_comment_out(EditLine *el, Int c __att
*/
protected el_action_t
/*ARGSUSED*/
-vi_alias(EditLine *el, Int c __attribute__((__unused__)))
+vi_alias(EditLine *el, wint_t c __attribute__((__unused__)))
{
char alias_name[3];
const char *alias_text;
@@ -946,7 +946,7 @@ vi_alias(EditLine *el, Int c __attribute
*/
protected el_action_t
/*ARGSUSED*/
-vi_to_history_line(EditLine *el, Int c __attribute__((__unused__)))
+vi_to_history_line(EditLine *el, wint_t c __attribute__((__unused__)))
{
int sv_event_no = el->el_history.eventno;
el_action_t rval;
@@ -991,7 +991,7 @@ vi_to_history_line(EditLine *el, Int c _
*/
protected el_action_t
/*ARGSUSED*/
-vi_histedit(EditLine *el, Int c __attribute__((__unused__)))
+vi_histedit(EditLine *el, wint_t c __attribute__((__unused__)))
{
int fd;
pid_t pid;
@@ -1075,7 +1075,7 @@ error:
*/
protected el_action_t
/*ARGSUSED*/
-vi_history_word(EditLine *el, Int c __attribute__((__unused__)))
+vi_history_word(EditLine *el, wint_t c __attribute__((__unused__)))
{
const Char *wp = HIST_FIRST(el);
const Char *wep, *wsp;
@@ -1125,7 +1125,7 @@ vi_history_word(EditLine *el, Int c __at
*/
protected el_action_t
/*ARGSUSED*/
-vi_redo(EditLine *el, Int c __attribute__((__unused__)))
+vi_redo(EditLine *el, wint_t c __attribute__((__unused__)))
{
c_redo_t *r = &el->el_chared.c_redo;