Module Name: src
Committed By: tnozaki
Date: Wed Nov 23 19:25:28 UTC 2011
Modified Files:
src/dist/nvi/cl: cl_term.c
src/dist/nvi/common: cut.c extern.h put.c screen.h
src/dist/nvi/ex: ex.c ex.h ex_at.c
src/dist/nvi/vi: v_at.c v_ch.c v_txt.c
Log Message:
use ARG_CHAR_T instead of CHAR_T for integer promotion.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/dist/nvi/cl/cl_term.c
cvs rdiff -u -r1.4 -r1.5 src/dist/nvi/common/cut.c \
src/dist/nvi/common/extern.h
cvs rdiff -u -r1.2 -r1.3 src/dist/nvi/common/put.c
cvs rdiff -u -r1.1.1.2 -r1.2 src/dist/nvi/common/screen.h
cvs rdiff -u -r1.8 -r1.9 src/dist/nvi/ex/ex.c
cvs rdiff -u -r1.3 -r1.4 src/dist/nvi/ex/ex.h
cvs rdiff -u -r1.2 -r1.3 src/dist/nvi/ex/ex_at.c
cvs rdiff -u -r1.3 -r1.4 src/dist/nvi/vi/v_at.c
cvs rdiff -u -r1.1.1.2 -r1.2 src/dist/nvi/vi/v_ch.c
cvs rdiff -u -r1.7 -r1.8 src/dist/nvi/vi/v_txt.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/dist/nvi/cl/cl_term.c
diff -u src/dist/nvi/cl/cl_term.c:1.3 src/dist/nvi/cl/cl_term.c:1.4
--- src/dist/nvi/cl/cl_term.c:1.3 Sat Sep 24 18:57:46 2011
+++ src/dist/nvi/cl/cl_term.c Wed Nov 23 19:25:27 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cl_term.c,v 1.3 2011/09/24 18:57:46 jdc Exp $ */
+/* $NetBSD: cl_term.c,v 1.4 2011/11/23 19:25:27 tnozaki Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -127,8 +127,9 @@ cl_term_init(SCR *sp)
MEMCPYW(name, wp, wlen);
CHAR2INT(sp, t, strlen(t), wp, wlen);
MEMCPYW(ts, wp, wlen);
+ output[0] = (UCHAR_T)kp->ch;
if (seq_set(sp, name, strlen(tkp->name), ts, strlen(t),
- &kp->ch, 1, SEQ_INPUT, SEQ_NOOVERWRITE | SEQ_SCREEN))
+ output, 1, SEQ_INPUT, SEQ_NOOVERWRITE | SEQ_SCREEN))
return (1);
}
Index: src/dist/nvi/common/cut.c
diff -u src/dist/nvi/common/cut.c:1.4 src/dist/nvi/common/cut.c:1.5
--- src/dist/nvi/common/cut.c:1.4 Mon Mar 21 14:53:02 2011
+++ src/dist/nvi/common/cut.c Wed Nov 23 19:25:28 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: cut.c,v 1.4 2011/03/21 14:53:02 tnozaki Exp $ */
+/* $NetBSD: cut.c,v 1.5 2011/11/23 19:25:28 tnozaki Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -63,10 +63,10 @@ static void cb_rotate __P((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 __P((SCR *, CHAR_T *, MARK *, MARK *, int));
+ * PUBLIC: int cut __P((SCR *, ARG_CHAR_T *, MARK *, MARK *, int));
*/
int
-cut(SCR *sp, CHAR_T *namep, MARK *fm, MARK *tm, int flags)
+cut(SCR *sp, ARG_CHAR_T *namep, MARK *fm, MARK *tm, int flags)
{
CB *cbp;
ARG_CHAR_T name = '\0';
@@ -97,7 +97,7 @@ cut(SCR *sp, CHAR_T *namep, MARK *fm, MA
*/
append = copy_one = copy_def = 0;
if (namep != NULL) {
- name = (UCHAR_T)*namep;
+ name = *namep;
if (LF_ISSET(CUT_NUMREQ) || (LF_ISSET(CUT_NUMOPT) &&
(LF_ISSET(CUT_LINEMODE) || fm->lno != tm->lno))) {
copy_one = 1;
Index: src/dist/nvi/common/extern.h
diff -u src/dist/nvi/common/extern.h:1.4 src/dist/nvi/common/extern.h:1.5
--- src/dist/nvi/common/extern.h:1.4 Mon Mar 21 14:53:02 2011
+++ src/dist/nvi/common/extern.h Wed Nov 23 19:25:28 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.4 2011/03/21 14:53:02 tnozaki Exp $ */
+/* $NetBSD: extern.h,v 1.5 2011/11/23 19:25:28 tnozaki Exp $ */
/* Do not edit: automatically built by build/distrib. */
SCR *api_fscreen __P((int, char *));
@@ -28,7 +28,7 @@ TAGQ * api_tagq_new __P((SCR*, char*));
void api_tagq_add __P((SCR*, TAGQ*, char*, char *, char *));
int api_tagq_push __P((SCR*, TAGQ**));
void api_tagq_free __P((SCR*, TAGQ*));
-int cut __P((SCR *, CHAR_T *, MARK *, MARK *, int));
+int cut __P((SCR *, ARG_CHAR_T *, MARK *, MARK *, int));
int cut_line __P((SCR *, db_recno_t, size_t, size_t, CB *));
void cut_close __P((WIN *));
TEXT *text_init __P((SCR *, const CHAR_T *, size_t, size_t));
@@ -133,7 +133,7 @@ int f_w9600 __P((SCR *, OPTION *, const
int f_window __P((SCR *, OPTION *, const char *, u_long *));
int f_encoding __P((SCR *, OPTION *, const char *, u_long *));
void thread_init __P((GS *gp));
-int put __P((SCR *, CB *, CHAR_T *, MARK *, MARK *, int));
+int put __P((SCR *, CB *, ARG_CHAR_T *, MARK *, MARK *, int));
int rcv_tmp __P((SCR *, EXF *, char *));
int rcv_init __P((SCR *));
int rcv_sync __P((SCR *, u_int));
Index: src/dist/nvi/common/put.c
diff -u src/dist/nvi/common/put.c:1.2 src/dist/nvi/common/put.c:1.3
--- src/dist/nvi/common/put.c:1.2 Fri Dec 5 22:51:42 2008
+++ src/dist/nvi/common/put.c Wed Nov 23 19:25:28 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: put.c,v 1.2 2008/12/05 22:51:42 christos Exp $ */
+/* $NetBSD: put.c,v 1.3 2011/11/23 19:25:28 tnozaki Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -34,9 +34,9 @@ static const char sccsid[] = "Id: put.c,
* PUBLIC: int put __P((SCR *, CB *, CHAR_T *, MARK *, MARK *, int));
*/
int
-put(SCR *sp, CB *cbp, CHAR_T *namep, MARK *cp, MARK *rp, int append)
+put(SCR *sp, CB *cbp, ARG_CHAR_T *namep, MARK *cp, MARK *rp, int append)
{
- CHAR_T name;
+ ARG_CHAR_T name;
TEXT *ltp, *tp;
db_recno_t lno;
size_t blen, clen, len;
Index: src/dist/nvi/common/screen.h
diff -u src/dist/nvi/common/screen.h:1.1.1.2 src/dist/nvi/common/screen.h:1.2
--- src/dist/nvi/common/screen.h:1.1.1.2 Sun May 18 14:29:51 2008
+++ src/dist/nvi/common/screen.h Wed Nov 23 19:25:28 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: screen.h,v 1.1.1.2 2008/05/18 14:29:51 aymeric Exp $ */
+/* $NetBSD: screen.h,v 1.2 2011/11/23 19:25:28 tnozaki Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -167,7 +167,7 @@ struct _scr {
/* PARTIALLY OR COMPLETELY COPIED FROM PREVIOUS SCREEN. */
char *alt_name; /* Ex/vi: alternate file name. */
- CHAR_T at_lbuf; /* Ex/vi: Last executed at buffer. */
+ ARG_CHAR_T at_lbuf; /* Ex/vi: Last executed at buffer. */
/* Ex/vi: re_compile flags. */
#define RE_WSTART L("[[:<:]]") /* Ex/vi: not-in-word search pattern. */
Index: src/dist/nvi/ex/ex.c
diff -u src/dist/nvi/ex/ex.c:1.8 src/dist/nvi/ex/ex.c:1.9
--- src/dist/nvi/ex/ex.c:1.8 Wed Nov 23 14:14:43 2011
+++ src/dist/nvi/ex/ex.c Wed Nov 23 19:25:28 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ex.c,v 1.8 2011/11/23 14:14:43 tnozaki Exp $ */
+/* $NetBSD: ex.c,v 1.9 2011/11/23 19:25:28 tnozaki Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -1051,7 +1051,7 @@ end_case23: break;
* not a two-line deletion.
*/
if (!ISDIGIT((UCHAR_T)ecp->cp[0])) {
- ecp->buffer = *ecp->cp;
+ ecp->buffer = (UCHAR_T)*ecp->cp;
++ecp->cp;
--ecp->clen;
FL_SET(ecp->iflags, E_C_BUFFER);
@@ -2356,7 +2356,7 @@ ex_comlog(sp, ecp)
if (ecp->flags)
vtrace(sp, " flags 0x%x", ecp->flags);
if (F_ISSET(&exc, E_BUFFER))
- vtrace(sp, " buffer %c", ecp->buffer);
+ vtrace(sp, " buffer "WC, ecp->buffer);
if (ecp->argc)
for (cnt = 0; cnt < ecp->argc; ++cnt)
vtrace(sp, " arg %d: {%s}", cnt, ecp->argv[cnt]->bp);
Index: src/dist/nvi/ex/ex.h
diff -u src/dist/nvi/ex/ex.h:1.3 src/dist/nvi/ex/ex.h:1.4
--- src/dist/nvi/ex/ex.h:1.3 Fri Dec 5 22:51:42 2008
+++ src/dist/nvi/ex/ex.h Wed Nov 23 19:25:28 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ex.h,v 1.3 2008/12/05 22:51:42 christos Exp $ */
+/* $NetBSD: ex.h,v 1.4 2011/11/23 19:25:28 tnozaki Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -110,7 +110,7 @@ struct _excmd {
F_SET(cmdp, L__f); \
}
- CHAR_T buffer; /* Command: named buffer. */
+ ARG_CHAR_T buffer; /* Command: named buffer. */
db_recno_t lineno; /* Command: line number. */
long count; /* Command: signed count. */
long flagoff; /* Command: signed flag offset. */
Index: src/dist/nvi/ex/ex_at.c
diff -u src/dist/nvi/ex/ex_at.c:1.2 src/dist/nvi/ex/ex_at.c:1.3
--- src/dist/nvi/ex/ex_at.c:1.2 Fri Dec 5 22:51:42 2008
+++ src/dist/nvi/ex/ex_at.c Wed Nov 23 19:25:28 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ex_at.c,v 1.2 2008/12/05 22:51:42 christos Exp $ */
+/* $NetBSD: ex_at.c,v 1.3 2011/11/23 19:25:28 tnozaki Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -39,7 +39,7 @@ int
ex_at(SCR *sp, EXCMD *cmdp)
{
CB *cbp;
- CHAR_T name;
+ ARG_CHAR_T name;
EXCMD *ecp;
RANGE *rp;
TEXT *tp;
Index: src/dist/nvi/vi/v_at.c
diff -u src/dist/nvi/vi/v_at.c:1.3 src/dist/nvi/vi/v_at.c:1.4
--- src/dist/nvi/vi/v_at.c:1.3 Sat Apr 4 01:13:42 2009
+++ src/dist/nvi/vi/v_at.c Wed Nov 23 19:25:28 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: v_at.c,v 1.3 2009/04/04 01:13:42 jld Exp $ */
+/* $NetBSD: v_at.c,v 1.4 2011/11/23 19:25:28 tnozaki Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -38,7 +38,7 @@ int
v_at(SCR *sp, VICMD *vp)
{
CB *cbp;
- CHAR_T name;
+ ARG_CHAR_T name;
TEXT *tp;
size_t len;
char nbuf[20];
Index: src/dist/nvi/vi/v_ch.c
diff -u src/dist/nvi/vi/v_ch.c:1.1.1.2 src/dist/nvi/vi/v_ch.c:1.2
--- src/dist/nvi/vi/v_ch.c:1.1.1.2 Sun May 18 14:31:40 2008
+++ src/dist/nvi/vi/v_ch.c Wed Nov 23 19:25:28 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: v_ch.c,v 1.1.1.2 2008/05/18 14:31:40 aymeric Exp $ */
+/* $NetBSD: v_ch.c,v 1.2 2011/11/23 19:25:28 tnozaki Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -140,7 +140,8 @@ v_chf(SCR *sp, VICMD *vp)
{
size_t len;
u_long cnt;
- int isempty, key;
+ int isempty;
+ ARG_CHAR_T key;
CHAR_T *endp, *p, *startp;
/*
@@ -221,7 +222,8 @@ v_chF(SCR *sp, VICMD *vp)
{
size_t len;
u_long cnt;
- int isempty, key;
+ int isempty;
+ ARG_CHAR_T key;
CHAR_T *endp, *p;
/*
Index: src/dist/nvi/vi/v_txt.c
diff -u src/dist/nvi/vi/v_txt.c:1.7 src/dist/nvi/vi/v_txt.c:1.8
--- src/dist/nvi/vi/v_txt.c:1.7 Mon Mar 21 14:53:04 2011
+++ src/dist/nvi/vi/v_txt.c Wed Nov 23 19:25:28 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: v_txt.c,v 1.7 2011/03/21 14:53:04 tnozaki Exp $ */
+/* $NetBSD: v_txt.c,v 1.8 2011/11/23 19:25:28 tnozaki Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -32,7 +32,7 @@ static const char sccsid[] = "Id: v_txt.
#include "../common/common.h"
#include "vi.h"
-static int txt_abbrev __P((SCR *, TEXT *, CHAR_T *, int, int *, int *));
+static int txt_abbrev __P((SCR *, TEXT *, ARG_CHAR_T *, int, int *, int *));
static void txt_ai_resolve __P((SCR *, TEXT *, int *));
static TEXT *txt_backup __P((SCR *, TEXTH *, TEXT *, u_int32_t *));
static int txt_dent __P((SCR *, TEXT *, int));
@@ -41,7 +41,7 @@ static void txt_err __P((SCR *, TEXTH *
static int txt_fc __P((SCR *, TEXT *, int *));
static int txt_fc_col __P((SCR *, int, ARGS **));
static int txt_hex __P((SCR *, TEXT *));
-static int txt_insch __P((SCR *, TEXT *, CHAR_T *, u_int));
+static int txt_insch __P((SCR *, TEXT *, ARG_CHAR_T *, u_int));
static int txt_isrch __P((SCR *, VICMD *, TEXT *, u_int8_t *));
static int txt_map_end __P((SCR *));
static int txt_map_init __P((SCR *));
@@ -1471,7 +1471,7 @@ alloc_err:
* Handle abbreviations.
*/
static int
-txt_abbrev(SCR *sp, TEXT *tp, CHAR_T *pushcp, int isinfoline, int *didsubp, int *turnoffp)
+txt_abbrev(SCR *sp, TEXT *tp, ARG_CHAR_T *pushcp, int isinfoline, int *didsubp, int *turnoffp)
{
VI_PRIVATE *vip;
CHAR_T ch, *p;
@@ -1596,7 +1596,7 @@ search: if (isinfoline) {
* queue would have to be adjusted, and the line state when an initial
* abbreviated character was received would have to be saved.
*/
- ch = *pushcp;
+ ch = (UCHAR_T)*pushcp;
if (v_event_push(sp, NULL, &ch, 1, CH_ABBREVIATED))
return (1);
if (v_event_push(sp, NULL, qp->output, qp->olen, CH_ABBREVIATED))
@@ -1898,7 +1898,7 @@ txt_backup(SCR *sp, TEXTH *tiqh, TEXT *t
static int
txt_dent(SCR *sp, TEXT *tp, int isindent)
{
- CHAR_T ch;
+ ARG_CHAR_T ch;
u_long sw, ts;
size_t cno, current, spaces, target, tabs;
@@ -2425,7 +2425,7 @@ 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_T *chp, u_int flags)
+txt_insch(SCR *sp, TEXT *tp, ARG_CHAR_T *chp, u_int flags)
{
unsigned char *kp;
CHAR_T savech;
@@ -2439,7 +2439,7 @@ txt_insch(SCR *sp, TEXT *tp, CHAR_T *chp
if (LF_ISSET(TXT_REPLACE)) {
if (tp->owrite) {
--tp->owrite;
- tp->lb[tp->cno++] = *chp;
+ tp->lb[tp->cno++] = (UCHAR_T)*chp;
return (0);
}
} else if (tp->owrite) { /* Overwrite a character. */
@@ -2514,7 +2514,7 @@ txt_insch(SCR *sp, TEXT *tp, CHAR_T *chp
/* If we had enough overwrite characters, we're done. */
if (nlen == 0) {
- tp->lb[tp->cno++] = *chp;
+ tp->lb[tp->cno++] = (UCHAR_T)*chp;
return (0);
}
}
@@ -2530,7 +2530,7 @@ txt_insch(SCR *sp, TEXT *tp, CHAR_T *chp
MEMMOVEW(tp->lb + tp->cno + 1,
tp->lb + tp->cno, tp->owrite + tp->insert);
}
- tp->lb[tp->cno++] = *chp;
+ tp->lb[tp->cno++] = (UCHAR_T)*chp;
return (0);
}