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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
|
--- nvi-1.81.5/cl/cl_funcs.c
+++ nvi-1.81.5/cl/cl_funcs.c
@@ -381,7 +381,7 @@
if (CLSP(discardp)) {
delwin(CLSP(discardp));
- CLSP(discardp) = NULL;
+ discardp->cl_private = NULL;
}
}
@@ -395,7 +395,7 @@
if (CLSP(tsp))
delwin(CLSP(tsp));
- CLSP(tsp) = subwin(stdscr, tsp->rows, tsp->cols,
+ tsp->cl_private = subwin(stdscr, tsp->rows, tsp->cols,
tsp->roff, tsp->coff);
}
@@ -716,9 +716,9 @@
if (CLSP(origp))
delwin(CLSP(origp));
- CLSP(origp) = subwin(stdscr, origp->rows, origp->cols,
+ origp->cl_private = subwin(stdscr, origp->rows, origp->cols,
origp->roff, origp->coff);
- CLSP(newp) = subwin(stdscr, newp->rows, newp->cols,
+ newp->cl_private = subwin(stdscr, newp->rows, newp->cols,
newp->roff, newp->coff);
/* origp is the original screen, giving up space to newp. */
--- nvi-1.81.5/cl/cl_screen.c
+++ nvi-1.81.5/cl/cl_screen.c
@@ -56,7 +56,7 @@
if (F_ISSET(gp, G_SRESTART)) {
if (CLSP(sp)) {
delwin(CLSP(sp));
- CLSP(sp) = NULL;
+ sp->cl_private = NULL;
}
if (cl_quit(gp))
return (1);
--- nvi-1.81.5/common/db.c
+++ nvi-1.81.5/common/db.c
@@ -94,6 +94,7 @@
CHAR_T *wp;
size_t wlen;
size_t nlen;
+ char *c_lp;
/*
* The underlying recno stuff handles zero by returning NULL, but
@@ -164,7 +165,9 @@
nlen = 1024;
retry:
/* data.size contains length in bytes */
- BINC_GOTO(sp, (char *)ep->c_lp, ep->c_blen, nlen);
+ c_lp = (char *) ep->c_lp;
+ BINC_GOTO(sp, c_lp, ep->c_blen, nlen);
+ ep->c_lp = (CHAR_T *) c_lp;
/* Get the line from the underlying database. */
memset(&key, 0, sizeof(key));
--- nvi-1.81.5/common/key.c
+++ nvi-1.81.5/common/key.c
@@ -829,11 +829,14 @@
{
WIN *wp;
size_t new_nelem, olen;
+ char *i_event;
wp = sp->wp;
new_nelem = wp->i_nelem + add;
olen = wp->i_nelem * sizeof(wp->i_event[0]);
- BINC_RET(sp, (char *)wp->i_event, olen, new_nelem * sizeof(wp->i_event[0]));
+ i_event = (char *) wp->i_event;
+ BINC_RET(sp, i_event, olen, new_nelem * sizeof(wp->i_event[0]));
+ wp->i_event = (EVENT *) i_event;
wp->i_nelem = olen / sizeof(wp->i_event[0]);
return (0);
}
--- nvi-1.81.5/common/mem.h
+++ nvi-1.81.5/common/mem.h
@@ -25,9 +25,10 @@
lp = L__bincp; \
} \
}
-#define BINC_GOTOW(sp, lp, llen, nlen) { \
- CHAR_T *L__bp = lp; \
- BINC_GOTO(sp, (char *)lp, llen, (nlen) * sizeof(CHAR_T)) \
+#define BINC_GOTOW(sp, lp, llen, nlen) { \
+ char *L__bp = (char *) lp; \
+ BINC_GOTO(sp, L__bp, llen, (nlen) * sizeof(CHAR_T)) \
+ lp = (CHAR_T *) L__bp; \
}
#define BINC_RET(sp, lp, llen, nlen) { \
char *L__p = lp; \
@@ -43,8 +44,9 @@
} \
}
#define BINC_RETW(sp, lp, llen, nlen) { \
- CHAR_T *L__bp = lp; \
- BINC_RET(sp, (char *)lp, llen, (nlen) * sizeof(CHAR_T)) \
+ char *L__bp = (char *) lp; \
+ BINC_RET(sp, L__bp, llen, (nlen) * sizeof(CHAR_T)) \
+ lp = (CHAR_T *) L__bp; \
}
/*
@@ -66,8 +68,9 @@
} \
}
#define GET_SPACE_GOTOW(sp, bp, blen, nlen) { \
- CHAR_T *L__bp = bp; \
- GET_SPACE_GOTO(sp, (char *)bp, blen, (nlen) * sizeof(CHAR_T)) \
+ char *L__bp = (char *) bp; \
+ GET_SPACE_GOTO(sp, L__bp, blen, (nlen) * sizeof(CHAR_T)) \
+ bp = (CHAR_T *) L__bp; \
}
#define GET_SPACE_RET(sp, bp, blen, nlen) { \
WIN *L__wp = (sp) == NULL ? NULL : (sp)->wp; \
@@ -83,8 +86,9 @@
} \
}
#define GET_SPACE_RETW(sp, bp, blen, nlen) { \
- CHAR_T *L__bp = bp; \
- GET_SPACE_RET(sp, (char *)bp, blen, (nlen) * sizeof(CHAR_T)) \
+ char *L__bp = (char *) bp; \
+ GET_SPACE_RET(sp, L__bp, blen, (nlen) * sizeof(CHAR_T)) \
+ bp = (CHAR_T *) L__bp; \
}
/*
@@ -103,8 +107,9 @@
BINC_GOTO(sp, bp, blen, nlen); \
}
#define ADD_SPACE_GOTOW(sp, bp, blen, nlen) { \
- CHAR_T *L__bp = bp; \
- ADD_SPACE_GOTO(sp, (char *)bp, blen, (nlen) * sizeof(CHAR_T)) \
+ char *L__bp = (char *) bp; \
+ ADD_SPACE_GOTO(sp, L__bp, blen, (nlen) * sizeof(CHAR_T)) \
+ bp = (CHAR_T *) L__bp; \
}
#define ADD_SPACE_RET(sp, bp, blen, nlen) { \
WIN *L__wp = (sp) == NULL ? NULL : (sp)->wp; \
@@ -118,8 +123,9 @@
BINC_RET(sp, bp, blen, nlen); \
}
#define ADD_SPACE_RETW(sp, bp, blen, nlen) { \
- CHAR_T *L__bp = bp; \
- ADD_SPACE_RET(sp, (char *)bp, blen, (nlen) * sizeof(CHAR_T)) \
+ char *L__bp = (char *) bp; \
+ ADD_SPACE_RET(sp, bp, blen, (nlen) * sizeof(CHAR_T)) \
+ bp = (CHAR_T *) L__bp; \
}
/* Free a GET_SPACE returned buffer. */
--- nvi-1.81.5/vi/v_txt.c
+++ nvi-1.81.5/vi/v_txt.c
@@ -589,8 +589,10 @@
/* Check to see if the character fits into the replay buffers. */
if (LF_ISSET(TXT_RECORD)) {
- BINC_GOTO(sp, (char *)vip->rep,
+ char *rep = (char *) vip->rep;
+ BINC_GOTO(sp, rep,
vip->rep_len, (rcol + 1) * sizeof(EVENT));
+ vip->rep = (EVENT *) rep;
vip->rep[rcol++] = *evp;
}
|