Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/dist/nvi/vi use ARG_CHAR_T instead of CHAR_T for integer pro...
details: https://anonhg.NetBSD.org/src/rev/0d563de13bc6
branches: trunk
changeset: 771246:0d563de13bc6
user: tnozaki <tnozaki%NetBSD.org@localhost>
date: Wed Nov 16 14:24:43 2011 +0000
description:
use ARG_CHAR_T instead of CHAR_T for integer promotion.
diffstat:
dist/nvi/vi/vs_line.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diffs (58 lines):
diff -r 0271d9c83721 -r 0d563de13bc6 dist/nvi/vi/vs_line.c
--- a/dist/nvi/vi/vs_line.c Wed Nov 16 12:40:53 2011 +0000
+++ b/dist/nvi/vi/vs_line.c Wed Nov 16 14:24:43 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vs_line.c,v 1.5 2009/04/19 02:28:19 tnozaki Exp $ */
+/* $NetBSD: vs_line.c,v 1.6 2011/11/16 14:24:43 tnozaki Exp $ */
/*-
* Copyright (c) 1993, 1994
@@ -52,7 +52,7 @@
int list_tab, list_dollar;
CHAR_T *p;
CHAR_T *cbp, *ecbp, cbuf[128];
- CHAR_T ch = '\0';
+ ARG_CHAR_T ch = L('\0');
#if defined(DEBUG) && 0
vtrace(sp, "vs_line: row %u: line: %u off: %u\n",
@@ -268,7 +268,7 @@
/* Do it the hard way, for leftright scrolling screens. */
if (O_ISSET(sp, O_LEFTRIGHT)) {
for (; offset_in_line < len; ++offset_in_line) {
- chlen = (ch = *p++) == L('\t') && !list_tab ?
+ chlen = (ch = (UCHAR_T)*p++) == L('\t') && !list_tab ?
TAB_OFF(scno) : KEY_COL(sp, ch);
if ((scno += chlen) >= skip_cols)
break;
@@ -295,7 +295,7 @@
/* Do it the hard way, for historic line-folding screens. */
else {
for (; offset_in_line < len; ++offset_in_line) {
- chlen = (ch = *p++) == L('\t') && !list_tab ?
+ chlen = (ch = (UCHAR_T)*p++) == L('\t') && !list_tab ?
TAB_OFF(scno) : KEY_COL(sp, ch);
if ((scno += chlen) < cols_per_screen)
continue;
@@ -345,7 +345,7 @@
ecbp = (cbp = cbuf) + sizeof(cbuf)/sizeof(CHAR_T) - 1;
for (is_partial = 0, scno = 0;
offset_in_line < len; ++offset_in_line, offset_in_char = 0) {
- if ((ch = *p++) == L('\t') && !list_tab) {
+ if ((ch = (UCHAR_T)*p++) == L('\t') && !list_tab) {
scno += chlen = TAB_OFF(scno) - offset_in_char;
is_tab = 1;
} else {
@@ -465,10 +465,10 @@
if (list_dollar) {
++scno;
- chlen = KEY_LEN(sp, '$');
+ chlen = KEY_LEN(sp, L('$'));
if (cbp + chlen >= ecbp)
FLUSH;
- for (kp = KEY_NAME(sp, '$'); chlen--;)
+ for (kp = KEY_NAME(sp, L('$')); chlen--;)
*cbp++ = *kp++;
}
Home |
Main Index |
Thread Index |
Old Index