summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormartijn <martijn@openbsd.org>2016-05-27 09:18:11 +0000
committermartijn <martijn@openbsd.org>2016-05-27 09:18:11 +0000
commit721c3ea39d2f81e07c2d7c0976681cb89b2dd3b5 (patch)
tree1362d193ebe1830dff28275c067f2722d128ed30
parentsync (diff)
downloadwireguard-openbsd-721c3ea39d2f81e07c2d7c0976681cb89b2dd3b5.tar.xz
wireguard-openbsd-721c3ea39d2f81e07c2d7c0976681cb89b2dd3b5.zip
Revert CHAR_T removal. Some signedness flaws were introduced.
Found the hard way by jca@
-rw-r--r--usr.bin/vi/cl/cl.h4
-rw-r--r--usr.bin/vi/cl/cl_funcs.c6
-rw-r--r--usr.bin/vi/cl/cl_read.c6
-rw-r--r--usr.bin/vi/cl/cl_term.c10
-rw-r--r--usr.bin/vi/common/args.h4
-rw-r--r--usr.bin/vi/common/cut.c8
-rw-r--r--usr.bin/vi/common/cut.h6
-rw-r--r--usr.bin/vi/common/exf.c8
-rw-r--r--usr.bin/vi/common/gs.h12
-rw-r--r--usr.bin/vi/common/key.c50
-rw-r--r--usr.bin/vi/common/key.h20
-rw-r--r--usr.bin/vi/common/log.c102
-rw-r--r--usr.bin/vi/common/main.c6
-rw-r--r--usr.bin/vi/common/mark.c14
-rw-r--r--usr.bin/vi/common/mark.h4
-rw-r--r--usr.bin/vi/common/put.c9
-rw-r--r--usr.bin/vi/common/screen.h6
-rw-r--r--usr.bin/vi/common/seq.c32
-rw-r--r--usr.bin/vi/common/seq.h8
-rw-r--r--usr.bin/vi/common/util.c12
-rw-r--r--usr.bin/vi/docs/interp/interp19
-rw-r--r--usr.bin/vi/ex/ex.h6
-rw-r--r--usr.bin/vi/ex/ex_abbrev.c4
-rw-r--r--usr.bin/vi/ex/ex_append.c4
-rw-r--r--usr.bin/vi/ex/ex_argv.c4
-rw-r--r--usr.bin/vi/ex/ex_at.c4
-rw-r--r--usr.bin/vi/ex/ex_cd.c4
-rw-r--r--usr.bin/vi/ex/ex_display.c8
-rw-r--r--usr.bin/vi/ex/ex_file.c4
-rw-r--r--usr.bin/vi/ex/ex_global.c4
-rw-r--r--usr.bin/vi/ex/ex_map.c4
-rw-r--r--usr.bin/vi/ex/ex_print.c4
-rw-r--r--usr.bin/vi/ex/ex_read.c4
-rw-r--r--usr.bin/vi/ex/ex_script.c6
-rw-r--r--usr.bin/vi/ex/ex_subst.c4
-rw-r--r--usr.bin/vi/ex/ex_txt.c10
-rw-r--r--usr.bin/vi/include/cl_extern.h6
-rw-r--r--usr.bin/vi/include/com_extern.h32
-rw-r--r--usr.bin/vi/include/ex_extern.h4
-rw-r--r--usr.bin/vi/include/vi_extern.h8
-rw-r--r--usr.bin/vi/vi/v_at.c4
-rw-r--r--usr.bin/vi/vi/v_ch.c6
-rw-r--r--usr.bin/vi/vi/v_put.c4
-rw-r--r--usr.bin/vi/vi/v_txt.c36
-rw-r--r--usr.bin/vi/vi/v_ulcase.c12
-rw-r--r--usr.bin/vi/vi/vi.c10
-rw-r--r--usr.bin/vi/vi/vi.h18
-rw-r--r--usr.bin/vi/vi/vs_line.c5
-rw-r--r--usr.bin/vi/vi/vs_msg.c5
-rw-r--r--usr.bin/vi/vi/vs_split.c6
50 files changed, 292 insertions, 284 deletions
diff --git a/usr.bin/vi/cl/cl.h b/usr.bin/vi/cl/cl.h
index 4bb991b2a6f..5e5cdcb614c 100644
--- a/usr.bin/vi/cl/cl.h
+++ b/usr.bin/vi/cl/cl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl.h,v 1.9 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: cl.h,v 1.10 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -12,7 +12,7 @@
*/
typedef struct _cl_private {
- char ibuf[256]; /* Input keys. */
+ CHAR_T ibuf[256]; /* Input keys. */
int eof_count; /* EOF count. */
diff --git a/usr.bin/vi/cl/cl_funcs.c b/usr.bin/vi/cl/cl_funcs.c
index cb40374b462..4daa75e4360 100644
--- a/usr.bin/vi/cl/cl_funcs.c
+++ b/usr.bin/vi/cl/cl_funcs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl_funcs.c,v 1.19 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: cl_funcs.c,v 1.20 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -370,10 +370,10 @@ cl_insertln(SCR *sp)
* cl_keyval --
* Return the value for a special key.
*
- * PUBLIC: int cl_keyval(SCR *, scr_keyval_t, unsigned char *, int *);
+ * PUBLIC: int cl_keyval(SCR *, scr_keyval_t, CHAR_T *, int *);
*/
int
-cl_keyval(SCR *sp, scr_keyval_t val, unsigned char *chp, int *dnep)
+cl_keyval(SCR *sp, scr_keyval_t val, CHAR_T *chp, int *dnep)
{
CL_PRIVATE *clp;
diff --git a/usr.bin/vi/cl/cl_read.c b/usr.bin/vi/cl/cl_read.c
index fd2fc04de5e..3644684b65f 100644
--- a/usr.bin/vi/cl/cl_read.c
+++ b/usr.bin/vi/cl/cl_read.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl_read.c,v 1.20 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: cl_read.c,v 1.21 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -32,7 +32,7 @@
#include "cl.h"
static input_t cl_read(SCR *,
- u_int32_t, char *, size_t, int *, struct timeval *);
+ u_int32_t, CHAR_T *, size_t, int *, struct timeval *);
static int cl_resize(SCR *, size_t, size_t);
/*
@@ -123,7 +123,7 @@ retest: if (LF_ISSET(EC_INTERRUPT) || F_ISSET(clp, CL_SIGINT)) {
* Read characters from the input.
*/
static input_t
-cl_read(SCR *sp, u_int32_t flags, char *bp, size_t blen, int *nrp,
+cl_read(SCR *sp, u_int32_t flags, CHAR_T *bp, size_t blen, int *nrp,
struct timeval *tp)
{
struct termios term1, term2;
diff --git a/usr.bin/vi/cl/cl_term.c b/usr.bin/vi/cl/cl_term.c
index ee4cd32294b..7e0c7971b1d 100644
--- a/usr.bin/vi/cl/cl_term.c
+++ b/usr.bin/vi/cl/cl_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl_term.c,v 1.24 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: cl_term.c,v 1.25 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -30,7 +30,7 @@
#include "../common/common.h"
#include "cl.h"
-static int cl_pfmap(SCR *, seq_t, char *, size_t, char *, size_t);
+static int cl_pfmap(SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t);
/*
* XXX
@@ -152,10 +152,10 @@ cl_term_end(GS *gp)
* cl_fmap --
* Map a function key.
*
- * PUBLIC: int cl_fmap(SCR *, seq_t, char *, size_t, char *, size_t);
+ * PUBLIC: int cl_fmap(SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t);
*/
int
-cl_fmap(SCR *sp, seq_t stype, char *from, size_t flen, char *to,
+cl_fmap(SCR *sp, seq_t stype, CHAR_T *from, size_t flen, CHAR_T *to,
size_t tlen)
{
/* Ignore until the screen is running, do the real work then. */
@@ -172,7 +172,7 @@ cl_fmap(SCR *sp, seq_t stype, char *from, size_t flen, char *to,
* Map a function key (private version).
*/
static int
-cl_pfmap(SCR *sp, seq_t stype, char *from, size_t flen, char *to,
+cl_pfmap(SCR *sp, seq_t stype, CHAR_T *from, size_t flen, CHAR_T *to,
size_t tlen)
{
size_t nlen;
diff --git a/usr.bin/vi/common/args.h b/usr.bin/vi/common/args.h
index 738a28c2f06..272acef680d 100644
--- a/usr.bin/vi/common/args.h
+++ b/usr.bin/vi/common/args.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: args.h,v 1.4 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: args.h,v 1.5 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -22,7 +22,7 @@
* is found.
*/
typedef struct _args {
- char *bp; /* Argument. */
+ CHAR_T *bp; /* Argument. */
size_t blen; /* Buffer length. */
size_t len; /* Argument length. */
diff --git a/usr.bin/vi/common/cut.c b/usr.bin/vi/common/cut.c
index a7166944d08..78eab40cd11 100644
--- a/usr.bin/vi/common/cut.c
+++ b/usr.bin/vi/common/cut.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cut.c,v 1.15 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: cut.c,v 1.16 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -59,13 +59,13 @@ static void cb_rotate(SCR *);
* replacing the contents. Hopefully it's not worth getting right, and here
* we just treat the numeric buffers like any other named buffer.
*
- * PUBLIC: int cut(SCR *, char *, MARK *, MARK *, int);
+ * PUBLIC: int cut(SCR *, CHAR_T *, MARK *, MARK *, int);
*/
int
-cut(SCR *sp, char *namep, MARK *fm, MARK *tm, int flags)
+cut(SCR *sp, CHAR_T *namep, MARK *fm, MARK *tm, int flags)
{
CB *cbp;
- char name = '1'; /* default numeric buffer */
+ CHAR_T name = '1'; /* default numeric buffer */
recno_t lno;
int append, copy_one, copy_def;
diff --git a/usr.bin/vi/common/cut.h b/usr.bin/vi/common/cut.h
index 887db98f7a5..1b63c2e139e 100644
--- a/usr.bin/vi/common/cut.h
+++ b/usr.bin/vi/common/cut.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cut.h,v 1.8 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: cut.h,v 1.9 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -18,7 +18,7 @@ TAILQ_HEAD(_texth, _text);
struct _cb {
LIST_ENTRY(_cb) q; /* Linked list of cut buffers. */
TEXTH textq; /* Linked list of TEXT structures. */
- char name; /* Cut buffer name. */
+ CHAR_T name; /* Cut buffer name. */
size_t len; /* Total length of cut text. */
#define CB_LMODE 0x01 /* Cut was in line mode. */
@@ -65,7 +65,7 @@ struct _text { /* Text: a linked list of lines. */
* Translate upper-case buffer names to lower-case buffer names.
*/
#define CBNAME(sp, cbp, nch) { \
- char L__name; \
+ CHAR_T L__name; \
L__name = isupper(nch) ? tolower(nch) : (nch); \
LIST_FOREACH((cbp), &(sp)->gp->cutq, q) \
if ((cbp)->name == L__name) \
diff --git a/usr.bin/vi/common/exf.c b/usr.bin/vi/common/exf.c
index 2cf42270232..4a9e7d01010 100644
--- a/usr.bin/vi/common/exf.c
+++ b/usr.bin/vi/common/exf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exf.c,v 1.42 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: exf.c,v 1.43 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -54,10 +54,10 @@ static int file_spath(SCR *, FREF *, struct stat *, int *);
* vi now remembers the last location in any file that it has ever edited,
* not just the previously edited file.
*
- * PUBLIC: FREF *file_add(SCR *, char *);
+ * PUBLIC: FREF *file_add(SCR *, CHAR_T *);
*/
FREF *
-file_add(SCR *sp, char *name)
+file_add(SCR *sp, CHAR_T *name)
{
GS *gp;
FREF *frp, *tfrp;
@@ -446,7 +446,7 @@ oerr: if (F_ISSET(ep, F_RCV_ON))
static int
file_spath(SCR *sp, FREF *frp, struct stat *sbp, int *existsp)
{
- char savech;
+ CHAR_T savech;
size_t len;
int found;
char *name, *p, *t, path[PATH_MAX];
diff --git a/usr.bin/vi/common/gs.h b/usr.bin/vi/common/gs.h
index d52c077c7a8..03131824797 100644
--- a/usr.bin/vi/common/gs.h
+++ b/usr.bin/vi/common/gs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: gs.h,v 1.17 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: gs.h,v 1.18 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -74,7 +74,7 @@ struct _gs {
MSGH msgq; /* User message list. */
#define DEFAULT_NOPRINT '\1' /* Emergency non-printable character. */
- char noprint; /* Cached, unprintable character. */
+ CHAR_T noprint; /* Cached, unprintable character. */
char *tmp_bp; /* Temporary buffer. */
size_t tmp_blen; /* Temporary buffer size. */
@@ -118,7 +118,7 @@ struct _gs {
(sp)->gp->cname[(unsigned char)(ch)].name : \
v_key_name((sp), (ch)))
struct {
- char name[MAX_CHARACTER_COLUMNS + 1];
+ CHAR_T name[MAX_CHARACTER_COLUMNS + 1];
u_int8_t len;
} cname[MAX_FAST_KEY + 1]; /* Fast lookup table. */
@@ -127,7 +127,7 @@ struct _gs {
(sp)->gp->special_key[(unsigned char)(ch)] : \
(unsigned char)(ch) > (sp)->gp->max_special ? 0 : \
v_key_val((sp),(ch)))
- char max_special; /* Max special character. */
+ CHAR_T max_special; /* Max special character. */
u_char /* Fast lookup table. */
special_key[MAX_FAST_KEY + 1];
@@ -165,9 +165,9 @@ struct _gs {
/* Ex: screen adjustment routine. */
int (*scr_ex_adjust)(SCR *, exadj_t);
int (*scr_fmap) /* Set a function key. */
-(SCR *, seq_t, char *, size_t, char *, size_t);
+(SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t);
/* Get terminal key value. */
- int (*scr_keyval)(SCR *, scr_keyval_t, unsigned char *, int *);
+ int (*scr_keyval)(SCR *, scr_keyval_t, CHAR_T *, int *);
/* Insert a line. */
int (*scr_insertln)(SCR *);
/* Handle an option change. */
diff --git a/usr.bin/vi/common/key.c b/usr.bin/vi/common/key.c
index 240c7b8555b..08369cf400c 100644
--- a/usr.bin/vi/common/key.c
+++ b/usr.bin/vi/common/key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key.c,v 1.17 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: key.c,v 1.18 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -128,12 +128,12 @@ v_key_init(SCR *sp)
for (gp->max_special = 0, kp = keylist, cnt = nkeylist; cnt--; ++kp) {
if (gp->max_special < kp->value)
gp->max_special = kp->value;
- if ((unsigned char) kp->ch <= MAX_FAST_KEY)
- gp->special_key[(unsigned char) kp->ch] = kp->value;
+ if (kp->ch <= MAX_FAST_KEY)
+ gp->special_key[kp->ch] = kp->value;
}
/* Find a non-printable character to use as a message separator. */
- for (ch = 1; ch <= MAX_CHAR; ++ch)
+ for (ch = 1; ch <= MAX_CHAR_T; ++ch)
if (!isprint(ch)) {
gp->noprint = ch;
break;
@@ -157,7 +157,7 @@ static void
v_keyval(SCR *sp, int val, scr_keyval_t name)
{
KEYLIST *kp;
- unsigned char ch;
+ CHAR_T ch;
int dne;
/* Get the key's value from the screen. */
@@ -190,8 +190,7 @@ v_keyval(SCR *sp, int val, scr_keyval_t name)
void
v_key_ilookup(SCR *sp)
{
- char *p, *t;
- unsigned char ch;
+ CHAR_T ch, *p, *t;
GS *gp;
size_t len;
@@ -206,10 +205,10 @@ v_key_ilookup(SCR *sp)
* Return the length of the string that will display the key.
* This routine is the backup for the KEY_LEN() macro.
*
- * PUBLIC: size_t v_key_len(SCR *, char);
+ * PUBLIC: size_t v_key_len(SCR *, CHAR_T);
*/
size_t
-v_key_len(SCR *sp, char ch)
+v_key_len(SCR *sp, CHAR_T ch)
{
(void)v_key_name(sp, ch);
return (sp->clen);
@@ -220,14 +219,14 @@ v_key_len(SCR *sp, char ch)
* Return the string that will display the key. This routine
* is the backup for the KEY_NAME() macro.
*
- * PUBLIC: char *v_key_name(SCR *, char);
+ * PUBLIC: CHAR_T *v_key_name(SCR *, CHAR_T);
*/
-char *
-v_key_name(SCR *sp, char ch)
+CHAR_T *
+v_key_name(SCR *sp, CHAR_T ch)
{
- static const char hexdigit[] = "0123456789abcdef";
- static const char octdigit[] = "01234567";
- char *chp, mask;
+ static const CHAR_T hexdigit[] = "0123456789abcdef";
+ static const CHAR_T octdigit[] = "01234567";
+ CHAR_T *chp, mask;
size_t len;
int cnt, shift;
@@ -253,7 +252,7 @@ v_key_name(SCR *sp, char ch)
* told that this is a reasonable assumption...
*
* XXX
- * This code will only work with chars that are multiples of 8-bit
+ * This code will only work with CHAR_T's that are multiples of 8-bit
* bytes.
*
* XXX
@@ -270,7 +269,7 @@ nopr: if (iscntrl(ch) && (ch < 0x20 || ch == 0x7f)) {
sp->cname[1] = ch == 0x7f ? '?' : '@' + ch;
len = 2;
} else if (O_ISSET(sp, O_OCTAL)) {
-#define BITS (sizeof(char) * 8)
+#define BITS (sizeof(CHAR_T) * 8)
#define SHIFT (BITS - BITS % 3)
#define TOPMASK (BITS % 3 == 2 ? 3 : 1) << (BITS - BITS % 3)
sp->cname[0] = '\\';
@@ -282,8 +281,8 @@ nopr: if (iscntrl(ch) && (ch < 0x20 || ch == 0x7f)) {
} else {
sp->cname[0] = '\\';
sp->cname[1] = 'x';
- for (len = 2, chp = &ch,
- cnt = sizeof(char); cnt-- > 0; ++chp) {
+ for (len = 2, chp = (u_int8_t *)&ch,
+ cnt = sizeof(CHAR_T); cnt-- > 0; ++chp) {
sp->cname[len++] = hexdigit[(*chp & 0xf0) >> 4];
sp->cname[len++] = hexdigit[*chp & 0x0f];
}
@@ -297,10 +296,10 @@ done: sp->cname[sp->clen = len] = '\0';
* Fill in the value for a key. This routine is the backup
* for the KEY_VAL() macro.
*
- * PUBLIC: int v_key_val(SCR *, char);
+ * PUBLIC: int v_key_val(SCR *, CHAR_T);
*/
int
-v_key_val(SCR *sp, char ch)
+v_key_val(SCR *sp, CHAR_T ch)
{
KEYLIST k, *kp;
@@ -319,10 +318,10 @@ v_key_val(SCR *sp, char ch)
* an associated flag value, which indicates if it has already been quoted,
* and if it is the result of a mapping or an abbreviation.
*
- * PUBLIC: int v_event_push(SCR *, EVENT *, char *, size_t, u_int);
+ * PUBLIC: int v_event_push(SCR *, EVENT *, CHAR_T *, size_t, u_int);
*/
int
-v_event_push(SCR *sp, EVENT *p_evp, char *p_s, size_t nitems, u_int flags)
+v_event_push(SCR *sp, EVENT *p_evp, CHAR_T *p_s, size_t nitems, u_int flags)
{
EVENT *evp;
GS *gp;
@@ -373,7 +372,7 @@ copy: gp->i_cnt += nitems;
static int
v_event_append(SCR *sp, EVENT *argp)
{
- char *s; /* Characters. */
+ CHAR_T *s; /* Characters. */
EVENT *evp;
GS *gp;
size_t nevents; /* Number of events. */
@@ -596,8 +595,7 @@ newmap: evp = &gp->i_event[gp->i_next];
*/
if (istimeout || F_ISSET(&evp->e_ch, CH_NOMAP) ||
!LF_ISSET(EC_MAPCOMMAND | EC_MAPINPUT) ||
- ((unsigned char) evp->e_c < MAX_BIT_SEQ && !bit_test(gp->seqb,
- evp->e_c)))
+ (evp->e_c < MAX_BIT_SEQ && !bit_test(gp->seqb, evp->e_c)))
goto nomap;
/* Search the map. */
diff --git a/usr.bin/vi/common/key.h b/usr.bin/vi/common/key.h
index 101a53a5644..b0cbd21efd8 100644
--- a/usr.bin/vi/common/key.h
+++ b/usr.bin/vi/common/key.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: key.h,v 1.7 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: key.h,v 1.8 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -12,9 +12,15 @@
*/
/*
- * MAX_CHAR The maximum value of any character.
+ * Fundamental character types.
+ *
+ * CHAR_T An integral type that can hold any character.
+ * MAX_CHAR_T The maximum value of any character.
+ *
+ * If no integral type can hold a character, don't even try the port.
*/
-#define MAX_CHAR 0xff
+typedef u_char CHAR_T;
+#define MAX_CHAR_T 0xff
/* The maximum number of columns any character can take up on a screen. */
#define MAX_CHARACTER_COLUMNS 4
@@ -75,7 +81,7 @@ struct _event {
e_event_t e_event; /* Event type. */
union {
struct { /* Input character. */
- char c; /* Character. */
+ CHAR_T c; /* Character. */
e_key_t value; /* Key type. */
#define CH_ABBREVIATED 0x01 /* Character is from an abbreviation. */
@@ -103,8 +109,8 @@ struct _event {
#define e_tcno _u_event._e_mark.cno2
struct { /* Input string. */
- char *asp; /* Allocated string. */
- char *csp; /* String. */
+ CHAR_T *asp; /* Allocated string. */
+ CHAR_T *csp; /* String. */
size_t len; /* String length. */
} _e_str;
#define e_asp _u_event._e_str.asp
@@ -115,7 +121,7 @@ struct _event {
typedef struct _keylist {
e_key_t value; /* Special value. */
- char ch; /* Key. */
+ CHAR_T ch; /* Key. */
} KEYLIST;
extern KEYLIST keylist[];
diff --git a/usr.bin/vi/common/log.c b/usr.bin/vi/common/log.c
index 6833c794496..d94062a8445 100644
--- a/usr.bin/vi/common/log.c
+++ b/usr.bin/vi/common/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.9 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: log.c,v 1.10 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -64,7 +64,7 @@
static int log_cursor1(SCR *, int);
static void log_err(SCR *, char *, int);
#if defined(DEBUG) && 0
-static void log_trace(SCR *, char *, recno_t, char *);
+static void log_trace(SCR *, char *, recno_t, u_char *);
#endif
/* Try and restart the log on failure, i.e. if we run out of memory. */
@@ -175,14 +175,14 @@ log_cursor1(SCR *sp, int type)
EXF *ep;
ep = sp->ep;
- BINC_RET(sp, ep->l_lp, ep->l_len, sizeof(char) + sizeof(MARK));
+ BINC_RET(sp, ep->l_lp, ep->l_len, sizeof(u_char) + sizeof(MARK));
ep->l_lp[0] = type;
- memmove(ep->l_lp + sizeof(char), &ep->l_cursor, sizeof(MARK));
+ memmove(ep->l_lp + sizeof(u_char), &ep->l_cursor, sizeof(MARK));
key.data = &ep->l_cur;
key.size = sizeof(recno_t);
data.data = ep->l_lp;
- data.size = sizeof(char) + sizeof(MARK);
+ data.size = sizeof(u_char) + sizeof(MARK);
if (ep->log->put(ep->log, &key, &data, 0) == -1)
LOG_ERR;
@@ -249,15 +249,15 @@ log_line(SCR *sp, recno_t lno, u_int action)
if (db_get(sp, lno, DBG_FATAL, &lp, &len))
return (1);
BINC_RET(sp,
- ep->l_lp, ep->l_len, len + sizeof(char) + sizeof(recno_t));
+ ep->l_lp, ep->l_len, len + sizeof(u_char) + sizeof(recno_t));
ep->l_lp[0] = action;
- memmove(ep->l_lp + sizeof(char), &lno, sizeof(recno_t));
- memmove(ep->l_lp + sizeof(char) + sizeof(recno_t), lp, len);
+ memmove(ep->l_lp + sizeof(u_char), &lno, sizeof(recno_t));
+ memmove(ep->l_lp + sizeof(u_char) + sizeof(recno_t), lp, len);
key.data = &ep->l_cur;
key.size = sizeof(recno_t);
data.data = ep->l_lp;
- data.size = len + sizeof(char) + sizeof(recno_t);
+ data.size = len + sizeof(u_char) + sizeof(recno_t);
if (ep->log->put(ep->log, &key, &data, 0) == -1)
LOG_ERR;
@@ -318,14 +318,14 @@ log_mark(SCR *sp, LMARK *lmp)
}
BINC_RET(sp, ep->l_lp,
- ep->l_len, sizeof(char) + sizeof(LMARK));
+ ep->l_len, sizeof(u_char) + sizeof(LMARK));
ep->l_lp[0] = LOG_MARK;
- memmove(ep->l_lp + sizeof(char), lmp, sizeof(LMARK));
+ memmove(ep->l_lp + sizeof(u_char), lmp, sizeof(LMARK));
key.data = &ep->l_cur;
key.size = sizeof(recno_t);
data.data = ep->l_lp;
- data.size = sizeof(char) + sizeof(LMARK);
+ data.size = sizeof(u_char) + sizeof(LMARK);
if (ep->log->put(ep->log, &key, &data, 0) == -1)
LOG_ERR;
@@ -353,7 +353,7 @@ log_backward(SCR *sp, MARK *rp)
MARK m;
recno_t lno;
int didop;
- char *p;
+ u_char *p;
ep = sp->ep;
if (F_ISSET(ep, F_NOLOG)) {
@@ -378,10 +378,10 @@ log_backward(SCR *sp, MARK *rp)
#if defined(DEBUG) && 0
log_trace(sp, "log_backward", ep->l_cur, data.data);
#endif
- switch (*(p = data.data)) {
+ switch (*(p = (u_char *)data.data)) {
case LOG_CURSOR_INIT:
if (didop) {
- memmove(rp, p + sizeof(char), sizeof(MARK));
+ memmove(rp, p + sizeof(u_char), sizeof(MARK));
F_CLR(ep, F_NOLOG);
return (0);
}
@@ -391,16 +391,16 @@ log_backward(SCR *sp, MARK *rp)
case LOG_LINE_APPEND:
case LOG_LINE_INSERT:
didop = 1;
- memmove(&lno, p + sizeof(char), sizeof(recno_t));
+ memmove(&lno, p + sizeof(u_char), sizeof(recno_t));
if (db_delete(sp, lno))
goto err;
++sp->rptlines[L_DELETED];
break;
case LOG_LINE_DELETE:
didop = 1;
- memmove(&lno, p + sizeof(char), sizeof(recno_t));
- if (db_insert(sp, lno, p + sizeof(char) +
- sizeof(recno_t), data.size - sizeof(char) -
+ memmove(&lno, p + sizeof(u_char), sizeof(recno_t));
+ if (db_insert(sp, lno, p + sizeof(u_char) +
+ sizeof(recno_t), data.size - sizeof(u_char) -
sizeof(recno_t)))
goto err;
++sp->rptlines[L_ADDED];
@@ -409,9 +409,9 @@ log_backward(SCR *sp, MARK *rp)
break;
case LOG_LINE_RESET_B:
didop = 1;
- memmove(&lno, p + sizeof(char), sizeof(recno_t));
- if (db_set(sp, lno, p + sizeof(char) +
- sizeof(recno_t), data.size - sizeof(char) -
+ memmove(&lno, p + sizeof(u_char), sizeof(recno_t));
+ if (db_set(sp, lno, p + sizeof(u_char) +
+ sizeof(recno_t), data.size - sizeof(u_char) -
sizeof(recno_t)))
goto err;
if (sp->rptlchange != lno) {
@@ -421,7 +421,7 @@ log_backward(SCR *sp, MARK *rp)
break;
case LOG_MARK:
didop = 1;
- memmove(&lm, p + sizeof(char), sizeof(LMARK));
+ memmove(&lm, p + sizeof(u_char), sizeof(LMARK));
m.lno = lm.lno;
m.cno = lm.cno;
if (mark_set(sp, lm.name, &m, 0))
@@ -456,7 +456,7 @@ log_setline(SCR *sp)
LMARK lm;
MARK m;
recno_t lno;
- char *p;
+ u_char *p;
ep = sp->ep;
if (F_ISSET(ep, F_NOLOG)) {
@@ -480,16 +480,16 @@ log_setline(SCR *sp)
#if defined(DEBUG) && 0
log_trace(sp, "log_setline", ep->l_cur, data.data);
#endif
- switch (*(p = data.data)) {
+ switch (*(p = (u_char *)data.data)) {
case LOG_CURSOR_INIT:
- memmove(&m, p + sizeof(char), sizeof(MARK));
+ memmove(&m, p + sizeof(u_char), sizeof(MARK));
if (m.lno != sp->lno || ep->l_cur == 1) {
F_CLR(ep, F_NOLOG);
return (0);
}
break;
case LOG_CURSOR_END:
- memmove(&m, p + sizeof(char), sizeof(MARK));
+ memmove(&m, p + sizeof(u_char), sizeof(MARK));
if (m.lno != sp->lno) {
++ep->l_cur;
F_CLR(ep, F_NOLOG);
@@ -502,10 +502,10 @@ log_setline(SCR *sp)
case LOG_LINE_RESET_F:
break;
case LOG_LINE_RESET_B:
- memmove(&lno, p + sizeof(char), sizeof(recno_t));
+ memmove(&lno, p + sizeof(u_char), sizeof(recno_t));
if (lno == sp->lno &&
- db_set(sp, lno, p + sizeof(char) +
- sizeof(recno_t), data.size - sizeof(char) -
+ db_set(sp, lno, p + sizeof(u_char) +
+ sizeof(recno_t), data.size - sizeof(u_char) -
sizeof(recno_t)))
goto err;
if (sp->rptlchange != lno) {
@@ -513,7 +513,7 @@ log_setline(SCR *sp)
++sp->rptlines[L_CHANGED];
}
case LOG_MARK:
- memmove(&lm, p + sizeof(char), sizeof(LMARK));
+ memmove(&lm, p + sizeof(u_char), sizeof(LMARK));
m.lno = lm.lno;
m.cno = lm.cno;
if (mark_set(sp, lm.name, &m, 0))
@@ -543,7 +543,7 @@ log_forward(SCR *sp, MARK *rp)
MARK m;
recno_t lno;
int didop;
- char *p;
+ u_char *p;
ep = sp->ep;
if (F_ISSET(ep, F_NOLOG)) {
@@ -568,11 +568,11 @@ log_forward(SCR *sp, MARK *rp)
#if defined(DEBUG) && 0
log_trace(sp, "log_forward", ep->l_cur, data.data);
#endif
- switch (*(p = data.data)) {
+ switch (*(p = (u_char *)data.data)) {
case LOG_CURSOR_END:
if (didop) {
++ep->l_cur;
- memmove(rp, p + sizeof(char), sizeof(MARK));
+ memmove(rp, p + sizeof(u_char), sizeof(MARK));
F_CLR(ep, F_NOLOG);
return (0);
}
@@ -582,16 +582,16 @@ log_forward(SCR *sp, MARK *rp)
case LOG_LINE_APPEND:
case LOG_LINE_INSERT:
didop = 1;
- memmove(&lno, p + sizeof(char), sizeof(recno_t));
- if (db_insert(sp, lno, p + sizeof(char) +
- sizeof(recno_t), data.size - sizeof(char) -
+ memmove(&lno, p + sizeof(u_char), sizeof(recno_t));
+ if (db_insert(sp, lno, p + sizeof(u_char) +
+ sizeof(recno_t), data.size - sizeof(u_char) -
sizeof(recno_t)))
goto err;
++sp->rptlines[L_ADDED];
break;
case LOG_LINE_DELETE:
didop = 1;
- memmove(&lno, p + sizeof(char), sizeof(recno_t));
+ memmove(&lno, p + sizeof(u_char), sizeof(recno_t));
if (db_delete(sp, lno))
goto err;
++sp->rptlines[L_DELETED];
@@ -600,9 +600,9 @@ log_forward(SCR *sp, MARK *rp)
break;
case LOG_LINE_RESET_F:
didop = 1;
- memmove(&lno, p + sizeof(char), sizeof(recno_t));
- if (db_set(sp, lno, p + sizeof(char) +
- sizeof(recno_t), data.size - sizeof(char) -
+ memmove(&lno, p + sizeof(u_char), sizeof(recno_t));
+ if (db_set(sp, lno, p + sizeof(u_char) +
+ sizeof(recno_t), data.size - sizeof(u_char) -
sizeof(recno_t)))
goto err;
if (sp->rptlchange != lno) {
@@ -612,7 +612,7 @@ log_forward(SCR *sp, MARK *rp)
break;
case LOG_MARK:
didop = 1;
- memmove(&lm, p + sizeof(char), sizeof(LMARK));
+ memmove(&lm, p + sizeof(u_char), sizeof(LMARK));
m.lno = lm.lno;
m.cno = lm.cno;
if (mark_set(sp, lm.name, &m, 0))
@@ -645,7 +645,7 @@ log_err(SCR *sp, char *file, int line)
#if defined(DEBUG) && 0
static void
-log_trace(SCR *sp, char *msg, recno_t rno, char *p)
+log_trace(SCR *sp, char *msg, recno_t rno, u_char *p)
{
LMARK lm;
MARK m;
@@ -653,35 +653,35 @@ log_trace(SCR *sp, char *msg, recno_t rno, char *p)
switch (*p) {
case LOG_CURSOR_INIT:
- memmove(&m, p + sizeof(char), sizeof(MARK));
+ memmove(&m, p + sizeof(u_char), sizeof(MARK));
TRACE(sp, "%lu: %s: C_INIT: %u/%u\n", rno, msg, m.lno, m.cno);
break;
case LOG_CURSOR_END:
- memmove(&m, p + sizeof(char), sizeof(MARK));
+ memmove(&m, p + sizeof(u_char), sizeof(MARK));
TRACE(sp, "%lu: %s: C_END: %u/%u\n", rno, msg, m.lno, m.cno);
break;
case LOG_LINE_APPEND:
- memmove(&lno, p + sizeof(char), sizeof(recno_t));
+ memmove(&lno, p + sizeof(u_char), sizeof(recno_t));
TRACE(sp, "%lu: %s: APPEND: %lu\n", rno, msg, lno);
break;
case LOG_LINE_INSERT:
- memmove(&lno, p + sizeof(char), sizeof(recno_t));
+ memmove(&lno, p + sizeof(u_char), sizeof(recno_t));
TRACE(sp, "%lu: %s: INSERT: %lu\n", rno, msg, lno);
break;
case LOG_LINE_DELETE:
- memmove(&lno, p + sizeof(char), sizeof(recno_t));
+ memmove(&lno, p + sizeof(u_char), sizeof(recno_t));
TRACE(sp, "%lu: %s: DELETE: %lu\n", rno, msg, lno);
break;
case LOG_LINE_RESET_F:
- memmove(&lno, p + sizeof(char), sizeof(recno_t));
+ memmove(&lno, p + sizeof(u_char), sizeof(recno_t));
TRACE(sp, "%lu: %s: RESET_F: %lu\n", rno, msg, lno);
break;
case LOG_LINE_RESET_B:
- memmove(&lno, p + sizeof(char), sizeof(recno_t));
+ memmove(&lno, p + sizeof(u_char), sizeof(recno_t));
TRACE(sp, "%lu: %s: RESET_B: %lu\n", rno, msg, lno);
break;
case LOG_MARK:
- memmove(&lm, p + sizeof(char), sizeof(LMARK));
+ memmove(&lm, p + sizeof(u_char), sizeof(LMARK));
TRACE(sp,
"%lu: %s: MARK: %u/%u\n", rno, msg, lm.lno, lm.cno);
break;
diff --git a/usr.bin/vi/common/main.c b/usr.bin/vi/common/main.c
index 91db1cdcc4d..f20e4fde002 100644
--- a/usr.bin/vi/common/main.c
+++ b/usr.bin/vi/common/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.37 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: main.c,v 1.38 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -275,7 +275,7 @@ editor(GS *gp, int argc, char *argv[])
if (wsizearg != NULL) {
ARGS *av[2], a, b;
(void)snprintf(path, sizeof(path), "window=%s", wsizearg);
- a.bp = path;
+ a.bp = (CHAR_T *)path;
a.len = strlen(path);
b.bp = NULL;
b.len = 0;
@@ -380,7 +380,7 @@ editor(GS *gp, int argc, char *argv[])
if ((frp = file_add(sp, NULL)) == NULL)
goto err;
} else {
- if ((frp = file_add(sp, sp->argv[0])) == NULL)
+ if ((frp = file_add(sp, (CHAR_T *)sp->argv[0])) == NULL)
goto err;
if (F_ISSET(sp, SC_ARGRECOVER))
F_SET(frp, FR_RECOVER);
diff --git a/usr.bin/vi/common/mark.c b/usr.bin/vi/common/mark.c
index ac1dce9a13c..cd5d387fd89 100644
--- a/usr.bin/vi/common/mark.c
+++ b/usr.bin/vi/common/mark.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mark.c,v 1.13 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: mark.c,v 1.14 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -23,7 +23,7 @@
#include "common.h"
-static LMARK *mark_find(SCR *, char);
+static LMARK *mark_find(SCR *, CHAR_T);
/*
* Marks are maintained in a key sorted doubly linked list. We can't
@@ -101,10 +101,10 @@ mark_end(SCR *sp, EXF *ep)
* mark_get --
* Get the location referenced by a mark.
*
- * PUBLIC: int mark_get(SCR *, char, MARK *, mtype_t);
+ * PUBLIC: int mark_get(SCR *, CHAR_T, MARK *, mtype_t);
*/
int
-mark_get(SCR *sp, char key, MARK *mp, mtype_t mtype)
+mark_get(SCR *sp, CHAR_T key, MARK *mp, mtype_t mtype)
{
LMARK *lmp;
@@ -142,10 +142,10 @@ mark_get(SCR *sp, char key, MARK *mp, mtype_t mtype)
* mark_set --
* Set the location referenced by a mark.
*
- * PUBLIC: int mark_set(SCR *, char, MARK *, int);
+ * PUBLIC: int mark_set(SCR *, CHAR_T, MARK *, int);
*/
int
-mark_set(SCR *sp, char key, MARK *value, int userset)
+mark_set(SCR *sp, CHAR_T key, MARK *value, int userset)
{
LMARK *lmp, *lmt;
@@ -183,7 +183,7 @@ mark_set(SCR *sp, char key, MARK *value, int userset)
* where it would go.
*/
static LMARK *
-mark_find(SCR *sp, char key)
+mark_find(SCR *sp, CHAR_T key)
{
LMARK *lmp, *lastlmp;
diff --git a/usr.bin/vi/common/mark.h b/usr.bin/vi/common/mark.h
index 53aa815b4ef..c6006e9af6a 100644
--- a/usr.bin/vi/common/mark.h
+++ b/usr.bin/vi/common/mark.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mark.h,v 1.4 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: mark.h,v 1.5 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -33,7 +33,7 @@ struct _lmark {
LIST_ENTRY(_lmark) q; /* Linked list of marks. */
recno_t lno; /* Line number. */
size_t cno; /* Column number. */
- char name; /* Mark name. */
+ CHAR_T name; /* Mark name. */
#define MARK_DELETED 0x01 /* Mark was deleted. */
#define MARK_USERSET 0x02 /* User set this mark. */
diff --git a/usr.bin/vi/common/put.c b/usr.bin/vi/common/put.c
index 38508c79592..18a2172fdea 100644
--- a/usr.bin/vi/common/put.c
+++ b/usr.bin/vi/common/put.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: put.c,v 1.15 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: put.c,v 1.16 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -27,16 +27,17 @@
* put --
* Put text buffer contents into the file.
*
- * PUBLIC: int put(SCR *, CB *, char *, MARK *, MARK *, int);
+ * PUBLIC: int put(SCR *, CB *, CHAR_T *, MARK *, MARK *, int);
*/
int
-put(SCR *sp, CB *cbp, char *namep, MARK *cp, MARK *rp, int append)
+put(SCR *sp, CB *cbp, CHAR_T *namep, MARK *cp, MARK *rp, int append)
{
+ CHAR_T name;
TEXT *ltp, *tp;
recno_t lno;
size_t blen, clen, len;
int rval;
- char name, *bp, *p, *t;
+ char *bp, *p, *t;
if (cbp == NULL) {
if (namep == NULL) {
diff --git a/usr.bin/vi/common/screen.h b/usr.bin/vi/common/screen.h
index 592ace39081..4fdf33bdc26 100644
--- a/usr.bin/vi/common/screen.h
+++ b/usr.bin/vi/common/screen.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen.h,v 1.9 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: screen.h,v 1.10 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -82,7 +82,7 @@ struct _scr {
recno_t defscroll; /* Vi: ^D, ^U scroll information. */
/* Display character. */
- char cname[MAX_CHARACTER_COLUMNS + 1];
+ CHAR_T cname[MAX_CHARACTER_COLUMNS + 1];
size_t clen; /* Length of display character. */
enum { /* Vi editor mode. */
@@ -95,7 +95,7 @@ struct _scr {
/* PARTIALLY OR COMPLETELY COPIED FROM PREVIOUS SCREEN. */
char *alt_name; /* Ex/vi: alternate file name. */
- char at_lbuf; /* Ex/vi: Last executed at buffer. */
+ CHAR_T at_lbuf; /* Ex/vi: Last executed at buffer. */
/* Ex/vi: re_compile flags. */
#define RE_C_SEARCH 0x0002 /* Compile search replacement. */
diff --git a/usr.bin/vi/common/seq.c b/usr.bin/vi/common/seq.c
index c158dc8052f..50cfda28a20 100644
--- a/usr.bin/vi/common/seq.c
+++ b/usr.bin/vi/common/seq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: seq.c,v 1.12 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: seq.c,v 1.13 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -29,14 +29,14 @@
* seq_set --
* Internal version to enter a sequence.
*
- * PUBLIC: int seq_set(SCR *, char *,
- * PUBLIC: size_t, char *, size_t, char *, size_t, seq_t, int);
+ * PUBLIC: int seq_set(SCR *, CHAR_T *,
+ * PUBLIC: size_t, CHAR_T *, size_t, CHAR_T *, size_t, seq_t, int);
*/
int
-seq_set(SCR *sp, char *name, size_t nlen, char *input, size_t ilen,
- char *output, size_t olen, seq_t stype, int flags)
+seq_set(SCR *sp, CHAR_T *name, size_t nlen, CHAR_T *input, size_t ilen,
+ CHAR_T *output, size_t olen, seq_t stype, int flags)
{
- char *p;
+ CHAR_T *p;
SEQ *lastqp, *qp;
int sv_errno;
@@ -116,7 +116,7 @@ mem1: errno = sv_errno;
}
/* Set the fast lookup bit. */
- if ((unsigned char) qp->input[0] < MAX_BIT_SEQ)
+ if (qp->input[0] < MAX_BIT_SEQ)
bit_set(sp->gp->seqb, qp->input[0]);
return (0);
@@ -126,10 +126,10 @@ mem1: errno = sv_errno;
* seq_delete --
* Delete a sequence.
*
- * PUBLIC: int seq_delete(SCR *, char *, size_t, seq_t);
+ * PUBLIC: int seq_delete(SCR *, CHAR_T *, size_t, seq_t);
*/
int
-seq_delete(SCR *sp, char *input, size_t ilen, seq_t stype)
+seq_delete(SCR *sp, CHAR_T *input, size_t ilen, seq_t stype)
{
SEQ *qp;
@@ -163,10 +163,10 @@ seq_mdel(SEQ *qp)
* isn't NULL, partial matches count.
*
* PUBLIC: SEQ *seq_find
- * PUBLIC:(SCR *, SEQ **, EVENT *, char *, size_t, seq_t, int *);
+ * PUBLIC:(SCR *, SEQ **, EVENT *, CHAR_T *, size_t, seq_t, int *);
*/
SEQ *
-seq_find(SCR *sp, SEQ **lastqp, EVENT *e_input, char *c_input, size_t ilen,
+seq_find(SCR *sp, SEQ **lastqp, EVENT *e_input, CHAR_T *c_input, size_t ilen,
seq_t stype, int *ispartialp)
{
SEQ *lqp, *qp;
@@ -270,7 +270,7 @@ seq_close(GS *gp)
int
seq_dump(SCR *sp, seq_t stype, int isname)
{
- char *p;
+ CHAR_T *p;
GS *gp;
SEQ *qp;
int cnt, len, olen;
@@ -315,7 +315,7 @@ seq_dump(SCR *sp, seq_t stype, int isname)
int
seq_save(SCR *sp, FILE *fp, char *prefix, seq_t stype)
{
- char *p;
+ CHAR_T *p;
SEQ *qp;
size_t olen;
int ch;
@@ -350,12 +350,12 @@ seq_save(SCR *sp, FILE *fp, char *prefix, seq_t stype)
/*
* e_memcmp --
- * Compare a string of EVENT's to a string of chars.
+ * Compare a string of EVENT's to a string of CHAR_T's.
*
- * PUBLIC: int e_memcmp(char *, EVENT *, size_t);
+ * PUBLIC: int e_memcmp(CHAR_T *, EVENT *, size_t);
*/
int
-e_memcmp(char *p1, EVENT *ep, size_t n)
+e_memcmp(CHAR_T *p1, EVENT *ep, size_t n)
{
if (n != 0) {
do {
diff --git a/usr.bin/vi/common/seq.h b/usr.bin/vi/common/seq.h
index ec7412f6add..c53fccb787a 100644
--- a/usr.bin/vi/common/seq.h
+++ b/usr.bin/vi/common/seq.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: seq.h,v 1.4 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: seq.h,v 1.5 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -31,11 +31,11 @@
struct _seq {
LIST_ENTRY(_seq) q; /* Linked list of all sequences. */
seq_t stype; /* Sequence type. */
- char *name; /* Sequence name (if any). */
+ CHAR_T *name; /* Sequence name (if any). */
size_t nlen; /* Name length. */
- char *input; /* Sequence input keys. */
+ CHAR_T *input; /* Sequence input keys. */
size_t ilen; /* Input keys length. */
- char *output; /* Sequence output keys. */
+ CHAR_T *output; /* Sequence output keys. */
size_t olen; /* Output keys length. */
#define SEQ_FUNCMAP 0x01 /* If unresolved function key.*/
diff --git a/usr.bin/vi/common/util.c b/usr.bin/vi/common/util.c
index e3ced3e1751..f64bde0a3d5 100644
--- a/usr.bin/vi/common/util.c
+++ b/usr.bin/vi/common/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.14 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: util.c,v 1.15 2016/05/27 09:18:11 martijn Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -100,17 +100,17 @@ nonblank(SCR *sp, recno_t lno, size_t *cnop)
* v_strdup --
* Strdup for wide character strings with an associated length.
*
- * PUBLIC: char *v_strdup(SCR *, const char *, size_t);
+ * PUBLIC: CHAR_T *v_strdup(SCR *, const CHAR_T *, size_t);
*/
-char *
-v_strdup(SCR *sp, const char *str, size_t len)
+CHAR_T *
+v_strdup(SCR *sp, const CHAR_T *str, size_t len)
{
- char *copy;
+ CHAR_T *copy;
MALLOC(sp, copy, len + 1);
if (copy == NULL)
return (NULL);
- memcpy(copy, str, len);
+ memcpy(copy, str, len * sizeof(CHAR_T));
copy[len] = '\0';
return (copy);
}
diff --git a/usr.bin/vi/docs/interp/interp b/usr.bin/vi/docs/interp/interp
index a92d06048bb..ba88588705f 100644
--- a/usr.bin/vi/docs/interp/interp
+++ b/usr.bin/vi/docs/interp/interp
@@ -1,4 +1,4 @@
-# $OpenBSD: interp,v 1.4 2016/05/02 18:24:25 martijn Exp $
+# $OpenBSD: interp,v 1.5 2016/05/27 09:18:11 martijn Exp $
# @(#)interp 8.5 (Berkeley) 10/19/96
Nvi Interpreter API
@@ -80,12 +80,12 @@ Interpreter functions in nvi:
5: Function to manipulate cut buffers.
- int inter_setbuf(SCR *, char buffer);
+ int inter_setbuf(SCR *, CHAR_T buffer);
Create the specified buffer if it does not exist (the
buffer will have no contents).
- int inter_getbuf(SCR *, char buffer, TEXT **textp);
+ int inter_getbuf(SCR *, CHAR_T buffer, TEXT **textp);
Return a pointer to the specified buffer in the location
referenced by textp. (Since a pointer to the real item
@@ -94,12 +94,12 @@ Interpreter functions in nvi:
6: Functions to manipulate marks.
- int inter_setmark(SCR *, char name);
+ int inter_setmark(SCR *, CHAR_T name);
Create the specified mark if it does not exist (the
mark will have no contents).
- int inter_getmark(SCR *, char name, MARK **markp);
+ int inter_getmark(SCR *, CHAR_T name, MARK **markp);
Return a pointer to the specified mark in the location
referenced by markp. (Since a pointer to the real item
@@ -118,20 +118,21 @@ Interpreter functions in nvi:
8: Functions to get input from the user.
- int inter_getchar(char *chp, enum maptype {NONE, INPUT, COMMAND} mapt);
+ int inter_getchar(CHAR_T *chp,
+ enum maptype {NONE, INPUT, COMMAND} mapt);
Return a character from the keyboard into the location referenced
by chp. Mapt can be set to INPUT, COMMAND or NONE, depending on
what vi mappings should be applied to the character.
- int inter_getline(SCR *, char *prompt, char **linep,
+ int inter_getline(SCR *, char *prompt, CHAR_T **linep,
size_t *lenp, enum maptype {NONE, INPUT, COMMAND} mapt);
Return a pointer to a line entered by the user, and its length,
into the locations linep and lenp. A prompt may be specified
by prompt, and mappings by mapt.
- int inter_freeline(char *linep);
+ int inter_freeline(CHAR_T *linep);
Free the memory that was allocated by inter_getline();
@@ -187,5 +188,5 @@ Interpreter functions in nvi:
int inter_vi(
SCR *, /* Current screen. */
- char buffer, /* Buffer. */
+ CHAR_T buffer, /* Buffer. */
int count); /* Count. */
diff --git a/usr.bin/vi/ex/ex.h b/usr.bin/vi/ex/ex.h
index e64cf3ff322..769a2069b5b 100644
--- a/usr.bin/vi/ex/ex.h
+++ b/usr.bin/vi/ex/ex.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex.h,v 1.10 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: ex.h,v 1.11 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -110,7 +110,7 @@ struct _excmd {
F_SET((cmdp), L__f); \
}
- char buffer; /* Command: named buffer. */
+ CHAR_T buffer; /* Command: named buffer. */
recno_t lineno; /* Command: line number. */
long count; /* Command: signed count. */
long flagoff; /* Command: signed flag offset. */
@@ -163,7 +163,7 @@ typedef struct _ex_private {
TAILQ_HEAD(_tagfh, _tagf) tagfq;/* Tag file list. */
char *tag_last; /* Saved last tag string. */
- char *lastbcomm; /* Last bang command. */
+ CHAR_T *lastbcomm; /* Last bang command. */
ARGS **args; /* Command: argument list. */
int argscnt; /* Command: argument list count. */
diff --git a/usr.bin/vi/ex/ex_abbrev.c b/usr.bin/vi/ex/ex_abbrev.c
index d4d09058ada..d31da3e0983 100644
--- a/usr.bin/vi/ex/ex_abbrev.c
+++ b/usr.bin/vi/ex/ex_abbrev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_abbrev.c,v 1.8 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: ex_abbrev.c,v 1.9 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -34,7 +34,7 @@
int
ex_abbr(SCR *sp, EXCMD *cmdp)
{
- char *p;
+ CHAR_T *p;
size_t len;
switch (cmdp->argc) {
diff --git a/usr.bin/vi/ex/ex_append.c b/usr.bin/vi/ex/ex_append.c
index 89fc88f1f1d..fd3c43b0375 100644
--- a/usr.bin/vi/ex/ex_append.c
+++ b/usr.bin/vi/ex/ex_append.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_append.c,v 1.13 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: ex_append.c,v 1.14 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -71,7 +71,7 @@ ex_insert(SCR *sp, EXCMD *cmdp)
static int
ex_aci(SCR *sp, EXCMD *cmdp, enum which cmd)
{
- char *p, *t;
+ CHAR_T *p, *t;
GS *gp;
TEXT *tp;
TEXTH tiq;
diff --git a/usr.bin/vi/ex/ex_argv.c b/usr.bin/vi/ex/ex_argv.c
index 1b369a5a5db..e8a6c5afd7f 100644
--- a/usr.bin/vi/ex/ex_argv.c
+++ b/usr.bin/vi/ex/ex_argv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_argv.c,v 1.19 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: ex_argv.c,v 1.20 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -425,7 +425,7 @@ argv_alloc(SCR *sp, size_t len)
ap->len = 0;
if (ap->blen < len + 1) {
ap->blen = len + 1;
- REALLOC(sp, ap->bp, ap->blen);
+ REALLOCARRAY(sp, ap->bp, ap->blen, sizeof(CHAR_T));
if (ap->bp == NULL) {
ap->bp = NULL;
ap->blen = 0;
diff --git a/usr.bin/vi/ex/ex_at.c b/usr.bin/vi/ex/ex_at.c
index 6508744ed36..dd1b2b90813 100644
--- a/usr.bin/vi/ex/ex_at.c
+++ b/usr.bin/vi/ex/ex_at.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_at.c,v 1.13 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: ex_at.c,v 1.14 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -35,7 +35,7 @@ int
ex_at(SCR *sp, EXCMD *cmdp)
{
CB *cbp;
- char name;
+ CHAR_T name;
EXCMD *ecp;
RANGE *rp;
TEXT *tp;
diff --git a/usr.bin/vi/ex/ex_cd.c b/usr.bin/vi/ex/ex_cd.c
index b56843b0ebd..2c29892d7cc 100644
--- a/usr.bin/vi/ex/ex_cd.c
+++ b/usr.bin/vi/ex/ex_cd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_cd.c,v 1.14 2016/05/02 20:51:35 martijn Exp $ */
+/* $OpenBSD: ex_cd.c,v 1.15 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -35,7 +35,7 @@ ex_cd(SCR *sp, EXCMD *cmdp)
{
struct passwd *pw;
ARGS *ap;
- char savech;
+ CHAR_T savech;
char *dir, *p, *t;
char buf[PATH_MAX * 2];
diff --git a/usr.bin/vi/ex/ex_display.c b/usr.bin/vi/ex/ex_display.c
index 33698a62f0e..47d4ec509fb 100644
--- a/usr.bin/vi/ex/ex_display.c
+++ b/usr.bin/vi/ex/ex_display.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_display.c,v 1.12 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: ex_display.c,v 1.13 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -24,7 +24,7 @@
#include "tag.h"
static int bdisplay(SCR *);
-static void db(SCR *, CB *, char *);
+static void db(SCR *, CB *, CHAR_T *);
/*
* ex_display -- :display b[uffers] | s[creens] | t[ags]
@@ -107,9 +107,9 @@ bdisplay(SCR *sp)
* Display a buffer.
*/
static void
-db(SCR *sp, CB *cbp, char *name)
+db(SCR *sp, CB *cbp, CHAR_T *name)
{
- char *p;
+ CHAR_T *p;
TEXT *tp;
size_t len;
diff --git a/usr.bin/vi/ex/ex_file.c b/usr.bin/vi/ex/ex_file.c
index 3d3fc66bfbf..9639b8c0227 100644
--- a/usr.bin/vi/ex/ex_file.c
+++ b/usr.bin/vi/ex/ex_file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_file.c,v 1.8 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: ex_file.c,v 1.9 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -32,7 +32,7 @@
int
ex_file(SCR *sp, EXCMD *cmdp)
{
- char *p;
+ CHAR_T *p;
FREF *frp;
NEEDFILE(sp, cmdp);
diff --git a/usr.bin/vi/ex/ex_global.c b/usr.bin/vi/ex/ex_global.c
index 1cbb61e1270..b9c97e46292 100644
--- a/usr.bin/vi/ex/ex_global.c
+++ b/usr.bin/vi/ex/ex_global.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_global.c,v 1.16 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: ex_global.c,v 1.17 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -61,7 +61,7 @@ ex_v(SCR *sp, EXCMD *cmdp)
static int
ex_g_setup(SCR *sp, EXCMD *cmdp, enum which cmd)
{
- char *ptrn, *p, *t;
+ CHAR_T *ptrn, *p, *t;
EXCMD *ecp;
MARK abs_mark;
RANGE *rp;
diff --git a/usr.bin/vi/ex/ex_map.c b/usr.bin/vi/ex/ex_map.c
index f92351bedbf..d1258745180 100644
--- a/usr.bin/vi/ex/ex_map.c
+++ b/usr.bin/vi/ex/ex_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_map.c,v 1.8 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: ex_map.c,v 1.9 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -43,7 +43,7 @@ int
ex_map(SCR *sp, EXCMD *cmdp)
{
seq_t stype;
- char *input, *p;
+ CHAR_T *input, *p;
stype = FL_ISSET(cmdp->iflags, E_C_FORCE) ? SEQ_INPUT : SEQ_COMMAND;
diff --git a/usr.bin/vi/ex/ex_print.c b/usr.bin/vi/ex/ex_print.c
index 76090eea6a1..68d9bb21afc 100644
--- a/usr.bin/vi/ex/ex_print.c
+++ b/usr.bin/vi/ex/ex_print.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_print.c,v 1.12 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: ex_print.c,v 1.13 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -196,7 +196,7 @@ static int
ex_prchars(SCR *sp, const char *p, size_t *colp, size_t len, u_int flags,
int repeatc)
{
- char ch, *kp;
+ CHAR_T ch, *kp;
size_t col, tlen, ts;
if (O_ISSET(sp, O_LIST))
diff --git a/usr.bin/vi/ex/ex_read.c b/usr.bin/vi/ex/ex_read.c
index 2ec79faf9af..7457698060f 100644
--- a/usr.bin/vi/ex/ex_read.c
+++ b/usr.bin/vi/ex/ex_read.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_read.c,v 1.12 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: ex_read.c,v 1.13 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -42,7 +42,7 @@ ex_read(SCR *sp, EXCMD *cmdp)
{
enum { R_ARG, R_EXPANDARG, R_FILTER } which;
struct stat sb;
- char *arg, *name;
+ CHAR_T *arg, *name;
EX_PRIVATE *exp;
FILE *fp;
FREF *frp;
diff --git a/usr.bin/vi/ex/ex_script.c b/usr.bin/vi/ex/ex_script.c
index db98baef699..2b842919753 100644
--- a/usr.bin/vi/ex/ex_script.c
+++ b/usr.bin/vi/ex/ex_script.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_script.c,v 1.25 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: ex_script.c,v 1.26 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -185,7 +185,7 @@ err: if (sc->sh_master != -1)
static int
sscr_getprompt(SCR *sp)
{
- char *endp, *p, *t, buf[1024];
+ CHAR_T *endp, *p, *t, buf[1024];
SCRIPT *sc;
struct pollfd pfd[1];
recno_t lline;
@@ -481,7 +481,7 @@ done:
static int
sscr_insert(SCR *sp)
{
- char *endp, *p, *t;
+ CHAR_T *endp, *p, *t;
SCRIPT *sc;
struct pollfd pfd[1];
recno_t lno;
diff --git a/usr.bin/vi/ex/ex_subst.c b/usr.bin/vi/ex/ex_subst.c
index 8cd2c8a3f1c..75f485b1597 100644
--- a/usr.bin/vi/ex/ex_subst.c
+++ b/usr.bin/vi/ex/ex_subst.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_subst.c,v 1.27 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: ex_subst.c,v 1.28 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -1245,7 +1245,7 @@ re_sub(SCR *sp, char *ip, char **lbp, size_t *lbclenp, size_t *lblenp,
* all escaping characters. This (hopefully) matches historic practice.
*/
#define OUTCH(ch, nltrans) { \
- char __ch = (ch); \
+ CHAR_T __ch = (ch); \
u_int __value = KEY_VAL(sp, __ch); \
if ((nltrans) && (__value == K_CR || __value == K_NL)) { \
NEEDNEWLINE(sp); \
diff --git a/usr.bin/vi/ex/ex_txt.c b/usr.bin/vi/ex/ex_txt.c
index 548fd8d9184..10b3a0cc21c 100644
--- a/usr.bin/vi/ex/ex_txt.c
+++ b/usr.bin/vi/ex/ex_txt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_txt.c,v 1.15 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: ex_txt.c,v 1.16 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -42,16 +42,16 @@
*/
static int txt_dent(SCR *, TEXT *);
-static void txt_prompt(SCR *, TEXT *, char, u_int32_t);
+static void txt_prompt(SCR *, TEXT *, CHAR_T, u_int32_t);
/*
* ex_txt --
* Get lines from the terminal for ex.
*
- * PUBLIC: int ex_txt(SCR *, TEXTH *, char, u_int32_t);
+ * PUBLIC: int ex_txt(SCR *, TEXTH *, CHAR_T, u_int32_t);
*/
int
-ex_txt(SCR *sp, TEXTH *tiqh, char prompt, u_int32_t flags)
+ex_txt(SCR *sp, TEXTH *tiqh, CHAR_T prompt, u_int32_t flags)
{
EVENT ev;
GS *gp;
@@ -347,7 +347,7 @@ alloc_err:
* not ours.
*/
static void
-txt_prompt(SCR *sp, TEXT *tp, char prompt, u_int32_t flags)
+txt_prompt(SCR *sp, TEXT *tp, CHAR_T prompt, u_int32_t flags)
{
/* Display the prompt. */
if (LF_ISSET(TXT_PROMPT))
diff --git a/usr.bin/vi/include/cl_extern.h b/usr.bin/vi/include/cl_extern.h
index eda01875b7e..7fda833a368 100644
--- a/usr.bin/vi/include/cl_extern.h
+++ b/usr.bin/vi/include/cl_extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl_extern.h,v 1.8 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: cl_extern.h,v 1.9 2016/05/27 09:18:12 martijn Exp $ */
int cl_addstr(SCR *, const char *, size_t);
int cl_attr(SCR *, scr_attr_t, int);
@@ -9,7 +9,7 @@ int cl_cursor(SCR *, size_t *, size_t *);
int cl_deleteln(SCR *);
int cl_ex_adjust(SCR *, exadj_t);
int cl_insertln(SCR *);
-int cl_keyval(SCR *, scr_keyval_t, unsigned char *, int *);
+int cl_keyval(SCR *, scr_keyval_t, CHAR_T *, int *);
int cl_move(SCR *, size_t, size_t);
int cl_refresh(SCR *, int);
int cl_rename(SCR *, char *, int);
@@ -22,7 +22,7 @@ int cl_quit(GS *);
int cl_getcap(SCR *, char *, char **);
int cl_term_init(SCR *);
int cl_term_end(GS *);
-int cl_fmap(SCR *, seq_t, char *, size_t, char *, size_t);
+int cl_fmap(SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t);
int cl_optchange(SCR *, int, char *, u_long *);
int cl_omesg(SCR *, CL_PRIVATE *, int);
int cl_ssize(SCR *, int, size_t *, size_t *, int *);
diff --git a/usr.bin/vi/include/com_extern.h b/usr.bin/vi/include/com_extern.h
index 40d489e5ba2..9d98181b19b 100644
--- a/usr.bin/vi/include/com_extern.h
+++ b/usr.bin/vi/include/com_extern.h
@@ -1,13 +1,13 @@
-/* $OpenBSD: com_extern.h,v 1.13 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: com_extern.h,v 1.14 2016/05/27 09:18:12 martijn Exp $ */
-int cut(SCR *, char *, MARK *, MARK *, int);
+int cut(SCR *, CHAR_T *, MARK *, MARK *, int);
int cut_line(SCR *, recno_t, size_t, size_t, CB *);
void cut_close(GS *);
TEXT *text_init(SCR *, const char *, size_t, size_t);
void text_lfree(TEXTH *);
void text_free(TEXT *);
int del(SCR *, MARK *, MARK *, int);
-FREF *file_add(SCR *, char *);
+FREF *file_add(SCR *, CHAR_T *);
int file_init(SCR *, FREF *, char *, int);
int file_end(SCR *, EXF *, int);
int file_write(SCR *, MARK *, MARK *, char *, int);
@@ -19,10 +19,10 @@ void set_alt_name(SCR *, char *);
lockr_t file_lock(SCR *, char *, int *, int, int);
int v_key_init(SCR *);
void v_key_ilookup(SCR *);
-size_t v_key_len(SCR *, char);
-char *v_key_name(SCR *, char);
-int v_key_val(SCR *, char);
-int v_event_push(SCR *, EVENT *, char *, size_t, u_int);
+size_t v_key_len(SCR *, CHAR_T);
+CHAR_T *v_key_name(SCR *, CHAR_T);
+int v_key_val(SCR *, CHAR_T);
+int v_event_push(SCR *, EVENT *, CHAR_T *, size_t, u_int);
int v_event_get(SCR *, EVENT *, int, u_int32_t);
void v_event_err(SCR *, EVENT *);
int v_event_flush(SCR *, u_int);
@@ -47,8 +47,8 @@ int editor(GS *, int, char *[]);
void v_end(GS *);
int mark_init(SCR *, EXF *);
int mark_end(SCR *, EXF *);
-int mark_get(SCR *, char, MARK *, mtype_t);
-int mark_set(SCR *, char, MARK *, int);
+int mark_get(SCR *, CHAR_T, MARK *, mtype_t);
+int mark_set(SCR *, CHAR_T, MARK *, int);
int mark_insdel(SCR *, lnop_t, recno_t);
void msgq(SCR *, mtype_t, const char *, ...);
void msgq_str(SCR *, mtype_t, char *, char *);
@@ -81,7 +81,7 @@ int f_w300(SCR *, OPTION *, char *, u_long *);
int f_w1200(SCR *, OPTION *, char *, u_long *);
int f_w9600(SCR *, OPTION *, char *, u_long *);
int f_window(SCR *, OPTION *, char *, u_long *);
-int put(SCR *, CB *, char *, MARK *, MARK *, int);
+int put(SCR *, CB *, CHAR_T *, MARK *, MARK *, int);
int rcv_tmp(SCR *, EXF *, char *);
int rcv_init(SCR *);
int rcv_sync(SCR *, u_int);
@@ -93,19 +93,19 @@ SCR *screen_next(SCR *);
int f_search(SCR *, MARK *, MARK *, char *, size_t, char **, u_int);
int b_search(SCR *, MARK *, MARK *, char *, size_t, char **, u_int);
void search_busy(SCR *, busy_t);
-int seq_set(SCR *, char *,
- size_t, char *, size_t, char *, size_t, seq_t, int);
-int seq_delete(SCR *, char *, size_t, seq_t);
+int seq_set(SCR *, CHAR_T *,
+ size_t, CHAR_T *, size_t, CHAR_T *, size_t, seq_t, int);
+int seq_delete(SCR *, CHAR_T *, size_t, seq_t);
int seq_mdel(SEQ *);
SEQ *seq_find
-(SCR *, SEQ **, EVENT *, char *, size_t, seq_t, int *);
+(SCR *, SEQ **, EVENT *, CHAR_T *, size_t, seq_t, int *);
void seq_close(GS *);
int seq_dump(SCR *, seq_t, int);
int seq_save(SCR *, FILE *, char *, seq_t);
-int e_memcmp(char *, EVENT *, size_t);
+int e_memcmp(CHAR_T *, EVENT *, size_t);
void *binc(SCR *, void *, size_t *, size_t);
int nonblank(SCR *, recno_t, size_t *);
-char *v_strdup(SCR *, const char *, size_t);
+CHAR_T *v_strdup(SCR *, const CHAR_T *, size_t);
enum nresult nget_uslong(u_long *, const char *, char **, int);
enum nresult nget_slong(long *, const char *, char **, int);
void TRACE(SCR *, const char *, ...);
diff --git a/usr.bin/vi/include/ex_extern.h b/usr.bin/vi/include/ex_extern.h
index eed4060f2c3..8aa2b6b8268 100644
--- a/usr.bin/vi/include/ex_extern.h
+++ b/usr.bin/vi/include/ex_extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_extern.h,v 1.15 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: ex_extern.h,v 1.16 2016/05/27 09:18:12 martijn Exp $ */
int ex(SCR **);
int ex_cmd(SCR *);
@@ -100,7 +100,7 @@ int tagq_free(SCR *, TAGQ *);
void tag_msg(SCR *, tagmsg_t, char *);
int ex_tagf_alloc(SCR *, char *);
int ex_tag_free(SCR *);
-int ex_txt(SCR *, TEXTH *, char, u_int32_t);
+int ex_txt(SCR *, TEXTH *, CHAR_T, u_int32_t);
int ex_undo(SCR *, EXCMD *);
int ex_help(SCR *, EXCMD *);
int ex_usage(SCR *, EXCMD *);
diff --git a/usr.bin/vi/include/vi_extern.h b/usr.bin/vi/include/vi_extern.h
index d6edc7c0162..09c7327a844 100644
--- a/usr.bin/vi/include/vi_extern.h
+++ b/usr.bin/vi/include/vi_extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vi_extern.h,v 1.10 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: vi_extern.h,v 1.11 2016/05/27 09:18:12 martijn Exp $ */
int cs_init(SCR *, VCS *);
int cs_next(SCR *, VCS *);
@@ -83,9 +83,9 @@ int v_sectionb(SCR *, VICMD *);
int v_sentencef(SCR *, VICMD *);
int v_sentenceb(SCR *, VICMD *);
int v_status(SCR *, VICMD *);
-int v_tcmd(SCR *, VICMD *, char, u_int);
+int v_tcmd(SCR *, VICMD *, CHAR_T, u_int);
int v_txt(SCR *, VICMD *, MARK *,
- const char *, size_t, char, recno_t, u_long, u_int32_t);
+ const char *, size_t, CHAR_T, recno_t, u_long, u_int32_t);
int v_txt_auto(SCR *, recno_t, TEXT *, size_t, TEXT *);
int v_ulcase(SCR *, VICMD *);
int v_mulcase(SCR *, VICMD *);
@@ -138,7 +138,7 @@ int vs_sm_position(SCR *, MARK *, u_long, pos_t);
recno_t vs_sm_nlines(SCR *, SMAP *, recno_t, size_t);
int vs_split(SCR *, SCR *, int);
int vs_discard(SCR *, SCR **);
-int vs_fg(SCR *, SCR **, char *, int);
+int vs_fg(SCR *, SCR **, CHAR_T *, int);
int vs_bg(SCR *);
int vs_swap(SCR *, SCR **, char *);
int vs_resize(SCR *, long, adj_t);
diff --git a/usr.bin/vi/vi/v_at.c b/usr.bin/vi/vi/v_at.c
index 6bf4fc1662e..f5220e00f1d 100644
--- a/usr.bin/vi/vi/v_at.c
+++ b/usr.bin/vi/vi/v_at.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: v_at.c,v 1.10 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: v_at.c,v 1.11 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -33,7 +33,7 @@ int
v_at(SCR *sp, VICMD *vp)
{
CB *cbp;
- char name;
+ CHAR_T name;
TEXT *tp;
size_t len;
char nbuf[20];
diff --git a/usr.bin/vi/vi/v_ch.c b/usr.bin/vi/vi/v_ch.c
index f405494072a..7df0b4be37d 100644
--- a/usr.bin/vi/vi/v_ch.c
+++ b/usr.bin/vi/vi/v_ch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: v_ch.c,v 1.9 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: v_ch.c,v 1.10 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -23,7 +23,7 @@
#include "../common/common.h"
#include "vi.h"
-static void notfound(SCR *, char);
+static void notfound(SCR *, CHAR_T);
static void noprev(SCR *);
/*
@@ -272,7 +272,7 @@ noprev(SCR *sp)
}
static void
-notfound(SCR *sp, char ch)
+notfound(SCR *sp, CHAR_T ch)
{
msgq(sp, M_BERR, "%s not found", KEY_NAME(sp, ch));
}
diff --git a/usr.bin/vi/vi/v_put.c b/usr.bin/vi/vi/v_put.c
index 23729e7dd1c..959d4a47698 100644
--- a/usr.bin/vi/vi/v_put.c
+++ b/usr.bin/vi/vi/v_put.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: v_put.c,v 1.7 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: v_put.c,v 1.8 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -104,7 +104,7 @@ v_put(SCR *sp, VICMD *vp)
static void
inc_buf(SCR *sp, VICMD *vp)
{
- char v;
+ CHAR_T v;
switch (vp->buffer) {
case '1':
diff --git a/usr.bin/vi/vi/v_txt.c b/usr.bin/vi/vi/v_txt.c
index 3d1fddd0f37..ad47953c9a8 100644
--- a/usr.bin/vi/vi/v_txt.c
+++ b/usr.bin/vi/vi/v_txt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: v_txt.c,v 1.32 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: v_txt.c,v 1.33 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -29,7 +29,7 @@
#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b))
-static int txt_abbrev(SCR *, TEXT *, char *, int, int *, int *);
+static int txt_abbrev(SCR *, TEXT *, CHAR_T *, int, int *, int *);
static void txt_ai_resolve(SCR *, TEXT *, int *);
static TEXT *txt_backup(SCR *, TEXTH *, TEXT *, u_int32_t *);
static int txt_dent(SCR *, TEXT *, int);
@@ -38,7 +38,7 @@ static void txt_err(SCR *, TEXTH *);
static int txt_fc(SCR *, TEXT *, int *);
static int txt_fc_col(SCR *, int, ARGS **);
static int txt_hex(SCR *, TEXT *);
-static int txt_insch(SCR *, TEXT *, char *, u_int);
+static int txt_insch(SCR *, TEXT *, CHAR_T *, u_int);
static int txt_isrch(SCR *, VICMD *, TEXT *, u_int8_t *);
static int txt_map_end(SCR *);
static int txt_map_init(SCR *);
@@ -59,10 +59,10 @@ static void txt_unmap(SCR *, TEXT *, u_int32_t *);
* v_tcmd --
* Fill a buffer from the terminal for vi.
*
- * PUBLIC: int v_tcmd(SCR *, VICMD *, char, u_int);
+ * PUBLIC: int v_tcmd(SCR *, VICMD *, CHAR_T, u_int);
*/
int
-v_tcmd(SCR *sp, VICMD *vp, char prompt, u_int flags)
+v_tcmd(SCR *sp, VICMD *vp, CHAR_T prompt, u_int flags)
{
/* Normally, we end up where we started. */
vp->m_final.lno = sp->lno;
@@ -235,11 +235,11 @@ txt_map_end(SCR *sp)
* Vi text input.
*
* PUBLIC: int v_txt(SCR *, VICMD *, MARK *,
- * PUBLIC: const char *, size_t, char, recno_t, u_long, u_int32_t);
+ * PUBLIC: const char *, size_t, CHAR_T, recno_t, u_long, u_int32_t);
*/
int
v_txt(SCR *sp, VICMD *vp, MARK *tm, const char *lp, size_t len,
- char prompt, recno_t ai_line, u_long rcount, u_int32_t flags)
+ CHAR_T prompt, recno_t ai_line, u_long rcount, u_int32_t flags)
{
EVENT ev, *evp = NULL; /* Current event. */
EVENT fc; /* File name completion event. */
@@ -1280,7 +1280,7 @@ insl_ch: if (txt_insch(sp, tp, &evp->e_c, flags))
* number of hex bytes. Offset by one, we use 0 to mean
* that we've found <CH_HEX>.
*/
- if (hexcnt != 0 && hexcnt++ == sizeof(char) * 2 + 1) {
+ if (hexcnt != 0 && hexcnt++ == sizeof(CHAR_T) * 2 + 1) {
hexcnt = 0;
if (txt_hex(sp, tp))
goto err;
@@ -1431,10 +1431,10 @@ alloc_err:
* Handle abbreviations.
*/
static int
-txt_abbrev(SCR *sp, TEXT *tp, char *pushcp, int isinfoline, int *didsubp,
+txt_abbrev(SCR *sp, TEXT *tp, CHAR_T *pushcp, int isinfoline, int *didsubp,
int *turnoffp)
{
- char ch, *p;
+ CHAR_T ch, *p;
SEQ *qp;
size_t len, off;
@@ -1848,7 +1848,7 @@ txt_backup(SCR *sp, TEXTH *tiqh, TEXT *tp, u_int32_t *flagsp)
static int
txt_dent(SCR *sp, TEXT *tp, int isindent)
{
- char ch;
+ CHAR_T ch;
u_long sw, ts;
size_t cno, current, spaces, target, tabs;
int ai_reset;
@@ -1951,7 +1951,7 @@ txt_fc(SCR *sp, TEXT *tp, int *redrawp)
{
struct stat sb;
ARGS **argv;
- char s_ch;
+ CHAR_T s_ch;
EXCMD cmd;
size_t indx, len, nlen, off;
int argc, trydir;
@@ -2103,7 +2103,7 @@ static int
txt_fc_col(SCR *sp, int argc, ARGS **argv)
{
ARGS **av;
- char *p;
+ CHAR_T *p;
GS *gp;
size_t base, cnt, col, colwidth, numrows, numcols, prefix, row;
int ac, nf, reset;
@@ -2211,7 +2211,7 @@ intr: F_CLR(gp, G_INTERRUPTED);
static int
txt_emark(SCR *sp, TEXT *tp, size_t cno)
{
- char ch, *kp;
+ CHAR_T ch, *kp;
size_t chlen, nlen, olen;
char *p;
@@ -2294,7 +2294,7 @@ txt_err(SCR *sp, TEXTH *tiqh)
static int
txt_hex(SCR *sp, TEXT *tp)
{
- char savec;
+ CHAR_T savec;
size_t len, off;
u_long value;
char *p, *wp;
@@ -2325,7 +2325,7 @@ txt_hex(SCR *sp, TEXT *tp)
/* Get the value. */
errno = 0;
value = strtol(wp, NULL, 16);
- if (errno || value > MAX_CHAR) {
+ if (errno || value > MAX_CHAR_T) {
nothex: tp->lb[tp->cno] = savec;
return (0);
}
@@ -2370,9 +2370,9 @@ nothex: tp->lb[tp->cno] = savec;
* of the screen space they require, but that it not overwrite other characters.
*/
static int
-txt_insch(SCR *sp, TEXT *tp, char *chp, u_int flags)
+txt_insch(SCR *sp, TEXT *tp, CHAR_T *chp, u_int flags)
{
- char *kp, savech;
+ CHAR_T *kp, savech;
size_t chlen, cno, copydown, olen, nlen;
char *p;
diff --git a/usr.bin/vi/vi/v_ulcase.c b/usr.bin/vi/vi/v_ulcase.c
index 446a34c1993..3ce021341af 100644
--- a/usr.bin/vi/vi/v_ulcase.c
+++ b/usr.bin/vi/vi/v_ulcase.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: v_ulcase.c,v 1.9 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: v_ulcase.c,v 1.10 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -26,7 +26,7 @@
#include "../common/common.h"
#include "vi.h"
-static int ulcase(SCR *, recno_t, char *, size_t, size_t, size_t);
+static int ulcase(SCR *, recno_t, CHAR_T *, size_t, size_t, size_t);
/*
* v_ulcase -- [count]~
@@ -105,12 +105,12 @@ v_ulcase(SCR *sp, VICMD *vp)
int
v_mulcase(SCR *sp, VICMD *vp)
{
- char *p;
+ CHAR_T *p;
size_t len;
recno_t lno;
for (lno = vp->m_start.lno;;) {
- if (db_get(sp, lno, DBG_FATAL, &p, &len))
+ if (db_get(sp, lno, DBG_FATAL, (char **) &p, &len))
return (1);
if (len != 0 && ulcase(sp, lno, p, len,
lno == vp->m_start.lno ? vp->m_start.cno : 0,
@@ -139,11 +139,11 @@ v_mulcase(SCR *sp, VICMD *vp)
* Change part of a line's case.
*/
static int
-ulcase(SCR *sp, recno_t lno, char *lp, size_t len, size_t scno, size_t ecno)
+ulcase(SCR *sp, recno_t lno, CHAR_T *lp, size_t len, size_t scno, size_t ecno)
{
size_t blen;
int change, rval;
- char ch, *p, *t;
+ CHAR_T ch, *p, *t;
char *bp;
GET_SPACE_RET(sp, bp, blen, len);
diff --git a/usr.bin/vi/vi/vi.c b/usr.bin/vi/vi/vi.c
index e747fe2f9d7..77e224e949d 100644
--- a/usr.bin/vi/vi/vi.c
+++ b/usr.bin/vi/vi/vi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vi.c,v 1.19 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: vi.c,v 1.20 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -34,7 +34,7 @@ typedef enum {
static VIKEYS const
*v_alias(SCR *, VICMD *, VIKEYS const *);
static gcret_t v_cmd(SCR *, VICMD *, VICMD *, VICMD *, int *, int *);
-static int v_count(SCR *, char, u_long *);
+static int v_count(SCR *, CHAR_T, u_long *);
static void v_dtoh(SCR *);
static int v_init(SCR *);
static gcret_t v_key(SCR *, int, EVENT *, u_int32_t);
@@ -457,7 +457,7 @@ v_cmd(SCR *sp, VICMD *dp, VICMD *vp, VICMD *ismotion, int *comcountp,
VIKEYS const *kp;
gcret_t gcret;
u_int flags;
- char key;
+ CHAR_T key;
char *s;
/*
@@ -1085,7 +1085,7 @@ v_keyword(SCR *sp)
static VIKEYS const *
v_alias(SCR *sp, VICMD *vp, VIKEYS const *kp)
{
- char push;
+ CHAR_T push;
switch (vp->key) {
case 'C': /* C -> c$ */
@@ -1116,7 +1116,7 @@ v_alias(SCR *sp, VICMD *vp, VIKEYS const *kp)
* Return the next count.
*/
static int
-v_count(SCR *sp, char fkey, u_long *countp)
+v_count(SCR *sp, CHAR_T fkey, u_long *countp)
{
EVENT ev;
u_long count, tc;
diff --git a/usr.bin/vi/vi/vi.h b/usr.bin/vi/vi/vi.h
index d4ce794d965..4b13bc8b301 100644
--- a/usr.bin/vi/vi/vi.h
+++ b/usr.bin/vi/vi/vi.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vi.h,v 1.10 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: vi.h,v 1.11 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -18,9 +18,9 @@ typedef struct _vikeys VIKEYS;
/* Structure passed around to functions implementing vi commands. */
typedef struct _vicmd {
- char key; /* Command key. */
- char buffer; /* Buffer. */
- char character; /* Character. */
+ CHAR_T key; /* Command key. */
+ CHAR_T buffer; /* Buffer. */
+ CHAR_T character; /* Character. */
u_long count; /* Count. */
u_long count2; /* Second count (only used by z). */
EVENT ev; /* Associated event. */
@@ -153,9 +153,9 @@ extern VIKEYS const tmotion; /* XXX Hacked ~ command. */
typedef struct _vcs {
recno_t cs_lno; /* Line. */
size_t cs_cno; /* Column. */
- char *cs_bp; /* Buffer. */
+ CHAR_T *cs_bp; /* Buffer. */
size_t cs_len; /* Length. */
- char cs_ch; /* Character. */
+ CHAR_T cs_ch; /* Character. */
#define CS_EMP 1 /* Empty line. */
#define CS_EOF 2 /* End-of-file. */
#define CS_EOL 3 /* End-of-line. */
@@ -233,11 +233,11 @@ typedef struct _vi_private {
VICMD sdot; /* Saved dot, motion command. */
VICMD sdotmotion;
- char *keyw; /* Keyword buffer. */
+ CHAR_T *keyw; /* Keyword buffer. */
size_t klen; /* Keyword length. */
size_t keywlen; /* Keyword buffer length. */
- char rlast; /* Last 'r' replacement character. */
+ CHAR_T rlast; /* Last 'r' replacement character. */
e_key_t rvalue; /* Value of last replacement character. */
EVENT *rep; /* Input replay buffer. */
@@ -261,7 +261,7 @@ typedef struct _vi_private {
u_long u_ccnt; /* Undo command count. */
- char lastckey; /* Last search character. */
+ CHAR_T lastckey; /* Last search character. */
cdir_t csearchdir; /* Character search direction. */
SMAP *h_smap; /* First slot of the line map. */
diff --git a/usr.bin/vi/vi/vs_line.c b/usr.bin/vi/vi/vs_line.c
index 19d44278823..f793304845b 100644
--- a/usr.bin/vi/vi/vs_line.c
+++ b/usr.bin/vi/vi/vs_line.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vs_line.c,v 1.15 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: vs_line.c,v 1.16 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -38,6 +38,7 @@
int
vs_line(SCR *sp, SMAP *smp, size_t *yp, size_t *xp)
{
+ CHAR_T *kp;
GS *gp;
SMAP *tsmp;
size_t chlen = 0, cno_cnt, cols_per_screen, len, nlen;
@@ -45,7 +46,7 @@ vs_line(SCR *sp, SMAP *smp, size_t *yp, size_t *xp)
size_t scno, skip_cols, skip_screens;
int ch = 0, dne, is_cached, is_partial, is_tab, no_draw;
int list_tab, list_dollar;
- char *kp, *p, *cbp, *ecbp, cbuf[128];
+ char *p, *cbp, *ecbp, cbuf[128];
#if defined(DEBUG) && 0
TRACE(sp, "vs_line: row %u: line: %u off: %u\n",
diff --git a/usr.bin/vi/vi/vs_msg.c b/usr.bin/vi/vi/vs_msg.c
index 0031af74a5e..45f572ab666 100644
--- a/usr.bin/vi/vi/vs_msg.c
+++ b/usr.bin/vi/vi/vs_msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vs_msg.c,v 1.17 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: vs_msg.c,v 1.18 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -393,12 +393,13 @@ ret: (void)gp->scr_move(sp, oldy, oldx);
static void
vs_output(SCR *sp, mtype_t mtype, const char *line, int llen)
{
+ CHAR_T *kp;
GS *gp;
VI_PRIVATE *vip;
size_t chlen, notused;
int ch, len, tlen;
const char *p, *t;
- char *kp, *cbp, *ecbp, cbuf[128];
+ char *cbp, *ecbp, cbuf[128];
gp = sp->gp;
vip = VIP(sp);
diff --git a/usr.bin/vi/vi/vs_split.c b/usr.bin/vi/vi/vs_split.c
index 7cee662dd21..3007aab382c 100644
--- a/usr.bin/vi/vi/vs_split.c
+++ b/usr.bin/vi/vi/vs_split.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vs_split.c,v 1.15 2016/05/02 18:24:25 martijn Exp $ */
+/* $OpenBSD: vs_split.c,v 1.16 2016/05/27 09:18:12 martijn Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -278,10 +278,10 @@ vs_discard(SCR *sp, SCR **spp)
* vs_fg --
* Background the current screen, and foreground a new one.
*
- * PUBLIC: int vs_fg(SCR *, SCR **, char *, int);
+ * PUBLIC: int vs_fg(SCR *, SCR **, CHAR_T *, int);
*/
int
-vs_fg(SCR *sp, SCR **nspp, char *name, int newscreen)
+vs_fg(SCR *sp, SCR **nspp, CHAR_T *name, int newscreen)
{
GS *gp;
SCR *nsp;