This commit is contained in:
christos 1998-12-12 20:08:21 +00:00
parent 2b1c171400
commit a6d4afba22
13 changed files with 65 additions and 61 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: chared.c,v 1.4 1998/02/03 19:12:37 perry Exp $ */
/* $NetBSD: chared.c,v 1.5 1998/12/12 20:08:21 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: chared.c,v 1.4 1998/02/03 19:12:37 perry Exp $");
__RCSID("$NetBSD: chared.c,v 1.5 1998/12/12 20:08:21 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@ -59,7 +59,8 @@ __RCSID("$NetBSD: chared.c,v 1.4 1998/02/03 19:12:37 perry Exp $");
protected void
cv_undo(el, action, size, ptr)
EditLine *el;
int action, size;
int action;
size_t size;
char *ptr;
{
c_undo_t *vu = &el->el_chared.c_undo;

View File

@ -1,4 +1,4 @@
/* $NetBSD: chared.h,v 1.2 1997/01/11 06:47:49 lukem Exp $ */
/* $NetBSD: chared.h,v 1.3 1998/12/12 20:08:21 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -74,11 +74,11 @@ typedef struct c_macro_t {
* Undo information for both vi and emacs
*/
typedef struct c_undo_t {
int action;
int isize;
int dsize;
char *ptr;
char *buf;
int action;
size_t isize;
size_t dsize;
char *ptr;
char *buf;
} c_undo_t;
/*
@ -140,7 +140,7 @@ protected int cv__isword __P((int));
protected void cv_delfini __P((EditLine *));
protected char *cv__endword __P((char *, char *, int));
protected int ce__isword __P((int));
protected void cv_undo __P((EditLine *, int, int, char *));
protected void cv_undo __P((EditLine *, int, size_t, char *));
protected char *cv_next_word __P((EditLine*, char *, char *, int,
int (*)(int)));
protected char *cv_prev_word __P((EditLine*, char *, char *, int,

View File

@ -1,4 +1,4 @@
/* $NetBSD: common.c,v 1.6 1998/05/20 01:00:33 christos Exp $ */
/* $NetBSD: common.c,v 1.7 1998/12/12 20:08:21 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)common.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: common.c,v 1.6 1998/05/20 01:00:33 christos Exp $");
__RCSID("$NetBSD: common.c,v 1.7 1998/12/12 20:08:21 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@ -802,8 +802,8 @@ ed_search_prev_history(el, c)
#ifdef SDEBUG
(void) fprintf(el->el_errfile, "Comparing with \"%s\"\n", hp);
#endif
if ((strncmp(hp, el->el_line.buffer,
el->el_line.lastchar - el->el_line.buffer) ||
if ((strncmp(hp, el->el_line.buffer, (size_t)
(el->el_line.lastchar - el->el_line.buffer)) ||
hp[el->el_line.lastchar-el->el_line.buffer]) &&
c_hmatch(el, hp)) {
found++;
@ -860,8 +860,8 @@ ed_search_next_history(el, c)
#ifdef SDEBUG
(void) fprintf(el->el_errfile, "Comparing with \"%s\"\n", hp);
#endif
if ((strncmp(hp, el->el_line.buffer,
el->el_line.lastchar - el->el_line.buffer) ||
if ((strncmp(hp, el->el_line.buffer, (size_t)
(el->el_line.lastchar - el->el_line.buffer)) ||
hp[el->el_line.lastchar-el->el_line.buffer]) &&
c_hmatch(el, hp))
found = h;

View File

@ -1,4 +1,4 @@
/* $NetBSD: el.c,v 1.11 1998/09/28 11:00:05 christos Exp $ */
/* $NetBSD: el.c,v 1.12 1998/12/12 20:08:22 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94";
#else
__RCSID("$NetBSD: el.c,v 1.11 1998/09/28 11:00:05 christos Exp $");
__RCSID("$NetBSD: el.c,v 1.12 1998/12/12 20:08:22 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@ -385,7 +385,7 @@ public const LineInfo *
el_line(el)
EditLine *el;
{
return (const LineInfo *) &el->el_line;
return (const LineInfo *)(void *)&el->el_line;
}
static const char elpath[] = "/.editrc";

View File

@ -1,4 +1,4 @@
/* $NetBSD: key.c,v 1.3 1997/07/06 18:25:28 christos Exp $ */
/* $NetBSD: key.c,v 1.4 1998/12/12 20:08:22 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)key.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: key.c,v 1.3 1997/07/06 18:25:28 christos Exp $");
__RCSID("$NetBSD: key.c,v 1.4 1998/12/12 20:08:22 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@ -673,8 +673,8 @@ key__decode_char(buf, cnt, ch)
}
else {
buf[cnt++] = '\\';
buf[cnt++] = ((ch >> 6) & 7) + '0';
buf[cnt++] = ((ch >> 3) & 7) + '0';
buf[cnt++] = (((unsigned int)ch >> 6) & 7) + '0';
buf[cnt++] = (((unsigned int)ch >> 3) & 7) + '0';
buf[cnt] = (ch & 7) + '0';
}
return cnt;
@ -721,8 +721,8 @@ key__decode_str(str, buf, sep)
}
else {
*b++ = '\\';
*b++ = ((*p >> 6) & 7) + '0';
*b++ = ((*p >> 3) & 7) + '0';
*b++ = (((unsigned int)*p >> 6) & 7) + '0';
*b++ = (((unsigned int)*p >> 3) & 7) + '0';
*b++ = (*p & 7) + '0';
}
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: map.c,v 1.7 1998/07/29 02:26:01 lukem Exp $ */
/* $NetBSD: map.c,v 1.8 1998/12/12 20:08:22 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: map.c,v 1.7 1998/07/29 02:26:01 lukem Exp $");
__RCSID("$NetBSD: map.c,v 1.8 1998/12/12 20:08:22 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@ -1250,7 +1250,7 @@ map_bind(el, argc, argv)
char **argv;
{
el_action_t *map;
int ntype, remove;
int ntype, rem;
char *p;
char inbuf[EL_BUFSIZ];
char outbuf[EL_BUFSIZ];
@ -1265,7 +1265,7 @@ map_bind(el, argc, argv)
map = el->el_map.key;
ntype = XK_CMD;
key = remove = 0;
key = rem = 0;
for (argc = 1; (p = argv[argc]) != NULL; argc++)
if (p[0] == '-')
switch (p[1]) {
@ -1286,7 +1286,7 @@ map_bind(el, argc, argv)
break;
case 'r':
remove = 1;
rem = 1;
break;
case 'v':
@ -1323,7 +1323,7 @@ map_bind(el, argc, argv)
return -1;
}
if (remove) {
if (rem) {
if (key) {
(void) term_clear_arrow(el, in);
return -1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: parse.c,v 1.8 1998/07/29 02:26:01 lukem Exp $ */
/* $NetBSD: parse.c,v 1.9 1998/12/12 20:08:22 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: parse.c,v 1.8 1998/07/29 02:26:01 lukem Exp $");
__RCSID("$NetBSD: parse.c,v 1.9 1998/12/12 20:08:22 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@ -113,13 +113,13 @@ el_parse(el, argc, argv)
ptr = strchr(argv[0], ':');
if (ptr != NULL) {
char *tprog;
int l;
size_t l;
l = ptr - argv[0] - 1;
tprog = (char *)malloc(l + 1);
if (tprog == NULL)
return 0;
strncpy(tprog, argv[0], l);
(void)strncpy(tprog, argv[0], l);
tprog[l] = '\0';
ptr++;
l = el_match(el->el_prog, tprog);

View File

@ -1,4 +1,4 @@
/* $NetBSD: read.c,v 1.9 1998/06/01 14:31:26 lukem Exp $ */
/* $NetBSD: read.c,v 1.10 1998/12/12 20:08:22 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: read.c,v 1.9 1998/06/01 14:31:26 lukem Exp $");
__RCSID("$NetBSD: read.c,v 1.10 1998/12/12 20:08:22 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@ -85,6 +85,7 @@ read_debug(el)
/* read__fixio():
* Try to recover from a read error
*/
/* ARGSUSED */
private int
read__fixio(fd, e)
int fd, e;
@ -190,6 +191,7 @@ el_push(el, str)
if (str != NULL && ma->level + 1 < EL_MAXMACRO) {
ma->level++;
/* LINTED const cast */
ma->macro[ma->level] = (char *) str;
}
else {

View File

@ -1,4 +1,4 @@
/* $NetBSD: refresh.c,v 1.4 1998/05/20 01:03:30 christos Exp $ */
/* $NetBSD: refresh.c,v 1.5 1998/12/12 20:08:22 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)refresh.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: refresh.c,v 1.4 1998/05/20 01:03:30 christos Exp $");
__RCSID("$NetBSD: refresh.c,v 1.5 1998/12/12 20:08:22 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@ -131,8 +131,8 @@ re_addc(el, c)
}
else {
re_putc(el, '\\');
re_putc(el, ((c >> 6) & 07) + '0');
re_putc(el, ((c >> 3) & 07) + '0');
re_putc(el, (((unsigned int)c >> 6) & 07) + '0');
re_putc(el, (((unsigned int)c >> 3) & 07) + '0');
re_putc(el, (c & 07) + '0');
}
} /* end re_addc */
@ -221,7 +221,7 @@ re_refresh(el)
* screen line, it won't be a NUL or some old leftover stuff.
*/
re__copy_and_pad(el->el_display[i], el->el_vdisplay[i],
el->el_term.t_size.h);
(size_t)el->el_term.t_size.h);
}
RE_DEBUG(1,(__F,
"\r\nel->el_refresh.r_cursor.v=%d,el->el_refresh.r_oldcv=%d i=%d\r\n",
@ -231,7 +231,7 @@ re_refresh(el)
for (; i <= el->el_refresh.r_oldcv; i++) {
term_move_to_line(el, i);
term_move_to_char(el, 0);
term_clear_EOL(el, strlen(el->el_display[i]));
term_clear_EOL(el, (int)strlen(el->el_display[i]));
#ifdef DEBUG_REFRESH
term_overwrite(el, "C\b", 2);
#endif /* DEBUG_REFRESH */
@ -669,12 +669,12 @@ re_update_line(el, old, new, i)
* write (nsb-nfd) - fx chars of new starting at (nfd + fx)
*/
term_overwrite(el, nfd + fx, (nsb - nfd) - fx);
re__strncopy(ofd + fx, nfd + fx, (nsb - nfd) - fx);
re__strncopy(ofd + fx, nfd + fx, (size_t)((nsb - nfd) - fx));
}
else {
RE_DEBUG(1,(__F, "without anything to save\r\n"),);
term_overwrite(el, nfd, (nsb - nfd));
re__strncopy(ofd, nfd, (nsb - nfd));
re__strncopy(ofd, nfd, (size_t)(nsb - nfd));
/*
* Done
*/
@ -706,7 +706,7 @@ re_update_line(el, old, new, i)
* write (nsb-nfd) chars of new starting at nfd
*/
term_overwrite(el, nfd, (nsb - nfd));
re__strncopy(ofd, nfd, (nsb - nfd));
re__strncopy(ofd, nfd, (size_t)(nsb - nfd));
}
else {
@ -795,12 +795,12 @@ re_update_line(el, old, new, i)
* write (nsb-nfd) - fx chars of new starting at (nfd + fx)
*/
term_overwrite(el, nfd + fx, (nsb - nfd) - fx);
re__strncopy(ofd + fx, nfd + fx, (nsb - nfd) - fx);
re__strncopy(ofd + fx, nfd + fx, (size_t)((nsb - nfd) - fx));
}
else {
RE_DEBUG(1,(__F, "without anything to save\r\n"),);
term_overwrite(el, nfd, (nsb - nfd));
re__strncopy(ofd, nfd, (nsb - nfd));
re__strncopy(ofd, nfd, (size_t)(nsb - nfd));
}
}
@ -970,8 +970,8 @@ re_fastaddc(el)
}
else {
re_fastputc(el, '\\');
re_fastputc(el, ((c >> 6) & 7) + '0');
re_fastputc(el, ((c >> 3) & 7) + '0');
re_fastputc(el, (((unsigned int)c >> 6) & 7) + '0');
re_fastputc(el, (((unsigned int)c >> 3) & 7) + '0');
re_fastputc(el, (c & 7) + '0');
}
term__flush();

