]>
Commit | Line | Data |
---|---|---|
d22eaa71 ER |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.2.167 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.2.167 | |
11 | Problem: Splint doesn't work well for checking the code. | |
12 | Solution: Add splint arguments in the Makefile. Exclude some code from | |
13 | splint that it can't handle. Tune splint arguments to give | |
14 | reasonable errors. Add a filter for removing false warnings from | |
15 | splint output. Many small changes to avoid warnings. More to | |
16 | follow... | |
17 | Files: Filelist, src/Makefile, src/buffer.c, src/charset.c, | |
18 | src/cleanlint.vim, src/digraph.c, src/edit.c, src/ex_cmds.c, | |
19 | src/globals.h, src/ops.c, src/os_unix.c, src/os_unix.h, | |
20 | src/proto/buffer.pro, src/proto/edit.pro, src/screen.c, | |
21 | src/structs.h | |
22 | ||
23 | *** ../vim-7.2.166/Filelist 2008-09-20 16:26:10.000000000 +0200 | |
24 | --- Filelist 2009-05-05 21:45:49.000000000 +0200 | |
25 | *************** | |
26 | *** 139,144 **** | |
27 | --- 139,145 ---- | |
28 | src/INSTALL \ | |
29 | src/INSTALLx.txt \ | |
30 | src/Makefile \ | |
31 | + src/cleanlint.vim \ | |
32 | src/auto/configure \ | |
33 | src/config.aap.in \ | |
34 | src/config.h.in \ | |
35 | *************** | |
36 | *** 683,691 **** | |
37 | runtime/spell/??/main.aap \ | |
38 | runtime/spell/yi/README.txt \ | |
39 | runtime/spell/main.aap \ | |
40 | - runtime/spell/cleanadd.vim \ | |
41 | runtime/spell/*.vim \ | |
42 | - runtime/spell/fixdup \ | |
43 | ||
44 | # generic language files, binary | |
45 | LANG_GEN_BIN = \ | |
46 | --- 684,690 ---- | |
47 | *** ../vim-7.2.166/src/Makefile 2009-04-29 18:44:45.000000000 +0200 | |
48 | --- src/Makefile 2009-05-06 00:23:15.000000000 +0200 | |
49 | *************** | |
50 | *** 551,557 **** | |
51 | # }}} | |
52 | ||
53 | # LINT - for running lint | |
54 | ! LINT_OPTIONS = -beprxzF | |
55 | ||
56 | # PROFILING - Uncomment the next two lines to do profiling with gcc and gprof. | |
57 | # Might not work with GUI or Perl. | |
58 | --- 551,562 ---- | |
59 | # }}} | |
60 | ||
61 | # LINT - for running lint | |
62 | ! # For standard lint | |
63 | ! #LINT = lint | |
64 | ! #LINT_OPTIONS = -beprxzF | |
65 | ! # For splint (see cleanlint.vim for filtering the output) | |
66 | ! LINT = splint | |
67 | ! LINT_OPTIONS = +unixlib -weak -macrovarprefixexclude -showfunc -linelen 9999 | |
68 | ||
69 | # PROFILING - Uncomment the next two lines to do profiling with gcc and gprof. | |
70 | # Might not work with GUI or Perl. | |
71 | *************** | |
72 | *** 1259,1274 **** | |
73 | # This is for cproto 3 patchlevel 8 or below | |
74 | # __inline, __attribute__ and __extension__ are not recognized by cproto | |
75 | # G_IMPLEMENT_INLINES is to avoid functions defined in glib/gutils.h. | |
76 | ! NO_ATTR = -D__inline= -D__inline__= -DG_IMPLEMENT_INLINES \ | |
77 | ! -D"__attribute__\\(x\\)=" -D"__asm__\\(x\\)=" \ | |
78 | ! -D__extension__= -D__restrict="" \ | |
79 | ! -D__gnuc_va_list=char -D__builtin_va_list=char | |
80 | ||
81 | # | |
82 | ! # This is for cproto 3 patchlevel 9 or above (currently 4.6) | |
83 | # __inline and __attribute__ are now recognized by cproto | |
84 | # -D"foo()=" is not supported by all compilers so do not use it | |
85 | ! # NO_ATTR= | |
86 | # | |
87 | # maybe the "/usr/bin/cc -E" has to be adjusted for some systems | |
88 | # This is for cproto 3.5 patchlevel 3: | |
89 | --- 1264,1279 ---- | |
90 | # This is for cproto 3 patchlevel 8 or below | |
91 | # __inline, __attribute__ and __extension__ are not recognized by cproto | |
92 | # G_IMPLEMENT_INLINES is to avoid functions defined in glib/gutils.h. | |
93 | ! #NO_ATTR = -D__inline= -D__inline__= -DG_IMPLEMENT_INLINES \ | |
94 | ! # -D"__attribute__\\(x\\)=" -D"__asm__\\(x\\)=" \ | |
95 | ! # -D__extension__= -D__restrict="" \ | |
96 | ! # -D__gnuc_va_list=char -D__builtin_va_list=char | |
97 | ||
98 | # | |
99 | ! # This is for cproto 3 patchlevel 9 or above (currently 4.6, 4.7g) | |
100 | # __inline and __attribute__ are now recognized by cproto | |
101 | # -D"foo()=" is not supported by all compilers so do not use it | |
102 | ! NO_ATTR= | |
103 | # | |
104 | # maybe the "/usr/bin/cc -E" has to be adjusted for some systems | |
105 | # This is for cproto 3.5 patchlevel 3: | |
106 | *************** | |
107 | *** 1432,1437 **** | |
108 | --- 1437,1443 ---- | |
109 | $(SNIFF_SRC) $(WORKSHOP_SRC) $(WSDEBUG_SRC) $(NETBEANS_SRC) | |
110 | #LINT_SRC = $(SRC) | |
111 | #LINT_SRC = $(ALL_SRC) | |
112 | + #LINT_SRC = $(BASIC_SRC) | |
113 | ||
114 | OBJ = \ | |
115 | objects/buffer.o \ | |
116 | *************** | |
117 | *** 2272,2283 **** | |
118 | ||
119 | # Run lint. Clean up the *.ln files that are sometimes left behind. | |
120 | lint: | |
121 | ! lint $(LINT_OPTIONS) $(LINT_CFLAGS) $(LINT_EXTRA) $(LINT_SRC) | |
122 | -rm -f *.ln | |
123 | ||
124 | # Check dosinst.c with lint. | |
125 | lintinstall: | |
126 | ! lint $(LINT_OPTIONS) -DWIN32 -DUNIX_LINT dosinst.c | |
127 | -rm -f dosinst.ln | |
128 | ||
129 | ########################################################################### | |
130 | --- 2279,2290 ---- | |
131 | ||
132 | # Run lint. Clean up the *.ln files that are sometimes left behind. | |
133 | lint: | |
134 | ! $(LINT) $(LINT_OPTIONS) $(LINT_CFLAGS) $(LINT_EXTRA) $(LINT_SRC) | |
135 | -rm -f *.ln | |
136 | ||
137 | # Check dosinst.c with lint. | |
138 | lintinstall: | |
139 | ! $(LINT) $(LINT_OPTIONS) -DWIN32 -DUNIX_LINT dosinst.c | |
140 | -rm -f dosinst.ln | |
141 | ||
142 | ########################################################################### | |
143 | *** ../vim-7.2.166/src/buffer.c 2009-02-22 00:01:42.000000000 +0100 | |
144 | --- src/buffer.c 2009-05-13 12:25:29.000000000 +0200 | |
145 | *************** | |
146 | *** 44,49 **** | |
147 | --- 44,50 ---- | |
148 | #ifdef FEAT_TITLE | |
149 | static int ti_change __ARGS((char_u *str, char_u **last)); | |
150 | #endif | |
151 | + static int append_arg_number __ARGS((win_T *wp, char_u *buf, int buflen, int add_file)); | |
152 | static void free_buffer __ARGS((buf_T *)); | |
153 | static void free_buffer_stuff __ARGS((buf_T *buf, int free_options)); | |
154 | static void clear_wininfo __ARGS((buf_T *buf)); | |
155 | *************** | |
156 | *** 1453,1465 **** | |
157 | ||
158 | #ifdef FEAT_KEYMAP | |
159 | if (curbuf->b_kmap_state & KEYMAP_INIT) | |
160 | ! keymap_init(); | |
161 | #endif | |
162 | #ifdef FEAT_SPELL | |
163 | /* May need to set the spell language. Can only do this after the buffer | |
164 | * has been properly setup. */ | |
165 | if (!curbuf->b_help && curwin->w_p_spell && *curbuf->b_p_spl != NUL) | |
166 | ! did_set_spelllang(curbuf); | |
167 | #endif | |
168 | ||
169 | redraw_later(NOT_VALID); | |
170 | --- 1454,1466 ---- | |
171 | ||
172 | #ifdef FEAT_KEYMAP | |
173 | if (curbuf->b_kmap_state & KEYMAP_INIT) | |
174 | ! (void)keymap_init(); | |
175 | #endif | |
176 | #ifdef FEAT_SPELL | |
177 | /* May need to set the spell language. Can only do this after the buffer | |
178 | * has been properly setup. */ | |
179 | if (!curbuf->b_help && curwin->w_p_spell && *curbuf->b_p_spl != NUL) | |
180 | ! (void)did_set_spelllang(curbuf); | |
181 | #endif | |
182 | ||
183 | redraw_later(NOT_VALID); | |
184 | *************** | |
185 | *** 2516,2522 **** | |
186 | buf_T *buf; | |
187 | { | |
188 | wininfo_T *wip; | |
189 | ! static pos_T no_position = {1, 0}; | |
190 | ||
191 | wip = find_wininfo(buf, FALSE); | |
192 | if (wip != NULL) | |
193 | --- 2517,2523 ---- | |
194 | buf_T *buf; | |
195 | { | |
196 | wininfo_T *wip; | |
197 | ! static pos_T no_position = INIT_POS_T(1, 0, 0); | |
198 | ||
199 | wip = find_wininfo(buf, FALSE); | |
200 | if (wip != NULL) | |
201 | *************** | |
202 | *** 2577,2584 **** | |
203 | { | |
204 | IObuff[len++] = ' '; | |
205 | } while (--i > 0 && len < IOSIZE - 18); | |
206 | ! vim_snprintf((char *)IObuff + len, IOSIZE - len, _("line %ld"), | |
207 | ! buf == curbuf ? curwin->w_cursor.lnum | |
208 | : (long)buflist_findlnum(buf)); | |
209 | msg_outtrans(IObuff); | |
210 | out_flush(); /* output one line at a time */ | |
211 | --- 2578,2585 ---- | |
212 | { | |
213 | IObuff[len++] = ' '; | |
214 | } while (--i > 0 && len < IOSIZE - 18); | |
215 | ! vim_snprintf((char *)IObuff + len, (size_t)(IOSIZE - len), | |
216 | ! _("line %ld"), buf == curbuf ? curwin->w_cursor.lnum | |
217 | : (long)buflist_findlnum(buf)); | |
218 | msg_outtrans(IObuff); | |
219 | out_flush(); /* output one line at a time */ | |
220 | *************** | |
221 | *** 2967,2973 **** | |
222 | ||
223 | if (fullname > 1) /* 2 CTRL-G: include buffer number */ | |
224 | { | |
225 | ! sprintf((char *)buffer, "buf %d: ", curbuf->b_fnum); | |
226 | p = buffer + STRLEN(buffer); | |
227 | } | |
228 | else | |
229 | --- 2968,2974 ---- | |
230 | ||
231 | if (fullname > 1) /* 2 CTRL-G: include buffer number */ | |
232 | { | |
233 | ! vim_snprintf((char *)buffer, IOSIZE, "buf %d: ", curbuf->b_fnum); | |
234 | p = buffer + STRLEN(buffer); | |
235 | } | |
236 | else | |
237 | *************** | |
238 | *** 3041,3051 **** | |
239 | (long)curbuf->b_ml.ml_line_count, | |
240 | n); | |
241 | validate_virtcol(); | |
242 | ! col_print(buffer + STRLEN(buffer), | |
243 | (int)curwin->w_cursor.col + 1, (int)curwin->w_virtcol + 1); | |
244 | } | |
245 | ||
246 | ! (void)append_arg_number(curwin, buffer, !shortmess(SHM_FILE), IOSIZE); | |
247 | ||
248 | if (dont_truncate) | |
249 | { | |
250 | --- 3042,3053 ---- | |
251 | (long)curbuf->b_ml.ml_line_count, | |
252 | n); | |
253 | validate_virtcol(); | |
254 | ! len = STRLEN(buffer); | |
255 | ! col_print(buffer + len, IOSIZE - len, | |
256 | (int)curwin->w_cursor.col + 1, (int)curwin->w_virtcol + 1); | |
257 | } | |
258 | ||
259 | ! (void)append_arg_number(curwin, buffer, IOSIZE, !shortmess(SHM_FILE)); | |
260 | ||
261 | if (dont_truncate) | |
262 | { | |
263 | *************** | |
264 | *** 3073,3087 **** | |
265 | } | |
266 | ||
267 | void | |
268 | ! col_print(buf, col, vcol) | |
269 | char_u *buf; | |
270 | int col; | |
271 | int vcol; | |
272 | { | |
273 | if (col == vcol) | |
274 | ! sprintf((char *)buf, "%d", col); | |
275 | else | |
276 | ! sprintf((char *)buf, "%d-%d", col, vcol); | |
277 | } | |
278 | ||
279 | #if defined(FEAT_TITLE) || defined(PROTO) | |
280 | --- 3075,3090 ---- | |
281 | } | |
282 | ||
283 | void | |
284 | ! col_print(buf, buflen, col, vcol) | |
285 | char_u *buf; | |
286 | + size_t buflen; | |
287 | int col; | |
288 | int vcol; | |
289 | { | |
290 | if (col == vcol) | |
291 | ! vim_snprintf((char *)buf, buflen, "%d", col); | |
292 | else | |
293 | ! vim_snprintf((char *)buf, buflen, "%d-%d", col, vcol); | |
294 | } | |
295 | ||
296 | #if defined(FEAT_TITLE) || defined(PROTO) | |
297 | *************** | |
298 | *** 3194,3211 **** | |
299 | if (p == buf + off) | |
300 | /* must be a help buffer */ | |
301 | vim_strncpy(buf + off, (char_u *)_("help"), | |
302 | ! IOSIZE - off - 1); | |
303 | else | |
304 | *p = NUL; | |
305 | ||
306 | /* translate unprintable chars */ | |
307 | p = transstr(buf + off); | |
308 | ! vim_strncpy(buf + off, p, IOSIZE - off - 1); | |
309 | vim_free(p); | |
310 | STRCAT(buf, ")"); | |
311 | } | |
312 | ||
313 | ! append_arg_number(curwin, buf, FALSE, IOSIZE); | |
314 | ||
315 | #if defined(FEAT_CLIENTSERVER) | |
316 | if (serverName != NULL) | |
317 | --- 3197,3214 ---- | |
318 | if (p == buf + off) | |
319 | /* must be a help buffer */ | |
320 | vim_strncpy(buf + off, (char_u *)_("help"), | |
321 | ! (size_t)(IOSIZE - off - 1)); | |
322 | else | |
323 | *p = NUL; | |
324 | ||
325 | /* translate unprintable chars */ | |
326 | p = transstr(buf + off); | |
327 | ! vim_strncpy(buf + off, p, (size_t)(IOSIZE - off - 1)); | |
328 | vim_free(p); | |
329 | STRCAT(buf, ")"); | |
330 | } | |
331 | ||
332 | ! append_arg_number(curwin, buf, IOSIZE, FALSE); | |
333 | ||
334 | #if defined(FEAT_CLIENTSERVER) | |
335 | if (serverName != NULL) | |
336 | *************** | |
337 | *** 3520,3526 **** | |
338 | n = (long)(p - t) - item[groupitem[groupdepth]].maxwid + 1; | |
339 | ||
340 | *t = '<'; | |
341 | ! mch_memmove(t + 1, t + n, p - (t + n)); | |
342 | p = p - n + 1; | |
343 | #ifdef FEAT_MBYTE | |
344 | /* Fill up space left over by half a double-wide char. */ | |
345 | --- 3523,3529 ---- | |
346 | n = (long)(p - t) - item[groupitem[groupdepth]].maxwid + 1; | |
347 | ||
348 | *t = '<'; | |
349 | ! mch_memmove(t + 1, t + n, (size_t)(p - (t + n))); | |
350 | p = p - n + 1; | |
351 | #ifdef FEAT_MBYTE | |
352 | /* Fill up space left over by half a double-wide char. */ | |
353 | *************** | |
354 | *** 3550,3556 **** | |
355 | else | |
356 | { | |
357 | /* fill by inserting characters */ | |
358 | ! mch_memmove(t + n - l, t, p - t); | |
359 | l = n - l; | |
360 | if (p + l >= out + outlen) | |
361 | l = (long)((out + outlen) - p - 1); | |
362 | --- 3553,3559 ---- | |
363 | else | |
364 | { | |
365 | /* fill by inserting characters */ | |
366 | ! mch_memmove(t + n - l, t, (size_t)(p - t)); | |
367 | l = n - l; | |
368 | if (p + l >= out + outlen) | |
369 | l = (long)((out + outlen) - p - 1); | |
370 | *************** | |
371 | *** 3686,3692 **** | |
372 | p = t; | |
373 | ||
374 | #ifdef FEAT_EVAL | |
375 | ! sprintf((char *)tmp, "%d", curbuf->b_fnum); | |
376 | set_internal_string_var((char_u *)"actual_curbuf", tmp); | |
377 | ||
378 | o_curbuf = curbuf; | |
379 | --- 3689,3695 ---- | |
380 | p = t; | |
381 | ||
382 | #ifdef FEAT_EVAL | |
383 | ! vim_snprintf((char *)tmp, sizeof(tmp), "%d", curbuf->b_fnum); | |
384 | set_internal_string_var((char_u *)"actual_curbuf", tmp); | |
385 | ||
386 | o_curbuf = curbuf; | |
387 | *************** | |
388 | *** 3753,3765 **** | |
389 | ||
390 | case STL_ALTPERCENT: | |
391 | str = tmp; | |
392 | ! get_rel_pos(wp, str); | |
393 | break; | |
394 | ||
395 | case STL_ARGLISTSTAT: | |
396 | fillable = FALSE; | |
397 | tmp[0] = 0; | |
398 | ! if (append_arg_number(wp, tmp, FALSE, (int)sizeof(tmp))) | |
399 | str = tmp; | |
400 | break; | |
401 | ||
402 | --- 3756,3768 ---- | |
403 | ||
404 | case STL_ALTPERCENT: | |
405 | str = tmp; | |
406 | ! get_rel_pos(wp, str, TMPLEN); | |
407 | break; | |
408 | ||
409 | case STL_ARGLISTSTAT: | |
410 | fillable = FALSE; | |
411 | tmp[0] = 0; | |
412 | ! if (append_arg_number(wp, tmp, (int)sizeof(tmp), FALSE)) | |
413 | str = tmp; | |
414 | break; | |
415 | ||
416 | *************** | |
417 | *** 3794,3800 **** | |
418 | case STL_BYTEVAL_X: | |
419 | base = 'X'; | |
420 | case STL_BYTEVAL: | |
421 | ! if (wp->w_cursor.col > STRLEN(linecont)) | |
422 | num = 0; | |
423 | else | |
424 | { | |
425 | --- 3797,3803 ---- | |
426 | case STL_BYTEVAL_X: | |
427 | base = 'X'; | |
428 | case STL_BYTEVAL: | |
429 | ! if (wp->w_cursor.col > (colnr_T)STRLEN(linecont)) | |
430 | num = 0; | |
431 | else | |
432 | { | |
433 | *************** | |
434 | *** 3967,3973 **** | |
435 | if (zeropad) | |
436 | *t++ = '0'; | |
437 | *t++ = '*'; | |
438 | ! *t++ = nbase == 16 ? base : (nbase == 8 ? 'o' : 'd'); | |
439 | *t = 0; | |
440 | ||
441 | for (n = num, l = 1; n >= nbase; n /= nbase) | |
442 | --- 3970,3976 ---- | |
443 | if (zeropad) | |
444 | *t++ = '0'; | |
445 | *t++ = '*'; | |
446 | ! *t++ = nbase == 16 ? base : (char_u)(nbase == 8 ? 'o' : 'd'); | |
447 | *t = 0; | |
448 | ||
449 | for (n = num, l = 1; n >= nbase; n /= nbase) | |
450 | *************** | |
451 | *** 4160,4172 **** | |
452 | #if defined(FEAT_STL_OPT) || defined(FEAT_CMDL_INFO) \ | |
453 | || defined(FEAT_GUI_TABLINE) || defined(PROTO) | |
454 | /* | |
455 | ! * Get relative cursor position in window into "str[]", in the form 99%, using | |
456 | ! * "Top", "Bot" or "All" when appropriate. | |
457 | */ | |
458 | void | |
459 | ! get_rel_pos(wp, str) | |
460 | win_T *wp; | |
461 | ! char_u *str; | |
462 | { | |
463 | long above; /* number of lines above window */ | |
464 | long below; /* number of lines below window */ | |
465 | --- 4163,4176 ---- | |
466 | #if defined(FEAT_STL_OPT) || defined(FEAT_CMDL_INFO) \ | |
467 | || defined(FEAT_GUI_TABLINE) || defined(PROTO) | |
468 | /* | |
469 | ! * Get relative cursor position in window into "buf[buflen]", in the form 99%, | |
470 | ! * using "Top", "Bot" or "All" when appropriate. | |
471 | */ | |
472 | void | |
473 | ! get_rel_pos(wp, buf, buflen) | |
474 | win_T *wp; | |
475 | ! char_u *buf; | |
476 | ! int buflen; | |
477 | { | |
478 | long above; /* number of lines above window */ | |
479 | long below; /* number of lines below window */ | |
480 | *************** | |
481 | *** 4177,4210 **** | |
482 | #endif | |
483 | below = wp->w_buffer->b_ml.ml_line_count - wp->w_botline + 1; | |
484 | if (below <= 0) | |
485 | ! STRCPY(str, above == 0 ? _("All") : _("Bot")); | |
486 | else if (above <= 0) | |
487 | ! STRCPY(str, _("Top")); | |
488 | else | |
489 | ! sprintf((char *)str, "%2d%%", above > 1000000L | |
490 | ? (int)(above / ((above + below) / 100L)) | |
491 | : (int)(above * 100L / (above + below))); | |
492 | } | |
493 | #endif | |
494 | ||
495 | /* | |
496 | ! * Append (file 2 of 8) to 'buf', if editing more than one file. | |
497 | * Return TRUE if it was appended. | |
498 | */ | |
499 | ! int | |
500 | ! append_arg_number(wp, buf, add_file, maxlen) | |
501 | win_T *wp; | |
502 | char_u *buf; | |
503 | int add_file; /* Add "file" before the arg number */ | |
504 | - int maxlen; /* maximum nr of chars in buf or zero*/ | |
505 | { | |
506 | char_u *p; | |
507 | ||
508 | if (ARGCOUNT <= 1) /* nothing to do */ | |
509 | return FALSE; | |
510 | ||
511 | ! p = buf + STRLEN(buf); /* go to the end of the buffer */ | |
512 | ! if (maxlen && p - buf + 35 >= maxlen) /* getting too long */ | |
513 | return FALSE; | |
514 | *p++ = ' '; | |
515 | *p++ = '('; | |
516 | --- 4181,4215 ---- | |
517 | #endif | |
518 | below = wp->w_buffer->b_ml.ml_line_count - wp->w_botline + 1; | |
519 | if (below <= 0) | |
520 | ! vim_strncpy(buf, (char_u *)(above == 0 ? _("All") : _("Bot")), | |
521 | ! (size_t)(buflen - 1)); | |
522 | else if (above <= 0) | |
523 | ! vim_strncpy(buf, (char_u *)_("Top"), (size_t)(buflen - 1)); | |
524 | else | |
525 | ! vim_snprintf((char *)buf, (size_t)buflen, "%2d%%", above > 1000000L | |
526 | ? (int)(above / ((above + below) / 100L)) | |
527 | : (int)(above * 100L / (above + below))); | |
528 | } | |
529 | #endif | |
530 | ||
531 | /* | |
532 | ! * Append (file 2 of 8) to "buf[buflen]", if editing more than one file. | |
533 | * Return TRUE if it was appended. | |
534 | */ | |
535 | ! static int | |
536 | ! append_arg_number(wp, buf, buflen, add_file) | |
537 | win_T *wp; | |
538 | char_u *buf; | |
539 | + int buflen; | |
540 | int add_file; /* Add "file" before the arg number */ | |
541 | { | |
542 | char_u *p; | |
543 | ||
544 | if (ARGCOUNT <= 1) /* nothing to do */ | |
545 | return FALSE; | |
546 | ||
547 | ! p = buf + STRLEN(buf); /* go to the end of the buffer */ | |
548 | ! if (p - buf + 35 >= buflen) /* getting too long */ | |
549 | return FALSE; | |
550 | *p++ = ' '; | |
551 | *p++ = '('; | |
552 | *************** | |
553 | *** 4213,4219 **** | |
554 | STRCPY(p, "file "); | |
555 | p += 5; | |
556 | } | |
557 | ! sprintf((char *)p, wp->w_arg_idx_invalid ? "(%d) of %d)" | |
558 | : "%d of %d)", wp->w_arg_idx + 1, ARGCOUNT); | |
559 | return TRUE; | |
560 | } | |
561 | --- 4218,4225 ---- | |
562 | STRCPY(p, "file "); | |
563 | p += 5; | |
564 | } | |
565 | ! vim_snprintf((char *)p, (size_t)(buflen - (p - buf)), | |
566 | ! wp->w_arg_idx_invalid ? "(%d) of %d)" | |
567 | : "%d of %d)", wp->w_arg_idx + 1, ARGCOUNT); | |
568 | return TRUE; | |
569 | } | |
570 | *************** | |
571 | *** 4996,5002 **** | |
572 | if (tab != NULL) | |
573 | { | |
574 | *tab++ = '\0'; | |
575 | ! col = atoi((char *)tab); | |
576 | tab = vim_strrchr(xline, '\t'); | |
577 | if (tab != NULL) | |
578 | { | |
579 | --- 5002,5008 ---- | |
580 | if (tab != NULL) | |
581 | { | |
582 | *tab++ = '\0'; | |
583 | ! col = (colnr_T)atoi((char *)tab); | |
584 | tab = vim_strrchr(xline, '\t'); | |
585 | if (tab != NULL) | |
586 | { | |
587 | *************** | |
588 | *** 5034,5039 **** | |
589 | --- 5040,5046 ---- | |
590 | #endif | |
591 | char_u *line; | |
592 | int max_buffers; | |
593 | + size_t len; | |
594 | ||
595 | if (find_viminfo_parameter('%') == NULL) | |
596 | return; | |
597 | *************** | |
598 | *** 5042,5048 **** | |
599 | max_buffers = get_viminfo_parameter('%'); | |
600 | ||
601 | /* Allocate room for the file name, lnum and col. */ | |
602 | ! line = alloc(MAXPATHL + 40); | |
603 | if (line == NULL) | |
604 | return; | |
605 | ||
606 | --- 5049,5056 ---- | |
607 | max_buffers = get_viminfo_parameter('%'); | |
608 | ||
609 | /* Allocate room for the file name, lnum and col. */ | |
610 | ! #define LINE_BUF_LEN (MAXPATHL + 40) | |
611 | ! line = alloc(LINE_BUF_LEN); | |
612 | if (line == NULL) | |
613 | return; | |
614 | ||
615 | *************** | |
616 | *** 5068,5074 **** | |
617 | break; | |
618 | putc('%', fp); | |
619 | home_replace(NULL, buf->b_ffname, line, MAXPATHL, TRUE); | |
620 | ! sprintf((char *)line + STRLEN(line), "\t%ld\t%d", | |
621 | (long)buf->b_last_cursor.lnum, | |
622 | buf->b_last_cursor.col); | |
623 | viminfo_writestring(fp, line); | |
624 | --- 5076,5083 ---- | |
625 | break; | |
626 | putc('%', fp); | |
627 | home_replace(NULL, buf->b_ffname, line, MAXPATHL, TRUE); | |
628 | ! len = STRLEN(line); | |
629 | ! vim_snprintf((char *)line + len, len - LINE_BUF_LEN, "\t%ld\t%d", | |
630 | (long)buf->b_last_cursor.lnum, | |
631 | buf->b_last_cursor.col); | |
632 | viminfo_writestring(fp, line); | |
633 | *************** | |
634 | *** 5226,5232 **** | |
635 | return; | |
636 | } | |
637 | ||
638 | ! int | |
639 | buf_change_sign_type(buf, markId, typenr) | |
640 | buf_T *buf; /* buffer to store sign in */ | |
641 | int markId; /* sign ID */ | |
642 | --- 5235,5241 ---- | |
643 | return; | |
644 | } | |
645 | ||
646 | ! linenr_T | |
647 | buf_change_sign_type(buf, markId, typenr) | |
648 | buf_T *buf; /* buffer to store sign in */ | |
649 | int markId; /* sign ID */ | |
650 | *************** | |
651 | *** 5243,5252 **** | |
652 | } | |
653 | } | |
654 | ||
655 | ! return 0; | |
656 | } | |
657 | ||
658 | ! int_u | |
659 | buf_getsigntype(buf, lnum, type) | |
660 | buf_T *buf; | |
661 | linenr_T lnum; | |
662 | --- 5252,5261 ---- | |
663 | } | |
664 | } | |
665 | ||
666 | ! return (linenr_T)0; | |
667 | } | |
668 | ||
669 | ! int | |
670 | buf_getsigntype(buf, lnum, type) | |
671 | buf_T *buf; | |
672 | linenr_T lnum; | |
673 | *** ../vim-7.2.166/src/charset.c 2008-07-24 21:30:44.000000000 +0200 | |
674 | --- src/charset.c 2009-05-05 18:17:11.000000000 +0200 | |
675 | *************** | |
676 | *** 17,23 **** | |
677 | static int win_nolbr_chartabsize __ARGS((win_T *wp, char_u *s, colnr_T col, int *headp)); | |
678 | #endif | |
679 | ||
680 | ! static int nr2hex __ARGS((int c)); | |
681 | ||
682 | static int chartab_initialized = FALSE; | |
683 | ||
684 | --- 17,23 ---- | |
685 | static int win_nolbr_chartabsize __ARGS((win_T *wp, char_u *s, colnr_T col, int *headp)); | |
686 | #endif | |
687 | ||
688 | ! static unsigned nr2hex __ARGS((unsigned c)); | |
689 | ||
690 | static int chartab_initialized = FALSE; | |
691 | ||
692 | *************** | |
693 | *** 664,670 **** | |
694 | } | |
695 | #endif | |
696 | buf[++i] = nr2hex((unsigned)c >> 4); | |
697 | ! buf[++i] = nr2hex(c); | |
698 | buf[++i] = '>'; | |
699 | buf[++i] = NUL; | |
700 | } | |
701 | --- 664,670 ---- | |
702 | } | |
703 | #endif | |
704 | buf[++i] = nr2hex((unsigned)c >> 4); | |
705 | ! buf[++i] = nr2hex((unsigned)c); | |
706 | buf[++i] = '>'; | |
707 | buf[++i] = NUL; | |
708 | } | |
709 | *************** | |
710 | *** 674,682 **** | |
711 | * Lower case letters are used to avoid the confusion of <F1> being 0xf1 or | |
712 | * function key 1. | |
713 | */ | |
714 | ! static int | |
715 | nr2hex(c) | |
716 | ! int c; | |
717 | { | |
718 | if ((c & 0xf) <= 9) | |
719 | return (c & 0xf) + '0'; | |
720 | --- 674,682 ---- | |
721 | * Lower case letters are used to avoid the confusion of <F1> being 0xf1 or | |
722 | * function key 1. | |
723 | */ | |
724 | ! static unsigned | |
725 | nr2hex(c) | |
726 | ! unsigned c; | |
727 | { | |
728 | if ((c & 0xf) <= 9) | |
729 | return (c & 0xf) + '0'; | |
730 | *************** | |
731 | *** 884,890 **** | |
732 | if (c >= 0x100) | |
733 | { | |
734 | if (enc_dbcs != 0) | |
735 | ! return dbcs_class((unsigned)c >> 8, c & 0xff) >= 2; | |
736 | if (enc_utf8) | |
737 | return utf_class(c) >= 2; | |
738 | } | |
739 | --- 884,890 ---- | |
740 | if (c >= 0x100) | |
741 | { | |
742 | if (enc_dbcs != 0) | |
743 | ! return dbcs_class((unsigned)c >> 8, (unsigned)(c & 0xff)) >= 2; | |
744 | if (enc_utf8) | |
745 | return utf_class(c) >= 2; | |
746 | } | |
747 | *************** | |
748 | *** 1090,1096 **** | |
749 | */ | |
750 | numberextra = win_col_off(wp); | |
751 | col2 = col; | |
752 | ! colmax = W_WIDTH(wp) - numberextra; | |
753 | if (col >= colmax) | |
754 | { | |
755 | n = colmax + win_col_off2(wp); | |
756 | --- 1090,1096 ---- | |
757 | */ | |
758 | numberextra = win_col_off(wp); | |
759 | col2 = col; | |
760 | ! colmax = (colnr_T)(W_WIDTH(wp) - numberextra); | |
761 | if (col >= colmax) | |
762 | { | |
763 | n = colmax + win_col_off2(wp); | |
764 | *************** | |
765 | *** 1201,1217 **** | |
766 | win_T *wp; | |
767 | colnr_T vcol; | |
768 | { | |
769 | ! colnr_T width1; /* width of first line (after line number) */ | |
770 | ! colnr_T width2; /* width of further lines */ | |
771 | ||
772 | #ifdef FEAT_VERTSPLIT | |
773 | if (wp->w_width == 0) /* there is no border */ | |
774 | return FALSE; | |
775 | #endif | |
776 | width1 = W_WIDTH(wp) - win_col_off(wp); | |
777 | ! if (vcol < width1 - 1) | |
778 | return FALSE; | |
779 | ! if (vcol == width1 - 1) | |
780 | return TRUE; | |
781 | width2 = width1 + win_col_off2(wp); | |
782 | return ((vcol - width1) % width2 == width2 - 1); | |
783 | --- 1201,1217 ---- | |
784 | win_T *wp; | |
785 | colnr_T vcol; | |
786 | { | |
787 | ! int width1; /* width of first line (after line number) */ | |
788 | ! int width2; /* width of further lines */ | |
789 | ||
790 | #ifdef FEAT_VERTSPLIT | |
791 | if (wp->w_width == 0) /* there is no border */ | |
792 | return FALSE; | |
793 | #endif | |
794 | width1 = W_WIDTH(wp) - win_col_off(wp); | |
795 | ! if ((int)vcol < width1 - 1) | |
796 | return FALSE; | |
797 | ! if ((int)vcol == width1 - 1) | |
798 | return TRUE; | |
799 | width2 = width1 + win_col_off2(wp); | |
800 | return ((vcol - width1) % width2 == width2 - 1); | |
801 | *************** | |
802 | *** 1396,1408 **** | |
803 | # ifdef FEAT_MBYTE | |
804 | /* Cannot put the cursor on part of a wide character. */ | |
805 | ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE); | |
806 | ! if (pos->col < STRLEN(ptr)) | |
807 | { | |
808 | int c = (*mb_ptr2char)(ptr + pos->col); | |
809 | ||
810 | if (c != TAB && vim_isprintc(c)) | |
811 | { | |
812 | ! endadd = char2cells(c) - 1; | |
813 | if (coladd > endadd) /* past end of line */ | |
814 | endadd = 0; | |
815 | else | |
816 | --- 1396,1408 ---- | |
817 | # ifdef FEAT_MBYTE | |
818 | /* Cannot put the cursor on part of a wide character. */ | |
819 | ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE); | |
820 | ! if (pos->col < (colnr_T)STRLEN(ptr)) | |
821 | { | |
822 | int c = (*mb_ptr2char)(ptr + pos->col); | |
823 | ||
824 | if (c != TAB && vim_isprintc(c)) | |
825 | { | |
826 | ! endadd = (colnr_T)(char2cells(c) - 1); | |
827 | if (coladd > endadd) /* past end of line */ | |
828 | endadd = 0; | |
829 | else | |
830 | *** ../vim-7.2.166/src/cleanlint.vim 2009-05-13 12:08:12.000000000 +0200 | |
831 | --- src/cleanlint.vim 2009-05-05 21:34:01.000000000 +0200 | |
832 | *************** | |
833 | *** 0 **** | |
834 | --- 1,27 ---- | |
835 | + " Vim tool: Filter output of splint | |
836 | + " | |
837 | + " Maintainer: Bram Moolenaar <Bram@vim.org> | |
838 | + " Last Change: 2009 May 05 | |
839 | + | |
840 | + " Usage: redirect output of "make lint" to a file, edit that file with Vim and | |
841 | + " :call CleanLint() | |
842 | + " This deletes irrelevant messages. What remains might be valid warnings. | |
843 | + | |
844 | + fun! CleanLint() | |
845 | + g/^ Types are incompatible/lockmarks d | |
846 | + g/Assignment of dev_t to __dev_t:/lockmarks d | |
847 | + g/Assignment of __dev_t to dev_t:/lockmarks d | |
848 | + g/Operands of == have incompatible types (__dev_t, dev_t): /lockmarks d | |
849 | + g/Operands of == have incompatible types (unsigned int, int): /lockmarks d | |
850 | + g/Assignment of char to char_u: /lockmarks d | |
851 | + g/Assignment of unsigned int to int: /lockmarks d | |
852 | + g/Assignment of colnr_T to int: /lockmarks d | |
853 | + g/Assignment of int to char_u: /lockmarks d | |
854 | + g/Function .* expects arg . to be wint_t gets int: /lockmarks d | |
855 | + g/^digraph.c.*digraphdefault.*is type char, expects char_u:/lockmarks d | |
856 | + g/^digraph.c.*Additional initialization errors for digraphdefault not reported/lockmarks d | |
857 | + g/Function strncasecmp expects arg 3 to be int gets size_t: /lockmarks d | |
858 | + g/ To ignore signs in type comparisons use +ignoresigns/lockmarks d | |
859 | + g/ To allow arbitrary integral types to match any integral type, use +matchanyintegral./lockmarks d | |
860 | + g/ To allow arbitrary integral types to match long unsigned, use +longintegral./lockmarks d | |
861 | + endfun | |
862 | *** ../vim-7.2.166/src/digraph.c 2008-06-25 00:26:41.000000000 +0200 | |
863 | --- src/digraph.c 2009-05-05 20:32:43.000000000 +0200 | |
864 | *************** | |
865 | *** 32,38 **** | |
866 | static void printdigraph __ARGS((digr_T *)); | |
867 | ||
868 | /* digraphs added by the user */ | |
869 | ! static garray_T user_digraphs = {0, 0, sizeof(digr_T), 10, NULL}; | |
870 | ||
871 | /* | |
872 | * Note: Characters marked with XX are not included literally, because some | |
873 | --- 32,38 ---- | |
874 | static void printdigraph __ARGS((digr_T *)); | |
875 | ||
876 | /* digraphs added by the user */ | |
877 | ! static garray_T user_digraphs = {0, 0, (int)sizeof(digr_T), 10, NULL}; | |
878 | ||
879 | /* | |
880 | * Note: Characters marked with XX are not included literally, because some | |
881 | *************** | |
882 | *** 2371,2380 **** | |
883 | } | |
884 | else | |
885 | #endif | |
886 | ! *p++ = dp->result; | |
887 | if (char2cells(dp->result) == 1) | |
888 | *p++ = ' '; | |
889 | ! sprintf((char *)p, " %3d", dp->result); | |
890 | msg_outtrans(buf); | |
891 | } | |
892 | } | |
893 | --- 2371,2380 ---- | |
894 | } | |
895 | else | |
896 | #endif | |
897 | ! *p++ = (char_u)dp->result; | |
898 | if (char2cells(dp->result) == 1) | |
899 | *p++ = ' '; | |
900 | ! vim_snprintf((char *)p, sizeof(buf) - (p - buf), " %3d", dp->result); | |
901 | msg_outtrans(buf); | |
902 | } | |
903 | } | |
904 | *************** | |
905 | *** 2395,2401 **** | |
906 | static void keymap_unload __ARGS((void)); | |
907 | ||
908 | /* | |
909 | ! * Set up key mapping tables for the 'keymap' option | |
910 | */ | |
911 | char_u * | |
912 | keymap_init() | |
913 | --- 2395,2404 ---- | |
914 | static void keymap_unload __ARGS((void)); | |
915 | ||
916 | /* | |
917 | ! * Set up key mapping tables for the 'keymap' option. | |
918 | ! * Returns NULL if OK, an error message for failure. This only needs to be | |
919 | ! * used when setting the option, not later when the value has already been | |
920 | ! * checked. | |
921 | */ | |
922 | char_u * | |
923 | keymap_init() | |
924 | *************** | |
925 | *** 2412,2436 **** | |
926 | else | |
927 | { | |
928 | char_u *buf; | |
929 | ||
930 | /* Source the keymap file. It will contain a ":loadkeymap" command | |
931 | * which will call ex_loadkeymap() below. */ | |
932 | ! buf = alloc((unsigned)(STRLEN(curbuf->b_p_keymap) | |
933 | # ifdef FEAT_MBYTE | |
934 | ! + STRLEN(p_enc) | |
935 | # endif | |
936 | ! + 14)); | |
937 | if (buf == NULL) | |
938 | return e_outofmem; | |
939 | ||
940 | # ifdef FEAT_MBYTE | |
941 | /* try finding "keymap/'keymap'_'encoding'.vim" in 'runtimepath' */ | |
942 | ! sprintf((char *)buf, "keymap/%s_%s.vim", curbuf->b_p_keymap, p_enc); | |
943 | if (source_runtime(buf, FALSE) == FAIL) | |
944 | # endif | |
945 | { | |
946 | /* try finding "keymap/'keymap'.vim" in 'runtimepath' */ | |
947 | ! sprintf((char *)buf, "keymap/%s.vim", curbuf->b_p_keymap); | |
948 | if (source_runtime(buf, FALSE) == FAIL) | |
949 | { | |
950 | vim_free(buf); | |
951 | --- 2415,2443 ---- | |
952 | else | |
953 | { | |
954 | char_u *buf; | |
955 | + size_t buflen; | |
956 | ||
957 | /* Source the keymap file. It will contain a ":loadkeymap" command | |
958 | * which will call ex_loadkeymap() below. */ | |
959 | ! buflen = STRLEN(curbuf->b_p_keymap) | |
960 | # ifdef FEAT_MBYTE | |
961 | ! + STRLEN(p_enc) | |
962 | # endif | |
963 | ! + 14; | |
964 | ! buf = alloc((unsigned)buflen); | |
965 | if (buf == NULL) | |
966 | return e_outofmem; | |
967 | ||
968 | # ifdef FEAT_MBYTE | |
969 | /* try finding "keymap/'keymap'_'encoding'.vim" in 'runtimepath' */ | |
970 | ! vim_snprintf((char *)buf, buflen, "keymap/%s_%s.vim", | |
971 | ! curbuf->b_p_keymap, p_enc); | |
972 | if (source_runtime(buf, FALSE) == FAIL) | |
973 | # endif | |
974 | { | |
975 | /* try finding "keymap/'keymap'.vim" in 'runtimepath' */ | |
976 | ! vim_snprintf((char *)buf, buflen, "keymap/%s.vim", | |
977 | ! curbuf->b_p_keymap); | |
978 | if (source_runtime(buf, FALSE) == FAIL) | |
979 | { | |
980 | vim_free(buf); | |
981 | *** ../vim-7.2.166/src/edit.c 2009-02-21 20:27:00.000000000 +0100 | |
982 | --- src/edit.c 2009-05-05 21:14:50.000000000 +0200 | |
983 | *************** | |
984 | *** 57,63 **** | |
985 | N_(" Keyword Local completion (^N^P)"), | |
986 | }; | |
987 | ||
988 | ! static char_u e_hitend[] = N_("Hit end of paragraph"); | |
989 | ||
990 | /* | |
991 | * Structure used to store one match for insert completion. | |
992 | --- 57,63 ---- | |
993 | N_(" Keyword Local completion (^N^P)"), | |
994 | }; | |
995 | ||
996 | ! static char e_hitend[] = N_("Hit end of paragraph"); | |
997 | ||
998 | /* | |
999 | * Structure used to store one match for insert completion. | |
1000 | *************** | |
1001 | *** 69,75 **** | |
1002 | --- 69,79 ---- | |
1003 | compl_T *cp_prev; | |
1004 | char_u *cp_str; /* matched text */ | |
1005 | char cp_icase; /* TRUE or FALSE: ignore case */ | |
1006 | + #ifdef S_SPLINT_S /* splint can't handle array of pointers */ | |
1007 | + char_u **cp_text; /* text for the menu */ | |
1008 | + #else | |
1009 | char_u *(cp_text[CPT_COUNT]); /* text for the menu */ | |
1010 | + #endif | |
1011 | char_u *cp_fname; /* file containing the match, allocated when | |
1012 | * cp_flags has FREE_FNAME */ | |
1013 | int cp_flags; /* ORIGINAL_TEXT, CONT_S_IPOS or FREE_FNAME */ | |
1014 | *************** | |
1015 | *** 306,312 **** | |
1016 | int c = 0; | |
1017 | char_u *ptr; | |
1018 | int lastc; | |
1019 | ! colnr_T mincol; | |
1020 | static linenr_T o_lnum = 0; | |
1021 | int i; | |
1022 | int did_backspace = TRUE; /* previous char was backspace */ | |
1023 | --- 310,316 ---- | |
1024 | int c = 0; | |
1025 | char_u *ptr; | |
1026 | int lastc; | |
1027 | ! int mincol; | |
1028 | static linenr_T o_lnum = 0; | |
1029 | int i; | |
1030 | int did_backspace = TRUE; /* previous char was backspace */ | |
1031 | *************** | |
1032 | *** 387,393 **** | |
1033 | if (startln) | |
1034 | Insstart.col = 0; | |
1035 | } | |
1036 | ! Insstart_textlen = linetabsize(ml_get_curline()); | |
1037 | Insstart_blank_vcol = MAXCOL; | |
1038 | if (!did_ai) | |
1039 | ai_col = 0; | |
1040 | --- 391,397 ---- | |
1041 | if (startln) | |
1042 | Insstart.col = 0; | |
1043 | } | |
1044 | ! Insstart_textlen = (colnr_T)linetabsize(ml_get_curline()); | |
1045 | Insstart_blank_vcol = MAXCOL; | |
1046 | if (!did_ai) | |
1047 | ai_col = 0; | |
1048 | *************** | |
1049 | *** 653,659 **** | |
1050 | mincol = curwin->w_wcol; | |
1051 | validate_cursor_col(); | |
1052 | ||
1053 | ! if ((int)curwin->w_wcol < (int)mincol - curbuf->b_p_ts | |
1054 | && curwin->w_wrow == W_WINROW(curwin) | |
1055 | + curwin->w_height - 1 - p_so | |
1056 | && (curwin->w_cursor.lnum != curwin->w_topline | |
1057 | --- 657,663 ---- | |
1058 | mincol = curwin->w_wcol; | |
1059 | validate_cursor_col(); | |
1060 | ||
1061 | ! if ((int)curwin->w_wcol < mincol - curbuf->b_p_ts | |
1062 | && curwin->w_wrow == W_WINROW(curwin) | |
1063 | + curwin->w_height - 1 - p_so | |
1064 | && (curwin->w_cursor.lnum != curwin->w_topline | |
1065 | *************** | |
1066 | *** 1773,1779 **** | |
1067 | * Compute the screen column where the cursor should be. | |
1068 | */ | |
1069 | vcol = get_indent() - vcol; | |
1070 | ! curwin->w_virtcol = (vcol < 0) ? 0 : vcol; | |
1071 | ||
1072 | /* | |
1073 | * Advance the cursor until we reach the right screen column. | |
1074 | --- 1777,1783 ---- | |
1075 | * Compute the screen column where the cursor should be. | |
1076 | */ | |
1077 | vcol = get_indent() - vcol; | |
1078 | ! curwin->w_virtcol = (colnr_T)((vcol < 0) ? 0 : vcol); | |
1079 | ||
1080 | /* | |
1081 | * Advance the cursor until we reach the right screen column. | |
1082 | *************** | |
1083 | *** 1800,1808 **** | |
1084 | */ | |
1085 | if (vcol != (int)curwin->w_virtcol) | |
1086 | { | |
1087 | ! curwin->w_cursor.col = new_cursor_col; | |
1088 | i = (int)curwin->w_virtcol - vcol; | |
1089 | ! ptr = alloc(i + 1); | |
1090 | if (ptr != NULL) | |
1091 | { | |
1092 | new_cursor_col += i; | |
1093 | --- 1804,1812 ---- | |
1094 | */ | |
1095 | if (vcol != (int)curwin->w_virtcol) | |
1096 | { | |
1097 | ! curwin->w_cursor.col = (colnr_T)new_cursor_col; | |
1098 | i = (int)curwin->w_virtcol - vcol; | |
1099 | ! ptr = alloc((unsigned)(i + 1)); | |
1100 | if (ptr != NULL) | |
1101 | { | |
1102 | new_cursor_col += i; | |
1103 | *************** | |
1104 | *** 1826,1832 **** | |
1105 | if (new_cursor_col <= 0) | |
1106 | curwin->w_cursor.col = 0; | |
1107 | else | |
1108 | ! curwin->w_cursor.col = new_cursor_col; | |
1109 | curwin->w_set_curswant = TRUE; | |
1110 | changed_cline_bef_curs(); | |
1111 | ||
1112 | --- 1830,1836 ---- | |
1113 | if (new_cursor_col <= 0) | |
1114 | curwin->w_cursor.col = 0; | |
1115 | else | |
1116 | ! curwin->w_cursor.col = (colnr_T)new_cursor_col; | |
1117 | curwin->w_set_curswant = TRUE; | |
1118 | changed_cline_bef_curs(); | |
1119 | ||
1120 | *************** | |
1121 | *** 1966,1972 **** | |
1122 | #ifdef FEAT_MBYTE | |
1123 | if (enc_utf8 && limit_col >= 0) | |
1124 | { | |
1125 | ! int ecol = curwin->w_cursor.col + 1; | |
1126 | ||
1127 | /* Make sure the cursor is at the start of a character, but | |
1128 | * skip forward again when going too far back because of a | |
1129 | --- 1970,1976 ---- | |
1130 | #ifdef FEAT_MBYTE | |
1131 | if (enc_utf8 && limit_col >= 0) | |
1132 | { | |
1133 | ! colnr_T ecol = curwin->w_cursor.col + 1; | |
1134 | ||
1135 | /* Make sure the cursor is at the start of a character, but | |
1136 | * skip forward again when going too far back because of a | |
1137 | *************** | |
1138 | *** 1982,1988 **** | |
1139 | } | |
1140 | if (*ml_get_cursor() == NUL || curwin->w_cursor.col == ecol) | |
1141 | return FALSE; | |
1142 | ! del_bytes((long)(ecol - curwin->w_cursor.col), FALSE, TRUE); | |
1143 | } | |
1144 | else | |
1145 | #endif | |
1146 | --- 1986,1992 ---- | |
1147 | } | |
1148 | if (*ml_get_cursor() == NUL || curwin->w_cursor.col == ecol) | |
1149 | return FALSE; | |
1150 | ! del_bytes((long)((int)ecol - curwin->w_cursor.col), FALSE, TRUE); | |
1151 | } | |
1152 | else | |
1153 | #endif | |
1154 | *************** | |
1155 | *** 2201,2207 **** | |
1156 | actual_compl_length = compl_length; | |
1157 | ||
1158 | /* Allocate wide character array for the completion and fill it. */ | |
1159 | ! wca = (int *)alloc(actual_len * sizeof(int)); | |
1160 | if (wca != NULL) | |
1161 | { | |
1162 | p = str; | |
1163 | --- 2205,2211 ---- | |
1164 | actual_compl_length = compl_length; | |
1165 | ||
1166 | /* Allocate wide character array for the completion and fill it. */ | |
1167 | ! wca = (int *)alloc((unsigned)(actual_len * sizeof(int))); | |
1168 | if (wca != NULL) | |
1169 | { | |
1170 | p = str; | |
1171 | *************** | |
1172 | *** 2580,2586 **** | |
1173 | */ | |
1174 | void | |
1175 | set_completion(startcol, list) | |
1176 | ! int startcol; | |
1177 | list_T *list; | |
1178 | { | |
1179 | /* If already doing completions stop it. */ | |
1180 | --- 2584,2590 ---- | |
1181 | */ | |
1182 | void | |
1183 | set_completion(startcol, list) | |
1184 | ! colnr_T startcol; | |
1185 | list_T *list; | |
1186 | { | |
1187 | /* If already doing completions stop it. */ | |
1188 | *************** | |
1189 | *** 2591,2600 **** | |
1190 | if (stop_arrow() == FAIL) | |
1191 | return; | |
1192 | ||
1193 | ! if (startcol > (int)curwin->w_cursor.col) | |
1194 | startcol = curwin->w_cursor.col; | |
1195 | compl_col = startcol; | |
1196 | ! compl_length = curwin->w_cursor.col - startcol; | |
1197 | /* compl_pattern doesn't need to be set */ | |
1198 | compl_orig_text = vim_strnsave(ml_get_curline() + compl_col, compl_length); | |
1199 | if (compl_orig_text == NULL || ins_compl_add(compl_orig_text, | |
1200 | --- 2595,2604 ---- | |
1201 | if (stop_arrow() == FAIL) | |
1202 | return; | |
1203 | ||
1204 | ! if (startcol > curwin->w_cursor.col) | |
1205 | startcol = curwin->w_cursor.col; | |
1206 | compl_col = startcol; | |
1207 | ! compl_length = (int)curwin->w_cursor.col - (int)startcol; | |
1208 | /* compl_pattern doesn't need to be set */ | |
1209 | compl_orig_text = vim_strnsave(ml_get_curline() + compl_col, compl_length); | |
1210 | if (compl_orig_text == NULL || ins_compl_add(compl_orig_text, | |
1211 | *************** | |
1212 | *** 2860,2866 **** | |
1213 | regmatch_T regmatch; | |
1214 | char_u **files; | |
1215 | int count; | |
1216 | - int i; | |
1217 | int save_p_scs; | |
1218 | int dir = compl_direction; | |
1219 | ||
1220 | --- 2864,2869 ---- | |
1221 | *************** | |
1222 | *** 2892,2908 **** | |
1223 | if (ctrl_x_mode == CTRL_X_WHOLE_LINE) | |
1224 | { | |
1225 | char_u *pat_esc = vim_strsave_escaped(pat, (char_u *)"\\"); | |
1226 | ||
1227 | if (pat_esc == NULL) | |
1228 | goto theend; | |
1229 | ! i = (int)STRLEN(pat_esc) + 10; | |
1230 | ! ptr = alloc(i); | |
1231 | if (ptr == NULL) | |
1232 | { | |
1233 | vim_free(pat_esc); | |
1234 | goto theend; | |
1235 | } | |
1236 | ! vim_snprintf((char *)ptr, i, "^\\s*\\zs\\V%s", pat_esc); | |
1237 | regmatch.regprog = vim_regcomp(ptr, RE_MAGIC); | |
1238 | vim_free(pat_esc); | |
1239 | vim_free(ptr); | |
1240 | --- 2895,2912 ---- | |
1241 | if (ctrl_x_mode == CTRL_X_WHOLE_LINE) | |
1242 | { | |
1243 | char_u *pat_esc = vim_strsave_escaped(pat, (char_u *)"\\"); | |
1244 | + size_t len; | |
1245 | ||
1246 | if (pat_esc == NULL) | |
1247 | goto theend; | |
1248 | ! len = STRLEN(pat_esc) + 10; | |
1249 | ! ptr = alloc((unsigned)len); | |
1250 | if (ptr == NULL) | |
1251 | { | |
1252 | vim_free(pat_esc); | |
1253 | goto theend; | |
1254 | } | |
1255 | ! vim_snprintf((char *)ptr, len, "^\\s*\\zs\\V%s", pat_esc); | |
1256 | regmatch.regprog = vim_regcomp(ptr, RE_MAGIC); | |
1257 | vim_free(pat_esc); | |
1258 | vim_free(ptr); | |
1259 | *************** | |
1260 | *** 2993,2999 **** | |
1261 | { | |
1262 | vim_snprintf((char *)IObuff, IOSIZE, | |
1263 | _("Scanning dictionary: %s"), (char *)files[i]); | |
1264 | ! msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R)); | |
1265 | } | |
1266 | ||
1267 | if (fp != NULL) | |
1268 | --- 2997,3003 ---- | |
1269 | { | |
1270 | vim_snprintf((char *)IObuff, IOSIZE, | |
1271 | _("Scanning dictionary: %s"), (char *)files[i]); | |
1272 | ! (void)msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R)); | |
1273 | } | |
1274 | ||
1275 | if (fp != NULL) | |
1276 | *************** | |
1277 | *** 3311,3317 **** | |
1278 | static int | |
1279 | ins_compl_len() | |
1280 | { | |
1281 | ! int off = curwin->w_cursor.col - compl_col; | |
1282 | ||
1283 | if (off < 0) | |
1284 | return 0; | |
1285 | --- 3315,3321 ---- | |
1286 | static int | |
1287 | ins_compl_len() | |
1288 | { | |
1289 | ! int off = (int)curwin->w_cursor.col - (int)compl_col; | |
1290 | ||
1291 | if (off < 0) | |
1292 | return 0; | |
1293 | *************** | |
1294 | *** 3347,3353 **** | |
1295 | ||
1296 | vim_free(compl_leader); | |
1297 | compl_leader = vim_strnsave(ml_get_curline() + compl_col, | |
1298 | ! curwin->w_cursor.col - compl_col); | |
1299 | if (compl_leader != NULL) | |
1300 | ins_compl_new_leader(); | |
1301 | } | |
1302 | --- 3351,3357 ---- | |
1303 | ||
1304 | vim_free(compl_leader); | |
1305 | compl_leader = vim_strnsave(ml_get_curline() + compl_col, | |
1306 | ! (int)(curwin->w_cursor.col - compl_col)); | |
1307 | if (compl_leader != NULL) | |
1308 | ins_compl_new_leader(); | |
1309 | } | |
1310 | *************** | |
1311 | *** 3395,3401 **** | |
1312 | ins_compl_addfrommatch() | |
1313 | { | |
1314 | char_u *p; | |
1315 | ! int len = curwin->w_cursor.col - compl_col; | |
1316 | int c; | |
1317 | compl_T *cp; | |
1318 | ||
1319 | --- 3399,3405 ---- | |
1320 | ins_compl_addfrommatch() | |
1321 | { | |
1322 | char_u *p; | |
1323 | ! int len = (int)curwin->w_cursor.col - (int)compl_col; | |
1324 | int c; | |
1325 | compl_T *cp; | |
1326 | ||
1327 | *************** | |
1328 | *** 3961,3967 **** | |
1329 | : ins_buf->b_sfname == NULL | |
1330 | ? (char *)ins_buf->b_fname | |
1331 | : (char *)ins_buf->b_sfname); | |
1332 | ! msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R)); | |
1333 | } | |
1334 | else if (*e_cpt == NUL) | |
1335 | break; | |
1336 | --- 3965,3971 ---- | |
1337 | : ins_buf->b_sfname == NULL | |
1338 | ? (char *)ins_buf->b_fname | |
1339 | : (char *)ins_buf->b_sfname); | |
1340 | ! (void)msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R)); | |
1341 | } | |
1342 | else if (*e_cpt == NUL) | |
1343 | break; | |
1344 | *************** | |
1345 | *** 3991,3997 **** | |
1346 | { | |
1347 | type = CTRL_X_TAGS; | |
1348 | sprintf((char*)IObuff, _("Scanning tags.")); | |
1349 | ! msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R)); | |
1350 | } | |
1351 | else | |
1352 | type = -1; | |
1353 | --- 3995,4001 ---- | |
1354 | { | |
1355 | type = CTRL_X_TAGS; | |
1356 | sprintf((char*)IObuff, _("Scanning tags.")); | |
1357 | ! (void)msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R)); | |
1358 | } | |
1359 | else | |
1360 | type = -1; | |
1361 | *************** | |
1362 | *** 6320,6326 **** | |
1363 | ins_need_undo = FALSE; | |
1364 | } | |
1365 | Insstart = curwin->w_cursor; /* new insertion starts here */ | |
1366 | ! Insstart_textlen = linetabsize(ml_get_curline()); | |
1367 | ai_col = 0; | |
1368 | #ifdef FEAT_VREPLACE | |
1369 | if (State & VREPLACE_FLAG) | |
1370 | --- 6324,6330 ---- | |
1371 | ins_need_undo = FALSE; | |
1372 | } | |
1373 | Insstart = curwin->w_cursor; /* new insertion starts here */ | |
1374 | ! Insstart_textlen = (colnr_T)linetabsize(ml_get_curline()); | |
1375 | ai_col = 0; | |
1376 | #ifdef FEAT_VREPLACE | |
1377 | if (State & VREPLACE_FLAG) | |
1378 | *** ../vim-7.2.166/src/ex_cmds.c 2009-04-29 18:44:38.000000000 +0200 | |
1379 | --- src/ex_cmds.c 2009-05-05 17:55:40.000000000 +0200 | |
1380 | *************** | |
1381 | *** 1789,1795 **** | |
1382 | * overwrite a user's viminfo file after a "su root", with a | |
1383 | * viminfo file that the user can't read. | |
1384 | */ | |
1385 | ! st_old.st_dev = 0; | |
1386 | st_old.st_ino = 0; | |
1387 | st_old.st_mode = 0600; | |
1388 | if (mch_stat((char *)fname, &st_old) == 0 | |
1389 | --- 1789,1795 ---- | |
1390 | * overwrite a user's viminfo file after a "su root", with a | |
1391 | * viminfo file that the user can't read. | |
1392 | */ | |
1393 | ! st_old.st_dev = (dev_t)0; | |
1394 | st_old.st_ino = 0; | |
1395 | st_old.st_mode = 0600; | |
1396 | if (mch_stat((char *)fname, &st_old) == 0 | |
1397 | *************** | |
1398 | *** 3715,3721 **** | |
1399 | /* If the window options were changed may need to set the spell language. | |
1400 | * Can only do this after the buffer has been properly setup. */ | |
1401 | if (did_get_winopts && curwin->w_p_spell && *curbuf->b_p_spl != NUL) | |
1402 | ! did_set_spelllang(curbuf); | |
1403 | #endif | |
1404 | ||
1405 | if (command == NULL) | |
1406 | --- 3715,3721 ---- | |
1407 | /* If the window options were changed may need to set the spell language. | |
1408 | * Can only do this after the buffer has been properly setup. */ | |
1409 | if (did_get_winopts && curwin->w_p_spell && *curbuf->b_p_spl != NUL) | |
1410 | ! (void)did_set_spelllang(curbuf); | |
1411 | #endif | |
1412 | ||
1413 | if (command == NULL) | |
1414 | *************** | |
1415 | *** 3788,3794 **** | |
1416 | ||
1417 | #ifdef FEAT_KEYMAP | |
1418 | if (curbuf->b_kmap_state & KEYMAP_INIT) | |
1419 | ! keymap_init(); | |
1420 | #endif | |
1421 | ||
1422 | --RedrawingDisabled; | |
1423 | --- 3788,3794 ---- | |
1424 | ||
1425 | #ifdef FEAT_KEYMAP | |
1426 | if (curbuf->b_kmap_state & KEYMAP_INIT) | |
1427 | ! (void)keymap_init(); | |
1428 | #endif | |
1429 | ||
1430 | --RedrawingDisabled; | |
1431 | *** ../vim-7.2.166/src/globals.h 2009-03-05 03:13:51.000000000 +0100 | |
1432 | --- src/globals.h 2009-05-09 21:14:49.000000000 +0200 | |
1433 | *************** | |
1434 | *** 524,530 **** | |
1435 | EXTERN win_T *prevwin INIT(= NULL); /* previous window */ | |
1436 | # define W_NEXT(wp) ((wp)->w_next) | |
1437 | # define FOR_ALL_WINDOWS(wp) for (wp = firstwin; wp != NULL; wp = wp->w_next) | |
1438 | ! #define FOR_ALL_TAB_WINDOWS(tp, wp) \ | |
1439 | for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \ | |
1440 | for ((wp) = ((tp) == curtab) \ | |
1441 | ? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next) | |
1442 | --- 524,530 ---- | |
1443 | EXTERN win_T *prevwin INIT(= NULL); /* previous window */ | |
1444 | # define W_NEXT(wp) ((wp)->w_next) | |
1445 | # define FOR_ALL_WINDOWS(wp) for (wp = firstwin; wp != NULL; wp = wp->w_next) | |
1446 | ! # define FOR_ALL_TAB_WINDOWS(tp, wp) \ | |
1447 | for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \ | |
1448 | for ((wp) = ((tp) == curtab) \ | |
1449 | ? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next) | |
1450 | *************** | |
1451 | *** 718,724 **** | |
1452 | ||
1453 | EXTERN pos_T saved_cursor /* w_cursor before formatting text. */ | |
1454 | # ifdef DO_INIT | |
1455 | ! = INIT_POS_T | |
1456 | # endif | |
1457 | ; | |
1458 | ||
1459 | --- 718,724 ---- | |
1460 | ||
1461 | EXTERN pos_T saved_cursor /* w_cursor before formatting text. */ | |
1462 | # ifdef DO_INIT | |
1463 | ! = INIT_POS_T(0, 0, 0) | |
1464 | # endif | |
1465 | ; | |
1466 | ||
1467 | *************** | |
1468 | *** 1039,1045 **** | |
1469 | EXTERN int did_cursorhold INIT(= FALSE); /* set when CursorHold t'gerd */ | |
1470 | EXTERN pos_T last_cursormoved /* for CursorMoved event */ | |
1471 | # ifdef DO_INIT | |
1472 | ! = INIT_POS_T | |
1473 | # endif | |
1474 | ; | |
1475 | #endif | |
1476 | --- 1039,1045 ---- | |
1477 | EXTERN int did_cursorhold INIT(= FALSE); /* set when CursorHold t'gerd */ | |
1478 | EXTERN pos_T last_cursormoved /* for CursorMoved event */ | |
1479 | # ifdef DO_INIT | |
1480 | ! = INIT_POS_T(0, 0, 0) | |
1481 | # endif | |
1482 | ; | |
1483 | #endif | |
1484 | *** ../vim-7.2.166/src/ops.c 2009-04-29 17:39:17.000000000 +0200 | |
1485 | --- src/ops.c 2009-05-13 12:41:02.000000000 +0200 | |
1486 | *************** | |
1487 | *** 6400,6406 **** | |
1488 | { | |
1489 | getvcols(curwin, &min_pos, &max_pos, &min_pos.col, | |
1490 | &max_pos.col); | |
1491 | ! sprintf((char *)buf1, _("%ld Cols; "), | |
1492 | (long)(oparg.end_vcol - oparg.start_vcol + 1)); | |
1493 | } | |
1494 | else | |
1495 | --- 6400,6406 ---- | |
1496 | { | |
1497 | getvcols(curwin, &min_pos, &max_pos, &min_pos.col, | |
1498 | &max_pos.col); | |
1499 | ! vim_snprintf((char *)buf1, sizeof(buf1), _("%ld Cols; "), | |
1500 | (long)(oparg.end_vcol - oparg.start_vcol + 1)); | |
1501 | } | |
1502 | else | |
1503 | *************** | |
1504 | *** 6408,6420 **** | |
1505 | ||
1506 | if (char_count_cursor == byte_count_cursor | |
1507 | && char_count == byte_count) | |
1508 | ! sprintf((char *)IObuff, _("Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"), | |
1509 | buf1, line_count_selected, | |
1510 | (long)curbuf->b_ml.ml_line_count, | |
1511 | word_count_cursor, word_count, | |
1512 | byte_count_cursor, byte_count); | |
1513 | else | |
1514 | ! sprintf((char *)IObuff, _("Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Chars; %ld of %ld Bytes"), | |
1515 | buf1, line_count_selected, | |
1516 | (long)curbuf->b_ml.ml_line_count, | |
1517 | word_count_cursor, word_count, | |
1518 | --- 6408,6422 ---- | |
1519 | ||
1520 | if (char_count_cursor == byte_count_cursor | |
1521 | && char_count == byte_count) | |
1522 | ! vim_snprintf((char *)IObuff, IOSIZE, | |
1523 | ! _("Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"), | |
1524 | buf1, line_count_selected, | |
1525 | (long)curbuf->b_ml.ml_line_count, | |
1526 | word_count_cursor, word_count, | |
1527 | byte_count_cursor, byte_count); | |
1528 | else | |
1529 | ! vim_snprintf((char *)IObuff, IOSIZE, | |
1530 | ! _("Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Chars; %ld of %ld Bytes"), | |
1531 | buf1, line_count_selected, | |
1532 | (long)curbuf->b_ml.ml_line_count, | |
1533 | word_count_cursor, word_count, | |
1534 | *************** | |
1535 | *** 6426,6445 **** | |
1536 | { | |
1537 | p = ml_get_curline(); | |
1538 | validate_virtcol(); | |
1539 | ! col_print(buf1, (int)curwin->w_cursor.col + 1, | |
1540 | (int)curwin->w_virtcol + 1); | |
1541 | ! col_print(buf2, (int)STRLEN(p), linetabsize(p)); | |
1542 | ||
1543 | if (char_count_cursor == byte_count_cursor | |
1544 | && char_count == byte_count) | |
1545 | ! sprintf((char *)IObuff, _("Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"), | |
1546 | (char *)buf1, (char *)buf2, | |
1547 | (long)curwin->w_cursor.lnum, | |
1548 | (long)curbuf->b_ml.ml_line_count, | |
1549 | word_count_cursor, word_count, | |
1550 | byte_count_cursor, byte_count); | |
1551 | else | |
1552 | ! sprintf((char *)IObuff, _("Col %s of %s; Line %ld of %ld; Word %ld of %ld; Char %ld of %ld; Byte %ld of %ld"), | |
1553 | (char *)buf1, (char *)buf2, | |
1554 | (long)curwin->w_cursor.lnum, | |
1555 | (long)curbuf->b_ml.ml_line_count, | |
1556 | --- 6428,6449 ---- | |
1557 | { | |
1558 | p = ml_get_curline(); | |
1559 | validate_virtcol(); | |
1560 | ! col_print(buf1, sizeof(buf1), (int)curwin->w_cursor.col + 1, | |
1561 | (int)curwin->w_virtcol + 1); | |
1562 | ! col_print(buf2, sizeof(buf2), (int)STRLEN(p), linetabsize(p)); | |
1563 | ||
1564 | if (char_count_cursor == byte_count_cursor | |
1565 | && char_count == byte_count) | |
1566 | ! vim_snprintf((char *)IObuff, IOSIZE, | |
1567 | ! _("Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"), | |
1568 | (char *)buf1, (char *)buf2, | |
1569 | (long)curwin->w_cursor.lnum, | |
1570 | (long)curbuf->b_ml.ml_line_count, | |
1571 | word_count_cursor, word_count, | |
1572 | byte_count_cursor, byte_count); | |
1573 | else | |
1574 | ! vim_snprintf((char *)IObuff, IOSIZE, | |
1575 | ! _("Col %s of %s; Line %ld of %ld; Word %ld of %ld; Char %ld of %ld; Byte %ld of %ld"), | |
1576 | (char *)buf1, (char *)buf2, | |
1577 | (long)curwin->w_cursor.lnum, | |
1578 | (long)curbuf->b_ml.ml_line_count, | |
1579 | *** ../vim-7.2.166/src/os_unix.c 2009-03-02 02:44:54.000000000 +0100 | |
1580 | --- src/os_unix.c 2009-05-05 17:35:58.000000000 +0200 | |
1581 | *************** | |
1582 | *** 199,205 **** | |
1583 | #endif | |
1584 | ||
1585 | #ifndef SIG_ERR | |
1586 | ! # define SIG_ERR ((RETSIGTYPE (*)())-1) | |
1587 | #endif | |
1588 | ||
1589 | /* volatile because it is used in signal handler sig_winch(). */ | |
1590 | --- 199,207 ---- | |
1591 | #endif | |
1592 | ||
1593 | #ifndef SIG_ERR | |
1594 | ! # ifndef S_SPLINT_S | |
1595 | ! # define SIG_ERR ((RETSIGTYPE (*)())-1) | |
1596 | ! # endif | |
1597 | #endif | |
1598 | ||
1599 | /* volatile because it is used in signal handler sig_winch(). */ | |
1600 | *************** | |
1601 | *** 441,447 **** | |
1602 | ||
1603 | #if defined(HAVE_TOTAL_MEM) || defined(PROTO) | |
1604 | # ifdef HAVE_SYS_RESOURCE_H | |
1605 | ! # include <sys/resource.h> | |
1606 | # endif | |
1607 | # if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTL) | |
1608 | # include <sys/sysctl.h> | |
1609 | --- 443,451 ---- | |
1610 | ||
1611 | #if defined(HAVE_TOTAL_MEM) || defined(PROTO) | |
1612 | # ifdef HAVE_SYS_RESOURCE_H | |
1613 | ! # ifndef S_SPLINT_S /* splint crashes on bits/resource.h */ | |
1614 | ! # include <sys/resource.h> | |
1615 | ! # endif | |
1616 | # endif | |
1617 | # if defined(HAVE_SYS_SYSCTL_H) && defined(HAVE_SYSCTL) | |
1618 | # include <sys/sysctl.h> | |
1619 | *** ../vim-7.2.166/src/os_unix.h 2008-06-20 18:06:36.000000000 +0200 | |
1620 | --- src/os_unix.h 2009-05-05 17:07:45.000000000 +0200 | |
1621 | *************** | |
1622 | *** 53,59 **** | |
1623 | #endif | |
1624 | ||
1625 | #ifdef HAVE_UNISTD_H | |
1626 | ! # include <unistd.h> | |
1627 | #endif | |
1628 | ||
1629 | #ifdef HAVE_LIBC_H | |
1630 | --- 53,61 ---- | |
1631 | #endif | |
1632 | ||
1633 | #ifdef HAVE_UNISTD_H | |
1634 | ! # ifndef S_SPLINT_S /* splint crashes on bits/confname.h */ | |
1635 | ! # include <unistd.h> | |
1636 | ! # endif | |
1637 | #endif | |
1638 | ||
1639 | #ifdef HAVE_LIBC_H | |
1640 | *** ../vim-7.2.166/src/proto/buffer.pro 2008-11-15 14:10:23.000000000 +0100 | |
1641 | --- src/proto/buffer.pro 2009-05-13 12:23:41.000000000 +0200 | |
1642 | *************** | |
1643 | *** 37,49 **** | |
1644 | int otherfile __ARGS((char_u *ffname)); | |
1645 | void buf_setino __ARGS((buf_T *buf)); | |
1646 | void fileinfo __ARGS((int fullname, int shorthelp, int dont_truncate)); | |
1647 | ! void col_print __ARGS((char_u *buf, int col, int vcol)); | |
1648 | void maketitle __ARGS((void)); | |
1649 | void resettitle __ARGS((void)); | |
1650 | void free_titles __ARGS((void)); | |
1651 | int build_stl_str_hl __ARGS((win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use_sandbox, int fillchar, int maxwidth, struct stl_hlrec *hltab, struct stl_hlrec *tabtab)); | |
1652 | ! void get_rel_pos __ARGS((win_T *wp, char_u *str)); | |
1653 | ! int append_arg_number __ARGS((win_T *wp, char_u *buf, int add_file, int maxlen)); | |
1654 | char_u *fix_fname __ARGS((char_u *fname)); | |
1655 | void fname_expand __ARGS((buf_T *buf, char_u **ffname, char_u **sfname)); | |
1656 | char_u *alist_name __ARGS((aentry_T *aep)); | |
1657 | --- 37,48 ---- | |
1658 | int otherfile __ARGS((char_u *ffname)); | |
1659 | void buf_setino __ARGS((buf_T *buf)); | |
1660 | void fileinfo __ARGS((int fullname, int shorthelp, int dont_truncate)); | |
1661 | ! void col_print __ARGS((char_u *buf, size_t buflen, int col, int vcol)); | |
1662 | void maketitle __ARGS((void)); | |
1663 | void resettitle __ARGS((void)); | |
1664 | void free_titles __ARGS((void)); | |
1665 | int build_stl_str_hl __ARGS((win_T *wp, char_u *out, size_t outlen, char_u *fmt, int use_sandbox, int fillchar, int maxwidth, struct stl_hlrec *hltab, struct stl_hlrec *tabtab)); | |
1666 | ! void get_rel_pos __ARGS((win_T *wp, char_u *buf, int buflen)); | |
1667 | char_u *fix_fname __ARGS((char_u *fname)); | |
1668 | void fname_expand __ARGS((buf_T *buf, char_u **ffname, char_u **sfname)); | |
1669 | char_u *alist_name __ARGS((aentry_T *aep)); | |
1670 | *************** | |
1671 | *** 54,61 **** | |
1672 | void write_viminfo_bufferlist __ARGS((FILE *fp)); | |
1673 | char *buf_spname __ARGS((buf_T *buf)); | |
1674 | void buf_addsign __ARGS((buf_T *buf, int id, linenr_T lnum, int typenr)); | |
1675 | ! int buf_change_sign_type __ARGS((buf_T *buf, int markId, int typenr)); | |
1676 | ! int_u buf_getsigntype __ARGS((buf_T *buf, linenr_T lnum, int type)); | |
1677 | linenr_T buf_delsign __ARGS((buf_T *buf, int id)); | |
1678 | int buf_findsign __ARGS((buf_T *buf, int id)); | |
1679 | int buf_findsign_id __ARGS((buf_T *buf, linenr_T lnum)); | |
1680 | --- 53,60 ---- | |
1681 | void write_viminfo_bufferlist __ARGS((FILE *fp)); | |
1682 | char *buf_spname __ARGS((buf_T *buf)); | |
1683 | void buf_addsign __ARGS((buf_T *buf, int id, linenr_T lnum, int typenr)); | |
1684 | ! linenr_T buf_change_sign_type __ARGS((buf_T *buf, int markId, int typenr)); | |
1685 | ! int buf_getsigntype __ARGS((buf_T *buf, linenr_T lnum, int type)); | |
1686 | linenr_T buf_delsign __ARGS((buf_T *buf, int id)); | |
1687 | int buf_findsign __ARGS((buf_T *buf, int id)); | |
1688 | int buf_findsign_id __ARGS((buf_T *buf, linenr_T lnum)); | |
1689 | *** ../vim-7.2.166/src/proto/edit.pro 2008-01-16 20:03:13.000000000 +0100 | |
1690 | --- src/proto/edit.pro 2009-05-05 20:51:56.000000000 +0200 | |
1691 | *************** | |
1692 | *** 8,14 **** | |
1693 | void backspace_until_column __ARGS((int col)); | |
1694 | int vim_is_ctrl_x_key __ARGS((int c)); | |
1695 | int ins_compl_add_infercase __ARGS((char_u *str, int len, int icase, char_u *fname, int dir, int flags)); | |
1696 | ! void set_completion __ARGS((int startcol, list_T *list)); | |
1697 | void ins_compl_show_pum __ARGS((void)); | |
1698 | char_u *find_word_start __ARGS((char_u *ptr)); | |
1699 | char_u *find_word_end __ARGS((char_u *ptr)); | |
1700 | --- 8,14 ---- | |
1701 | void backspace_until_column __ARGS((int col)); | |
1702 | int vim_is_ctrl_x_key __ARGS((int c)); | |
1703 | int ins_compl_add_infercase __ARGS((char_u *str, int len, int icase, char_u *fname, int dir, int flags)); | |
1704 | ! void set_completion __ARGS((colnr_T startcol, list_T *list)); | |
1705 | void ins_compl_show_pum __ARGS((void)); | |
1706 | char_u *find_word_start __ARGS((char_u *ptr)); | |
1707 | char_u *find_word_end __ARGS((char_u *ptr)); | |
1708 | *** ../vim-7.2.166/src/screen.c 2009-03-18 19:07:09.000000000 +0100 | |
1709 | --- src/screen.c 2009-05-05 17:42:45.000000000 +0200 | |
1710 | *************** | |
1711 | *** 9481,9493 **** | |
1712 | win_T *wp; | |
1713 | int always; | |
1714 | { | |
1715 | ! char_u buffer[70]; | |
1716 | int row; | |
1717 | int fillchar; | |
1718 | int attr; | |
1719 | int empty_line = FALSE; | |
1720 | colnr_T virtcol; | |
1721 | int i; | |
1722 | int o; | |
1723 | #ifdef FEAT_VERTSPLIT | |
1724 | int this_ru_col; | |
1725 | --- 9481,9495 ---- | |
1726 | win_T *wp; | |
1727 | int always; | |
1728 | { | |
1729 | ! #define RULER_BUF_LEN 70 | |
1730 | ! char_u buffer[RULER_BUF_LEN]; | |
1731 | int row; | |
1732 | int fillchar; | |
1733 | int attr; | |
1734 | int empty_line = FALSE; | |
1735 | colnr_T virtcol; | |
1736 | int i; | |
1737 | + size_t len; | |
1738 | int o; | |
1739 | #ifdef FEAT_VERTSPLIT | |
1740 | int this_ru_col; | |
1741 | *************** | |
1742 | *** 9602,9612 **** | |
1743 | * Some sprintfs return the length, some return a pointer. | |
1744 | * To avoid portability problems we use strlen() here. | |
1745 | */ | |
1746 | ! sprintf((char *)buffer, "%ld,", | |
1747 | (wp->w_buffer->b_ml.ml_flags & ML_EMPTY) | |
1748 | ? 0L | |
1749 | : (long)(wp->w_cursor.lnum)); | |
1750 | ! col_print(buffer + STRLEN(buffer), | |
1751 | empty_line ? 0 : (int)wp->w_cursor.col + 1, | |
1752 | (int)virtcol + 1); | |
1753 | ||
1754 | --- 9604,9615 ---- | |
1755 | * Some sprintfs return the length, some return a pointer. | |
1756 | * To avoid portability problems we use strlen() here. | |
1757 | */ | |
1758 | ! vim_snprintf((char *)buffer, RULER_BUF_LEN, "%ld,", | |
1759 | (wp->w_buffer->b_ml.ml_flags & ML_EMPTY) | |
1760 | ? 0L | |
1761 | : (long)(wp->w_cursor.lnum)); | |
1762 | ! len = STRLEN(buffer); | |
1763 | ! col_print(buffer + len, RULER_BUF_LEN - len, | |
1764 | empty_line ? 0 : (int)wp->w_cursor.col + 1, | |
1765 | (int)virtcol + 1); | |
1766 | ||
1767 | *************** | |
1768 | *** 9616,9622 **** | |
1769 | * screen up on some terminals). | |
1770 | */ | |
1771 | i = (int)STRLEN(buffer); | |
1772 | ! get_rel_pos(wp, buffer + i + 1); | |
1773 | o = i + vim_strsize(buffer + i + 1); | |
1774 | #ifdef FEAT_WINDOWS | |
1775 | if (wp->w_status_height == 0) /* can't use last char of screen */ | |
1776 | --- 9619,9625 ---- | |
1777 | * screen up on some terminals). | |
1778 | */ | |
1779 | i = (int)STRLEN(buffer); | |
1780 | ! get_rel_pos(wp, buffer + i + 1, RULER_BUF_LEN - i - 1); | |
1781 | o = i + vim_strsize(buffer + i + 1); | |
1782 | #ifdef FEAT_WINDOWS | |
1783 | if (wp->w_status_height == 0) /* can't use last char of screen */ | |
1784 | *************** | |
1785 | *** 9643,9649 **** | |
1786 | buffer[i++] = fillchar; | |
1787 | ++o; | |
1788 | } | |
1789 | ! get_rel_pos(wp, buffer + i); | |
1790 | } | |
1791 | /* Truncate at window boundary. */ | |
1792 | #ifdef FEAT_MBYTE | |
1793 | --- 9646,9652 ---- | |
1794 | buffer[i++] = fillchar; | |
1795 | ++o; | |
1796 | } | |
1797 | ! get_rel_pos(wp, buffer + i, RULER_BUF_LEN - i); | |
1798 | } | |
1799 | /* Truncate at window boundary. */ | |
1800 | #ifdef FEAT_MBYTE | |
1801 | *** ../vim-7.2.166/src/structs.h 2008-11-15 16:05:30.000000000 +0100 | |
1802 | --- src/structs.h 2009-05-05 18:20:36.000000000 +0200 | |
1803 | *************** | |
1804 | *** 33,41 **** | |
1805 | } pos_T; | |
1806 | ||
1807 | #ifdef FEAT_VIRTUALEDIT | |
1808 | ! # define INIT_POS_T {0, 0, 0} | |
1809 | #else | |
1810 | ! # define INIT_POS_T {0, 0} | |
1811 | #endif | |
1812 | ||
1813 | /* | |
1814 | --- 33,41 ---- | |
1815 | } pos_T; | |
1816 | ||
1817 | #ifdef FEAT_VIRTUALEDIT | |
1818 | ! # define INIT_POS_T(l, c, ca) {l, c, ca} | |
1819 | #else | |
1820 | ! # define INIT_POS_T(l, c, ca) {l, c} | |
1821 | #endif | |
1822 | ||
1823 | /* | |
1824 | *************** | |
1825 | *** 1166,1172 **** | |
1826 | char_u *b_fname; /* current file name */ | |
1827 | ||
1828 | #ifdef UNIX | |
1829 | ! int b_dev; /* device number (-1 if not set) */ | |
1830 | ino_t b_ino; /* inode number */ | |
1831 | #endif | |
1832 | #ifdef FEAT_CW_EDITOR | |
1833 | --- 1166,1172 ---- | |
1834 | char_u *b_fname; /* current file name */ | |
1835 | ||
1836 | #ifdef UNIX | |
1837 | ! dev_t b_dev; /* device number (-1 if not set) */ | |
1838 | ino_t b_ino; /* inode number */ | |
1839 | #endif | |
1840 | #ifdef FEAT_CW_EDITOR | |
1841 | *************** | |
1842 | *** 1645,1651 **** | |
1843 | --- 1645,1655 ---- | |
1844 | #endif | |
1845 | #ifdef FEAT_DIFF | |
1846 | diff_T *tp_first_diff; | |
1847 | + # ifdef S_SPLINT_S /* splint doesn't understand the array of pointers */ | |
1848 | + buf_T **tp_diffbuf; | |
1849 | + # else | |
1850 | buf_T *(tp_diffbuf[DB_COUNT]); | |
1851 | + # endif | |
1852 | int tp_diff_invalid; /* list of diffs is outdated */ | |
1853 | #endif | |
1854 | frame_T *tp_snapshot; /* window layout snapshot */ | |
1855 | *** ../vim-7.2.166/src/version.c 2009-04-29 18:44:38.000000000 +0200 | |
1856 | --- src/version.c 2009-05-13 12:06:36.000000000 +0200 | |
1857 | *************** | |
1858 | *** 678,679 **** | |
1859 | --- 678,681 ---- | |
1860 | { /* Add new patch number below this line */ | |
1861 | + /**/ | |
1862 | + 167, | |
1863 | /**/ | |
1864 | ||
1865 | -- | |
1866 | Snoring is prohibited unless all bedroom windows are closed and securely | |
1867 | locked. | |
1868 | [real standing law in Massachusetts, United States of America] | |
1869 | ||
1870 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
1871 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
1872 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
1873 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |