1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
$NetBSD: patch-bc,v 1.1 2009/08/16 08:34:34 lukem Exp $
--- ../vi/v_increment.c.orig 2007-11-19 03:41:42.000000000 +1100
+++ ../vi/v_increment.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 1992, 1993, 1994
+
* The Regents of the University of California. All rights reserved.
* Copyright (c) 1992, 1993, 1994, 1995, 1996
* Keith Bostic. All rights reserved.
@@ -28,17 +28,17 @@ static const char sccsid[] = "$Id: v_inc
#include "../common/common.h"
#include "vi.h"
-static char * const fmt[] = {
+static CHAR_T * const fmt[] = {
#define DEC 0
- "%ld",
+ L("%ld"),
#define SDEC 1
- "%+ld",
+ L("%+ld"),
#define HEXC 2
- "0X%0*lX",
+ L("0X%0*lX"),
#define HEXL 3
- "0x%0*lx",
+ L("0x%0*lx"),
#define OCTAL 4
- "%#0*lo",
+ L("%#0*lo"),
};
static void inc_err __P((SCR *, enum nresult));
@@ -57,7 +57,7 @@ v_increment(SCR *sp, VICMD *vp)
long change, ltmp, lval;
size_t beg, blen, end, len, nlen, wlen;
int base, isempty, rval;
- char *ntype, nbuf[100];
+ CHAR_T *ntype, nbuf[100];
CHAR_T *bp, *p, *t;
/* Validate the operator. */
@@ -99,7 +99,7 @@ v_increment(SCR *sp, VICMD *vp)
}
#undef ishex
-#define ishex(c) (isdigit(c) || strchr("abcdefABCDEF", c))
+#define ishex(c) (isdigit(c) || STRCHR(L("abcdefABCDEF"), c))
#undef isoctal
#define isoctal(c) (isdigit(c) && (c) != '8' && (c) != '9')
@@ -202,7 +202,7 @@ nonum: msgq(sp, M_ERR, "181|Cursor not
/* If we cross 0, signed numbers lose their sign. */
if (lval == 0 && ntype == fmt[SDEC])
ntype = fmt[DEC];
- nlen = snprintf(nbuf, sizeof(nbuf), ntype, lval);
+ nlen = SPRINTF(nbuf, sizeof(nbuf), ntype, lval);
} else {
if ((nret = nget_uslong(sp, &ulval, t, NULL, base)) != NUM_OK)
goto err;
@@ -224,7 +224,7 @@ nonum: msgq(sp, M_ERR, "181|Cursor not
if (base == 16)
wlen -= 2;
- nlen = snprintf(nbuf, sizeof(nbuf), ntype, wlen, ulval);
+ nlen = SPRINTF(nbuf, sizeof(nbuf), ntype, wlen, ulval);
}
/* Build the new line. */
|