View File

@ -1,4 +1,4 @@
/* $NetBSD: search.h,v 1.2 1997/01/11 06:48:09 lukem Exp $ */
/* $NetBSD: search.h,v 1.3 1998/12/12 20:08:23 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -48,7 +48,7 @@
typedef struct el_search_t {
char *patbuf; /* The pattern buffer */
int patlen; /* Length of the pattern buffer */
size_t patlen; /* Length of the pattern buffer */
int patdir; /* Direction of the last search */
int chadir; /* Character search direction */
char chacha; /* Character we are looking for */

View File

@ -1,4 +1,4 @@
/* $NetBSD: term.c,v 1.14 1998/05/20 01:04:17 christos Exp $ */
/* $NetBSD: term.c,v 1.15 1998/12/12 20:08:23 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95";
#else
__RCSID("$NetBSD: term.c,v 1.14 1998/05/20 01:04:17 christos Exp $");
__RCSID("$NetBSD: term.c,v 1.15 1998/12/12 20:08:23 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@ -590,7 +590,8 @@ mc_again:
(void) tputs(tgoto(Str(T_LE), -del, -del), -del, term__putc);
else { /* can't go directly there */
/* if the "cost" is greater than the "cost" from col 0 */
if (EL_CAN_TAB ? (-del > ((where >> 3) + (where & 07)))
if (EL_CAN_TAB ? (-del > (((unsigned int)where >> 3) +
(where & 07)))
: (-del > where)) {
term__putc('\r'); /* do a CR */
el->el_cursor.h = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tokenizer.c,v 1.3 1997/07/06 18:25:37 christos Exp $ */
/* $NetBSD: tokenizer.c,v 1.4 1998/12/12 20:08:23 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)tokenizer.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: tokenizer.c,v 1.3 1997/07/06 18:25:37 christos Exp $");
__RCSID("$NetBSD: tokenizer.c,v 1.4 1998/12/12 20:08:23 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@ -173,7 +173,7 @@ tok_line(tok, line, argc, argv)
{
const char *ptr;
while (1) {
for (;;) {
switch (*(ptr = line++)) {
case '\'':
tok->flags |= TOK_KEEP;

View File

@ -1,4 +1,4 @@
/* $NetBSD: vi.c,v 1.4 1998/02/03 19:12:40 perry Exp $ */
/* $NetBSD: vi.c,v 1.5 1998/12/12 20:08:23 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: vi.c,v 1.4 1998/02/03 19:12:40 perry Exp $");
__RCSID("$NetBSD: vi.c,v 1.5 1998/12/12 20:08:23 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
@ -640,7 +640,7 @@ vi_undo(el, c)
el->el_line.cursor = un->ptr;
c_insert(el, un->isize);
memcpy(un->ptr, un->buf, un->isize);
(void) memcpy(un->ptr, un->buf, un->isize);
un->action = DELETE;
un->dsize = un->isize;
un->isize = 0;