]> git.pld-linux.org Git - packages/vim.git/blame - 7.2.169
- new
[packages/vim.git] / 7.2.169
CommitLineData
d22eaa71
ER
1To: vim-dev@vim.org
2Subject: Patch 7.2.169
3Fcc: outbox
4From: Bram Moolenaar <Bram@moolenaar.net>
5Mime-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8------------
9
10Patch 7.2.169
11Problem: Splint complains about a lot of things.
12Solution: Add type casts, #ifdefs and other changes to avoid warnings.
13 Change colnr_T from unsigned to int. Avoids mistakes with
14 subtracting columns.
15Files: src/cleanlint.vim, src/diff.c, src/edit.c, src/ex_cmds.c,
16 src/ex_cmds2.c, src/ex_docmd.c, src/proto/ex_cmds.pro,
17 src/proto/spell.pro, src/quickfix.c, src/spell.c, src/structs.h,
18 src/term.h, src/vim.h
19
20
21*** ../vim-7.2.168/src/cleanlint.vim 2009-05-13 12:46:36.000000000 +0200
22--- src/cleanlint.vim 2009-05-13 18:03:11.000000000 +0200
23***************
24*** 1,27 ****
25 " Vim tool: Filter output of splint
26 "
27 " Maintainer: Bram Moolenaar <Bram@vim.org>
28! " Last Change: 2009 May 05
29
30 " Usage: redirect output of "make lint" to a file, edit that file with Vim and
31 " :call CleanLint()
32 " This deletes irrelevant messages. What remains might be valid warnings.
33
34 fun! CleanLint()
35- g/^ Types are incompatible/lockmarks d
36 g/Assignment of dev_t to __dev_t:/lockmarks d
37 g/Assignment of __dev_t to dev_t:/lockmarks d
38 g/Operands of == have incompatible types (__dev_t, dev_t): /lockmarks d
39! g/Operands of == have incompatible types (unsigned int, int): /lockmarks d
40 g/Assignment of char to char_u: /lockmarks d
41 g/Assignment of unsigned int to int: /lockmarks d
42! g/Assignment of colnr_T to int: /lockmarks d
43 g/Assignment of int to char_u: /lockmarks d
44 g/Function .* expects arg . to be wint_t gets int: /lockmarks d
45! g/^digraph.c.*digraphdefault.*is type char, expects char_u:/lockmarks d
46 g/^digraph.c.*Additional initialization errors for digraphdefault not reported/lockmarks d
47 g/Function strncasecmp expects arg 3 to be int gets size_t: /lockmarks d
48 g/ To ignore signs in type comparisons use +ignoresigns/lockmarks d
49 g/ To allow arbitrary integral types to match any integral type, use +matchanyintegral./lockmarks d
50 g/ To allow arbitrary integral types to match long unsigned, use +longintegral./lockmarks d
51 endfun
52--- 1,32 ----
53 " Vim tool: Filter output of splint
54 "
55 " Maintainer: Bram Moolenaar <Bram@vim.org>
56! " Last Change: 2009 May 13
57
58 " Usage: redirect output of "make lint" to a file, edit that file with Vim and
59 " :call CleanLint()
60 " This deletes irrelevant messages. What remains might be valid warnings.
61
62 fun! CleanLint()
63 g/Assignment of dev_t to __dev_t:/lockmarks d
64 g/Assignment of __dev_t to dev_t:/lockmarks d
65 g/Operands of == have incompatible types (__dev_t, dev_t): /lockmarks d
66! g/Operands of == have incompatible types (char_u, int): /lockmarks d
67 g/Assignment of char to char_u: /lockmarks d
68 g/Assignment of unsigned int to int: /lockmarks d
69! g/Assignment of int to unsigned int: /lockmarks d
70! g/Assignment of unsigned int to long int: /lockmarks d
71 g/Assignment of int to char_u: /lockmarks d
72 g/Function .* expects arg . to be wint_t gets int: /lockmarks d
73! g/Function .* expects arg . to be size_t gets int: /lockmarks d
74! g/Initial value of .* is type char, expects char_u: /lockmarks d
75! g/^ex_cmds.h:.* Function types are inconsistent. Parameter 1 is implicitly temp, but unqualified in assigned function:/lockmarks d
76! g/^ex_docmd.c:.* nospec_str/lockmarks d
77 g/^digraph.c.*Additional initialization errors for digraphdefault not reported/lockmarks d
78 g/Function strncasecmp expects arg 3 to be int gets size_t: /lockmarks d
79+ g/^ Types are incompatible/lockmarks d
80 g/ To ignore signs in type comparisons use +ignoresigns/lockmarks d
81 g/ To allow arbitrary integral types to match any integral type, use +matchanyintegral./lockmarks d
82 g/ To allow arbitrary integral types to match long unsigned, use +longintegral./lockmarks d
83+ g+ A variable is declared but never used. Use /.@unused@./ in front of declaration to suppress message.+lockmarks d
84 endfun
85*** ../vim-7.2.168/src/diff.c 2009-03-11 12:45:44.000000000 +0100
86--- src/diff.c 2009-05-13 16:16:11.000000000 +0200
87***************
88*** 827,832 ****
89--- 827,833 ----
90 char_u *tmp_diff;
91 {
92 char_u *cmd;
93+ size_t len;
94
95 #ifdef FEAT_EVAL
96 if (*p_dex != NUL)
97***************
98*** 835,842 ****
99 else
100 #endif
101 {
102! cmd = alloc((unsigned)(STRLEN(tmp_orig) + STRLEN(tmp_new)
103! + STRLEN(tmp_diff) + STRLEN(p_srr) + 27));
104 if (cmd != NULL)
105 {
106 /* We don't want $DIFF_OPTIONS to get in the way. */
107--- 836,844 ----
108 else
109 #endif
110 {
111! len = STRLEN(tmp_orig) + STRLEN(tmp_new)
112! + STRLEN(tmp_diff) + STRLEN(p_srr) + 27;
113! cmd = alloc((unsigned)len);
114 if (cmd != NULL)
115 {
116 /* We don't want $DIFF_OPTIONS to get in the way. */
117***************
118*** 846,852 ****
119 /* Build the diff command and execute it. Always use -a, binary
120 * differences are of no use. Ignore errors, diff returns
121 * non-zero when differences have been found. */
122! sprintf((char *)cmd, "diff %s%s%s%s%s %s",
123 diff_a_works == FALSE ? "" : "-a ",
124 #if defined(MSWIN) || defined(MSDOS)
125 diff_bin_works == TRUE ? "--binary " : "",
126--- 848,854 ----
127 /* Build the diff command and execute it. Always use -a, binary
128 * differences are of no use. Ignore errors, diff returns
129 * non-zero when differences have been found. */
130! vim_snprintf((char *)cmd, len, "diff %s%s%s%s%s %s",
131 diff_a_works == FALSE ? "" : "-a ",
132 #if defined(MSWIN) || defined(MSDOS)
133 diff_bin_works == TRUE ? "--binary " : "",
134***************
135*** 856,862 ****
136 (diff_flags & DIFF_IWHITE) ? "-b " : "",
137 (diff_flags & DIFF_ICASE) ? "-i " : "",
138 tmp_orig, tmp_new);
139! append_redir(cmd, p_srr, tmp_diff);
140 #ifdef FEAT_AUTOCMD
141 block_autocmds(); /* Avoid ShellCmdPost stuff */
142 #endif
143--- 858,864 ----
144 (diff_flags & DIFF_IWHITE) ? "-b " : "",
145 (diff_flags & DIFF_ICASE) ? "-i " : "",
146 tmp_orig, tmp_new);
147! append_redir(cmd, (int)len, p_srr, tmp_diff);
148 #ifdef FEAT_AUTOCMD
149 block_autocmds(); /* Avoid ShellCmdPost stuff */
150 #endif
151***************
152*** 881,886 ****
153--- 883,889 ----
154 char_u *tmp_orig; /* name of original temp file */
155 char_u *tmp_new; /* name of patched temp file */
156 char_u *buf = NULL;
157+ size_t buflen;
158 win_T *old_curwin = curwin;
159 char_u *newname = NULL; /* name of patched file buffer */
160 #ifdef UNIX
161***************
162*** 920,930 ****
163 /* Get the absolute path of the patchfile, changing directory below. */
164 fullname = FullName_save(eap->arg, FALSE);
165 #endif
166! buf = alloc((unsigned)(STRLEN(tmp_orig) + (
167 # ifdef UNIX
168 fullname != NULL ? STRLEN(fullname) :
169 # endif
170! STRLEN(eap->arg)) + STRLEN(tmp_new) + 16));
171 if (buf == NULL)
172 goto theend;
173
174--- 923,934 ----
175 /* Get the absolute path of the patchfile, changing directory below. */
176 fullname = FullName_save(eap->arg, FALSE);
177 #endif
178! buflen = STRLEN(tmp_orig) + (
179 # ifdef UNIX
180 fullname != NULL ? STRLEN(fullname) :
181 # endif
182! STRLEN(eap->arg)) + STRLEN(tmp_new) + 16;
183! buf = alloc((unsigned)buflen);
184 if (buf == NULL)
185 goto theend;
186
187***************
188*** 961,967 ****
189 {
190 /* Build the patch command and execute it. Ignore errors. Switch to
191 * cooked mode to allow the user to respond to prompts. */
192! sprintf((char *)buf, "patch -o %s %s < \"%s\"", tmp_new, tmp_orig,
193 # ifdef UNIX
194 fullname != NULL ? fullname :
195 # endif
196--- 965,972 ----
197 {
198 /* Build the patch command and execute it. Ignore errors. Switch to
199 * cooked mode to allow the user to respond to prompts. */
200! vim_snprintf((char *)buf, buflen, "patch -o %s %s < \"%s\"",
201! tmp_new, tmp_orig,
202 # ifdef UNIX
203 fullname != NULL ? fullname :
204 # endif
205*** ../vim-7.2.168/src/edit.c 2009-05-13 12:46:36.000000000 +0200
206--- src/edit.c 2009-05-13 18:29:21.000000000 +0200
207***************
208*** 169,175 ****
209 static int ins_compl_key2count __ARGS((int c));
210 static int ins_compl_use_match __ARGS((int c));
211 static int ins_complete __ARGS((int c));
212! static int quote_meta __ARGS((char_u *dest, char_u *str, int len));
213 #endif /* FEAT_INS_EXPAND */
214
215 #define BACKSPACE_CHAR 1
216--- 169,175 ----
217 static int ins_compl_key2count __ARGS((int c));
218 static int ins_compl_use_match __ARGS((int c));
219 static int ins_complete __ARGS((int c));
220! static unsigned quote_meta __ARGS((char_u *dest, char_u *str, int len));
221 #endif /* FEAT_INS_EXPAND */
222
223 #define BACKSPACE_CHAR 1
224***************
225*** 757,763 ****
226 * there is nothing to add, CTRL-L works like CTRL-P then. */
227 if (c == Ctrl_L
228 && (ctrl_x_mode != CTRL_X_WHOLE_LINE
229! || STRLEN(compl_shown_match->cp_str)
230 > curwin->w_cursor.col - compl_col))
231 {
232 ins_compl_addfrommatch();
233--- 757,763 ----
234 * there is nothing to add, CTRL-L works like CTRL-P then. */
235 if (c == Ctrl_L
236 && (ctrl_x_mode != CTRL_X_WHOLE_LINE
237! || (int)STRLEN(compl_shown_match->cp_str)
238 > curwin->w_cursor.col - compl_col))
239 {
240 ins_compl_addfrommatch();
241***************
242*** 3837,3843 ****
243--- 3837,3847 ----
244 char_u *word;
245 int icase = FALSE;
246 int adup = FALSE;
247+ #ifdef S_SPLINT_S /* splint doesn't parse array of pointers correctly */
248+ char_u **cptext;
249+ #else
250 char_u *(cptext[CPT_COUNT]);
251+ #endif
252
253 if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL)
254 {
255***************
256*** 3994,4000 ****
257 else if (*e_cpt == ']' || *e_cpt == 't')
258 {
259 type = CTRL_X_TAGS;
260! sprintf((char*)IObuff, _("Scanning tags."));
261 (void)msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
262 }
263 else
264--- 3998,4004 ----
265 else if (*e_cpt == ']' || *e_cpt == 't')
266 {
267 type = CTRL_X_TAGS;
268! vim_snprintf((char *)IObuff, IOSIZE, _("Scanning tags."));
269 (void)msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
270 }
271 else
272***************
273*** 4093,4099 ****
274 case CTRL_X_SPELL:
275 #ifdef FEAT_SPELL
276 num_matches = expand_spelling(first_match_pos.lnum,
277! first_match_pos.col, compl_pattern, &matches);
278 if (num_matches > 0)
279 ins_compl_add_matches(num_matches, matches, p_ic);
280 #endif
281--- 4097,4103 ----
282 case CTRL_X_SPELL:
283 #ifdef FEAT_SPELL
284 num_matches = expand_spelling(first_match_pos.lnum,
285! compl_pattern, &matches);
286 if (num_matches > 0)
287 ins_compl_add_matches(num_matches, matches, p_ic);
288 #endif
289***************
290*** 4803,4812 ****
291 {
292 char_u *prefix = (char_u *)"\\<";
293
294! /* we need 3 extra chars, 1 for the NUL and
295! * 2 >= strlen(prefix) -- Acevedo */
296 compl_pattern = alloc(quote_meta(NULL, line + compl_col,
297! compl_length) + 3);
298 if (compl_pattern == NULL)
299 return FAIL;
300 if (!vim_iswordp(line + compl_col)
301--- 4807,4815 ----
302 {
303 char_u *prefix = (char_u *)"\\<";
304
305! /* we need up to 2 extra chars for the prefix */
306 compl_pattern = alloc(quote_meta(NULL, line + compl_col,
307! compl_length) + 2);
308 if (compl_pattern == NULL)
309 return FAIL;
310 if (!vim_iswordp(line + compl_col)
311***************
312*** 4881,4887 ****
313 else
314 {
315 compl_pattern = alloc(quote_meta(NULL, line + compl_col,
316! compl_length) + 3);
317 if (compl_pattern == NULL)
318 return FAIL;
319 STRCPY((char *)compl_pattern, "\\<");
320--- 4884,4890 ----
321 else
322 {
323 compl_pattern = alloc(quote_meta(NULL, line + compl_col,
324! compl_length) + 2);
325 if (compl_pattern == NULL)
326 return FAIL;
327 STRCPY((char *)compl_pattern, "\\<");
328***************
329*** 4963,4969 ****
330 if (col < 0)
331 col = curs_col;
332 compl_col = col;
333! if ((colnr_T)compl_col > curs_col)
334 compl_col = curs_col;
335
336 /* Setup variables for completion. Need to obtain "line" again,
337--- 4966,4972 ----
338 if (col < 0)
339 col = curs_col;
340 compl_col = col;
341! if (compl_col > curs_col)
342 compl_col = curs_col;
343
344 /* Setup variables for completion. Need to obtain "line" again,
345***************
346*** 5236,5250 ****
347 * a backslash) the metachars, and dest would be NUL terminated.
348 * Returns the length (needed) of dest
349 */
350! static int
351 quote_meta(dest, src, len)
352 char_u *dest;
353 char_u *src;
354 int len;
355 {
356! int m;
357
358! for (m = len; --len >= 0; src++)
359 {
360 switch (*src)
361 {
362--- 5239,5253 ----
363 * a backslash) the metachars, and dest would be NUL terminated.
364 * Returns the length (needed) of dest
365 */
366! static unsigned
367 quote_meta(dest, src, len)
368 char_u *dest;
369 char_u *src;
370 int len;
371 {
372! unsigned m = (unsigned)len + 1; /* one extra for the NUL */
373
374! for ( ; --len >= 0; src++)
375 {
376 switch (*src)
377 {
378***************
379*** 6073,6079 ****
380 * in 'formatoptions' and there is a single character before the cursor.
381 * Otherwise the line would be broken and when typing another non-white
382 * next they are not joined back together. */
383! wasatend = (pos.col == STRLEN(old));
384 if (*old != NUL && !trailblank && wasatend)
385 {
386 dec_cursor();
387--- 6076,6082 ----
388 * in 'formatoptions' and there is a single character before the cursor.
389 * Otherwise the line would be broken and when typing another non-white
390 * next they are not joined back together. */
391! wasatend = (pos.col == (colnr_T)STRLEN(old));
392 if (*old != NUL && !trailblank && wasatend)
393 {
394 dec_cursor();
395***************
396*** 6250,6256 ****
397 * three digits. */
398 if (VIM_ISDIGIT(c))
399 {
400! sprintf((char *)buf, "%03d", c);
401 AppendToRedobuff(buf);
402 }
403 else
404--- 6253,6259 ----
405 * three digits. */
406 if (VIM_ISDIGIT(c))
407 {
408! vim_snprintf((char *)buf, sizeof(buf), "%03d", c);
409 AppendToRedobuff(buf);
410 }
411 else
412***************
413*** 6453,6462 ****
414 * deleted characters. */
415 if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum)
416 {
417! cc = (int)STRLEN(ml_get_curline());
418! if (VIsual.col > (colnr_T)cc)
419 {
420! VIsual.col = cc;
421 # ifdef FEAT_VIRTUALEDIT
422 VIsual.coladd = 0;
423 # endif
424--- 6457,6467 ----
425 * deleted characters. */
426 if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum)
427 {
428! int len = (int)STRLEN(ml_get_curline());
429!
430! if (VIsual.col > len)
431 {
432! VIsual.col = len;
433 # ifdef FEAT_VIRTUALEDIT
434 VIsual.coladd = 0;
435 # endif
436***************
437*** 8315,8320 ****
438--- 8320,8326 ----
439 linenr_T lnum;
440 int cc;
441 int temp = 0; /* init for GCC */
442+ colnr_T save_col;
443 colnr_T mincol;
444 int did_backspace = FALSE;
445 int in_indent;
446***************
447*** 8472,8484 ****
448 */
449 while (cc > 0)
450 {
451! temp = curwin->w_cursor.col;
452 #ifdef FEAT_MBYTE
453 mb_replace_pop_ins(cc);
454 #else
455 ins_char(cc);
456 #endif
457! curwin->w_cursor.col = temp;
458 cc = replace_pop();
459 }
460 /* restore the characters that NL replaced */
461--- 8478,8490 ----
462 */
463 while (cc > 0)
464 {
465! save_col = curwin->w_cursor.col;
466 #ifdef FEAT_MBYTE
467 mb_replace_pop_ins(cc);
468 #else
469 ins_char(cc);
470 #endif
471! curwin->w_cursor.col = save_col;
472 cc = replace_pop();
473 }
474 /* restore the characters that NL replaced */
475***************
476*** 8510,8520 ****
477 #endif
478 )
479 {
480! temp = curwin->w_cursor.col;
481 beginline(BL_WHITE);
482 if (curwin->w_cursor.col < (colnr_T)temp)
483 mincol = curwin->w_cursor.col;
484! curwin->w_cursor.col = temp;
485 }
486
487 /*
488--- 8516,8526 ----
489 #endif
490 )
491 {
492! save_col = curwin->w_cursor.col;
493 beginline(BL_WHITE);
494 if (curwin->w_cursor.col < (colnr_T)temp)
495 mincol = curwin->w_cursor.col;
496! curwin->w_cursor.col = save_col;
497 }
498
499 /*
500*** ../vim-7.2.168/src/ex_cmds.c 2009-05-13 12:46:36.000000000 +0200
501--- src/ex_cmds.c 2009-05-13 18:24:18.000000000 +0200
502***************
503*** 87,99 ****
504 ))
505 {
506 transchar_nonprint(buf3, c);
507! sprintf(buf1, " <%s>", (char *)buf3);
508 }
509 else
510 buf1[0] = NUL;
511 #ifndef EBCDIC
512 if (c >= 0x80)
513! sprintf(buf2, " <M-%s>", transchar(c & 0x7f));
514 else
515 #endif
516 buf2[0] = NUL;
517--- 87,100 ----
518 ))
519 {
520 transchar_nonprint(buf3, c);
521! vim_snprintf(buf1, sizeof(buf1), " <%s>", (char *)buf3);
522 }
523 else
524 buf1[0] = NUL;
525 #ifndef EBCDIC
526 if (c >= 0x80)
527! vim_snprintf(buf2, sizeof(buf2), " <M-%s>",
528! (char *)transchar(c & 0x7f));
529 else
530 #endif
531 buf2[0] = NUL;
532***************
533*** 358,364 ****
534 linenr_T lnum;
535 long maxlen = 0;
536 sorti_T *nrs;
537! size_t count = eap->line2 - eap->line1 + 1;
538 size_t i;
539 char_u *p;
540 char_u *s;
541--- 359,365 ----
542 linenr_T lnum;
543 long maxlen = 0;
544 sorti_T *nrs;
545! size_t count = (size_t)(eap->line2 - eap->line1 + 1);
546 size_t i;
547 char_u *p;
548 char_u *s;
549***************
550*** 957,963 ****
551 }
552 len += (int)STRLEN(prevcmd);
553 }
554! if ((t = alloc(len)) == NULL)
555 {
556 vim_free(newcmd);
557 return;
558--- 958,964 ----
559 }
560 len += (int)STRLEN(prevcmd);
561 }
562! if ((t = alloc((unsigned)len)) == NULL)
563 {
564 vim_free(newcmd);
565 return;
566***************
567*** 1548,1554 ****
568 * redirecting input and/or output.
569 */
570 if (itmp != NULL || otmp != NULL)
571! sprintf((char *)buf, "(%s)", (char *)cmd);
572 else
573 STRCPY(buf, cmd);
574 if (itmp != NULL)
575--- 1549,1555 ----
576 * redirecting input and/or output.
577 */
578 if (itmp != NULL || otmp != NULL)
579! vim_snprintf((char *)buf, len, "(%s)", (char *)cmd);
580 else
581 STRCPY(buf, cmd);
582 if (itmp != NULL)
583***************
584*** 1597,1633 ****
585 }
586 #endif
587 if (otmp != NULL)
588! append_redir(buf, p_srr, otmp);
589
590 return buf;
591 }
592
593 /*
594! * Append output redirection for file "fname" to the end of string buffer "buf"
595 * Works with the 'shellredir' and 'shellpipe' options.
596 * The caller should make sure that there is enough room:
597 * STRLEN(opt) + STRLEN(fname) + 3
598 */
599 void
600! append_redir(buf, opt, fname)
601 char_u *buf;
602 char_u *opt;
603 char_u *fname;
604 {
605 char_u *p;
606
607! buf += STRLEN(buf);
608 /* find "%s", skipping "%%" */
609 for (p = opt; (p = vim_strchr(p, '%')) != NULL; ++p)
610 if (p[1] == 's')
611 break;
612 if (p != NULL)
613 {
614! *buf = ' '; /* not really needed? Not with sh, ksh or bash */
615! sprintf((char *)buf + 1, (char *)opt, (char *)fname);
616 }
617 else
618! sprintf((char *)buf,
619 #ifdef FEAT_QUICKFIX
620 # ifndef RISCOS
621 opt != p_sp ? " %s%s" :
622--- 1598,1638 ----
623 }
624 #endif
625 if (otmp != NULL)
626! append_redir(buf, (int)len, p_srr, otmp);
627
628 return buf;
629 }
630
631 /*
632! * Append output redirection for file "fname" to the end of string buffer
633! * "buf[buflen]"
634 * Works with the 'shellredir' and 'shellpipe' options.
635 * The caller should make sure that there is enough room:
636 * STRLEN(opt) + STRLEN(fname) + 3
637 */
638 void
639! append_redir(buf, buflen, opt, fname)
640 char_u *buf;
641+ int buflen;
642 char_u *opt;
643 char_u *fname;
644 {
645 char_u *p;
646+ char_u *end;
647
648! end = buf + STRLEN(buf);
649 /* find "%s", skipping "%%" */
650 for (p = opt; (p = vim_strchr(p, '%')) != NULL; ++p)
651 if (p[1] == 's')
652 break;
653 if (p != NULL)
654 {
655! *end = ' '; /* not really needed? Not with sh, ksh or bash */
656! vim_snprintf((char *)end + 1, (size_t)(buflen - (end + 1 - buf)),
657! (char *)opt, (char *)fname);
658 }
659 else
660! vim_snprintf((char *)end, (size_t)(buflen - (end - buf)),
661 #ifdef FEAT_QUICKFIX
662 # ifndef RISCOS
663 opt != p_sp ? " %s%s" :
664***************
665*** 2390,2396 ****
666
667 if (curwin->w_p_nu || use_number)
668 {
669! sprintf((char *)numbuf, "%*ld ", number_width(curwin), (long)lnum);
670 msg_puts_attr(numbuf, hl_attr(HLF_N)); /* Highlight line nrs */
671 }
672 msg_prt_line(ml_get(lnum), list);
673--- 2395,2402 ----
674
675 if (curwin->w_p_nu || use_number)
676 {
677! vim_snprintf((char *)numbuf, sizeof(numbuf),
678! "%*ld ", number_width(curwin), (long)lnum);
679 msg_puts_attr(numbuf, hl_attr(HLF_N)); /* Highlight line nrs */
680 }
681 msg_prt_line(ml_get(lnum), list);
682***************
683*** 4486,4492 ****
684 char_u *p1;
685 int did_sub = FALSE;
686 int lastone;
687! unsigned len, needed_len;
688 long nmatch_tl = 0; /* nr of lines matched below lnum */
689 int do_again; /* do it again after joining lines */
690 int skip_match = FALSE;
691--- 4492,4498 ----
692 char_u *p1;
693 int did_sub = FALSE;
694 int lastone;
695! int len, copy_len, needed_len;
696 long nmatch_tl = 0; /* nr of lines matched below lnum */
697 int do_again; /* do it again after joining lines */
698 int skip_match = FALSE;
699***************
700*** 4631,4636 ****
701--- 4637,4644 ----
702
703 if (do_ask)
704 {
705+ int typed;
706+
707 /* change State to CONFIRM, so that the mouse works
708 * properly */
709 save_State = State;
710***************
711*** 4669,4675 ****
712 resp = getexmodeline('?', NULL, 0);
713 if (resp != NULL)
714 {
715! i = *resp;
716 vim_free(resp);
717 }
718 }
719--- 4677,4683 ----
720 resp = getexmodeline('?', NULL, 0);
721 if (resp != NULL)
722 {
723! typed = *resp;
724 vim_free(resp);
725 }
726 }
727***************
728*** 4721,4727 ****
729 #endif
730 ++no_mapping; /* don't map this key */
731 ++allow_keys; /* allow special keys */
732! i = plain_vgetc();
733 --allow_keys;
734 --no_mapping;
735
736--- 4729,4735 ----
737 #endif
738 ++no_mapping; /* don't map this key */
739 ++allow_keys; /* allow special keys */
740! typed = plain_vgetc();
741 --allow_keys;
742 --no_mapping;
743
744***************
745*** 4732,4766 ****
746 }
747
748 need_wait_return = FALSE; /* no hit-return prompt */
749! if (i == 'q' || i == ESC || i == Ctrl_C
750 #ifdef UNIX
751! || i == intr_char
752 #endif
753 )
754 {
755 got_quit = TRUE;
756 break;
757 }
758! if (i == 'n')
759 break;
760! if (i == 'y')
761 break;
762! if (i == 'l')
763 {
764 /* last: replace and then stop */
765 do_all = FALSE;
766 line2 = lnum;
767 break;
768 }
769! if (i == 'a')
770 {
771 do_ask = FALSE;
772 break;
773 }
774 #ifdef FEAT_INS_EXPAND
775! if (i == Ctrl_E)
776 scrollup_clamp();
777! else if (i == Ctrl_Y)
778 scrolldown_clamp();
779 #endif
780 }
781--- 4740,4774 ----
782 }
783
784 need_wait_return = FALSE; /* no hit-return prompt */
785! if (typed == 'q' || typed == ESC || typed == Ctrl_C
786 #ifdef UNIX
787! || typed == intr_char
788 #endif
789 )
790 {
791 got_quit = TRUE;
792 break;
793 }
794! if (typed == 'n')
795 break;
796! if (typed == 'y')
797 break;
798! if (typed == 'l')
799 {
800 /* last: replace and then stop */
801 do_all = FALSE;
802 line2 = lnum;
803 break;
804 }
805! if (typed == 'a')
806 {
807 do_ask = FALSE;
808 break;
809 }
810 #ifdef FEAT_INS_EXPAND
811! if (typed == Ctrl_E)
812 scrollup_clamp();
813! else if (typed == Ctrl_Y)
814 scrolldown_clamp();
815 #endif
816 }
817***************
818*** 4771,4777 ****
819 if (vim_strchr(p_cpo, CPO_UNDO) != NULL)
820 --no_u_sync;
821
822! if (i == 'n')
823 {
824 /* For a multi-line match, put matchcol at the NUL at
825 * the end of the line and set nmatch to one, so that
826--- 4779,4785 ----
827 if (vim_strchr(p_cpo, CPO_UNDO) != NULL)
828 --no_u_sync;
829
830! if (typed == 'n')
831 {
832 /* For a multi-line match, put matchcol at the NUL at
833 * the end of the line and set nmatch to one, so that
834***************
835*** 4822,4830 ****
836 p1 = ml_get(sub_firstlnum + nmatch - 1);
837 nmatch_tl += nmatch - 1;
838 }
839! i = regmatch.startpos[0].col - copycol;
840! needed_len = i + ((unsigned)STRLEN(p1) - regmatch.endpos[0].col)
841! + sublen + 1;
842 if (new_start == NULL)
843 {
844 /*
845--- 4830,4838 ----
846 p1 = ml_get(sub_firstlnum + nmatch - 1);
847 nmatch_tl += nmatch - 1;
848 }
849! copy_len = regmatch.startpos[0].col - copycol;
850! needed_len = copy_len + ((unsigned)STRLEN(p1)
851! - regmatch.endpos[0].col) + sublen + 1;
852 if (new_start == NULL)
853 {
854 /*
855***************
856*** 4847,4853 ****
857 */
858 len = (unsigned)STRLEN(new_start);
859 needed_len += len;
860! if (needed_len > new_start_len)
861 {
862 new_start_len = needed_len + 50;
863 if ((p1 = alloc_check(new_start_len)) == NULL)
864--- 4855,4861 ----
865 */
866 len = (unsigned)STRLEN(new_start);
867 needed_len += len;
868! if (needed_len > (int)new_start_len)
869 {
870 new_start_len = needed_len + 50;
871 if ((p1 = alloc_check(new_start_len)) == NULL)
872***************
873*** 4865,4872 ****
874 /*
875 * copy the text up to the part that matched
876 */
877! mch_memmove(new_end, sub_firstline + copycol, (size_t)i);
878! new_end += i;
879
880 (void)vim_regsub_multi(&regmatch,
881 sub_firstlnum - regmatch.startpos[0].lnum,
882--- 4873,4880 ----
883 /*
884 * copy the text up to the part that matched
885 */
886! mch_memmove(new_end, sub_firstline + copycol, (size_t)copy_len);
887! new_end += copy_len;
888
889 (void)vim_regsub_multi(&regmatch,
890 sub_firstlnum - regmatch.startpos[0].lnum,
891***************
892*** 5768,5773 ****
893--- 5776,5785 ----
894 {
895 char_u *s, *d;
896 int i;
897+ #ifdef S_SPLINT_S /* splint doesn't understand array of pointers */
898+ static char **mtable;
899+ static char **rtable;
900+ #else
901 static char *(mtable[]) = {"*", "g*", "[*", "]*", ":*",
902 "/*", "/\\*", "\"*", "**",
903 "/\\(\\)",
904***************
905*** 5782,5787 ****
906--- 5794,5800 ----
907 "/\\\\?", "/\\\\z(\\\\)", "\\\\=", ":s\\\\=",
908 "\\[count]", "\\[quotex]", "\\[range]",
909 "\\[pattern]", "\\\\bar", "/\\\\%\\$"};
910+ #endif
911 int flags;
912
913 d = IObuff; /* assume IObuff is long enough! */
914***************
915*** 5790,5796 ****
916 * Recognize a few exceptions to the rule. Some strings that contain '*'
917 * with "star". Otherwise '*' is recognized as a wildcard.
918 */
919! for (i = sizeof(mtable) / sizeof(char *); --i >= 0; )
920 if (STRCMP(arg, mtable[i]) == 0)
921 {
922 STRCPY(d, rtable[i]);
923--- 5803,5809 ----
924 * Recognize a few exceptions to the rule. Some strings that contain '*'
925 * with "star". Otherwise '*' is recognized as a wildcard.
926 */
927! for (i = (int)(sizeof(mtable) / sizeof(char *)); --i >= 0; )
928 if (STRCMP(arg, mtable[i]) == 0)
929 {
930 STRCPY(d, rtable[i]);
931*** ../vim-7.2.168/src/ex_cmds2.c 2009-02-05 20:47:14.000000000 +0100
932--- src/ex_cmds2.c 2009-05-13 16:22:33.000000000 +0200
933***************
934*** 3373,3379 ****
935 p = skipwhite(sp->nextline);
936 if (*p != '\\')
937 break;
938! s = alloc((int)(STRLEN(line) + STRLEN(p)));
939 if (s == NULL) /* out of memory */
940 break;
941 STRCPY(s, line);
942--- 3373,3379 ----
943 p = skipwhite(sp->nextline);
944 if (*p != '\\')
945 break;
946! s = alloc((unsigned)(STRLEN(line) + STRLEN(p)));
947 if (s == NULL) /* out of memory */
948 break;
949 STRCPY(s, line);
950*** ../vim-7.2.168/src/ex_docmd.c 2009-04-29 18:44:38.000000000 +0200
951--- src/ex_docmd.c 2009-05-13 17:56:44.000000000 +0200
952***************
953*** 2737,2743 ****
954 int i;
955
956 for (i = 0; cmd[i] != NUL; ++i)
957! if (cmd[i] != (*pp)[i])
958 break;
959 if (i >= len && !isalpha((*pp)[i]))
960 {
961--- 2737,2743 ----
962 int i;
963
964 for (i = 0; cmd[i] != NUL; ++i)
965! if (((char_u *)cmd)[i] != (*pp)[i])
966 break;
967 if (i >= len && !isalpha((*pp)[i]))
968 {
969***************
970*** 2803,2809 ****
971 /* Check for ":dl", ":dell", etc. to ":deletel": that's
972 * :delete with the 'l' flag. Same for 'p'. */
973 for (i = 0; i < len; ++i)
974! if (eap->cmd[i] != "delete"[i])
975 break;
976 if (i == len - 1)
977 {
978--- 2803,2809 ----
979 /* Check for ":dl", ":dell", etc. to ":deletel": that's
980 * :delete with the 'l' flag. Same for 'p'. */
981 for (i = 0; i < len; ++i)
982! if (eap->cmd[i] != ((char_u *)"delete")[i])
983 break;
984 if (i == len - 1)
985 {
986***************
987*** 3823,3829 ****
988 char_u *cmd;
989 int *ctx; /* pointer to xp_context or NULL */
990 {
991! int delim;
992
993 while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;", *cmd) != NULL)
994 {
995--- 3823,3829 ----
996 char_u *cmd;
997 int *ctx; /* pointer to xp_context or NULL */
998 {
999! unsigned delim;
1000
1001 while (vim_strchr((char_u *)" \t0123456789.$%'/?-+,;", *cmd) != NULL)
1002 {
1003***************
1004*** 9417,9423 ****
1005 {
1006 int len;
1007 int i;
1008! static char *(spec_str[]) = {
1009 "%",
1010 #define SPEC_PERC 0
1011 "#",
1012--- 9417,9429 ----
1013 {
1014 int len;
1015 int i;
1016! #ifdef S_SPLINT_S /* splint can't handle array of pointers */
1017! static char **spec_str;
1018! static char *(nospec_str[])
1019! #else
1020! static char *(spec_str[])
1021! #endif
1022! = {
1023 "%",
1024 #define SPEC_PERC 0
1025 "#",
1026***************
1027*** 9443,9451 ****
1028 # define SPEC_CLIENT 9
1029 #endif
1030 };
1031- #define SPEC_COUNT (sizeof(spec_str) / sizeof(char *))
1032
1033! for (i = 0; i < SPEC_COUNT; ++i)
1034 {
1035 len = (int)STRLEN(spec_str[i]);
1036 if (STRNCMP(src, spec_str[i], len) == 0)
1037--- 9449,9456 ----
1038 # define SPEC_CLIENT 9
1039 #endif
1040 };
1041
1042! for (i = 0; i < (int)(sizeof(spec_str) / sizeof(char *)); ++i)
1043 {
1044 len = (int)STRLEN(spec_str[i]);
1045 if (STRNCMP(src, spec_str[i], len) == 0)
1046***************
1047*** 9796,9802 ****
1048 }
1049
1050 /* allocate memory */
1051! retval = alloc(len + 1);
1052 if (retval == NULL)
1053 break;
1054 }
1055--- 9801,9807 ----
1056 }
1057
1058 /* allocate memory */
1059! retval = alloc((unsigned)len + 1);
1060 if (retval == NULL)
1061 break;
1062 }
1063*** ../vim-7.2.168/src/proto/ex_cmds.pro 2009-04-29 18:44:38.000000000 +0200
1064--- src/proto/ex_cmds.pro 2009-05-13 15:53:39.000000000 +0200
1065***************
1066*** 9,15 ****
1067 void do_bang __ARGS((int addr_count, exarg_T *eap, int forceit, int do_in, int do_out));
1068 void do_shell __ARGS((char_u *cmd, int flags));
1069 char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp));
1070! void append_redir __ARGS((char_u *buf, char_u *opt, char_u *fname));
1071 int viminfo_error __ARGS((char *errnum, char *message, char_u *line));
1072 int read_viminfo __ARGS((char_u *file, int flags));
1073 void write_viminfo __ARGS((char_u *file, int forceit));
1074--- 9,15 ----
1075 void do_bang __ARGS((int addr_count, exarg_T *eap, int forceit, int do_in, int do_out));
1076 void do_shell __ARGS((char_u *cmd, int flags));
1077 char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp));
1078! void append_redir __ARGS((char_u *buf, int buflen, char_u *opt, char_u *fname));
1079 int viminfo_error __ARGS((char *errnum, char *message, char_u *line));
1080 int read_viminfo __ARGS((char_u *file, int flags));
1081 void write_viminfo __ARGS((char_u *file, int forceit));
1082*** ../vim-7.2.168/src/proto/spell.pro 2007-05-05 19:19:19.000000000 +0200
1083--- src/proto/spell.pro 2009-05-13 16:43:13.000000000 +0200
1084***************
1085*** 22,26 ****
1086 char_u *spell_to_word_end __ARGS((char_u *start, buf_T *buf));
1087 int spell_word_start __ARGS((int startcol));
1088 void spell_expand_check_cap __ARGS((colnr_T col));
1089! int expand_spelling __ARGS((linenr_T lnum, int col, char_u *pat, char_u ***matchp));
1090 /* vim: set ft=c : */
1091--- 22,26 ----
1092 char_u *spell_to_word_end __ARGS((char_u *start, buf_T *buf));
1093 int spell_word_start __ARGS((int startcol));
1094 void spell_expand_check_cap __ARGS((colnr_T col));
1095! int expand_spelling __ARGS((linenr_T lnum, char_u *pat, char_u ***matchp));
1096 /* vim: set ft=c : */
1097*** ../vim-7.2.168/src/quickfix.c 2009-04-29 11:49:57.000000000 +0200
1098--- src/quickfix.c 2009-05-13 15:53:18.000000000 +0200
1099***************
1100*** 2774,2780 ****
1101 sprintf((char *)cmd, "%s%s%s", (char *)p_shq, (char *)eap->arg,
1102 (char *)p_shq);
1103 if (*p_sp != NUL)
1104! append_redir(cmd, p_sp, fname);
1105 /*
1106 * Output a newline if there's something else than the :make command that
1107 * was typed (in which case the cursor is in column 0).
1108--- 2774,2780 ----
1109 sprintf((char *)cmd, "%s%s%s", (char *)p_shq, (char *)eap->arg,
1110 (char *)p_shq);
1111 if (*p_sp != NUL)
1112! append_redir(cmd, len, p_sp, fname);
1113 /*
1114 * Output a newline if there's something else than the :make command that
1115 * was typed (in which case the cursor is in column 0).
1116*** ../vim-7.2.168/src/spell.c 2009-02-11 17:57:43.000000000 +0100
1117--- src/spell.c 2009-05-13 16:31:15.000000000 +0200
1118***************
1119*** 16151,16161 ****
1120 * Returns the number of matches. The matches are in "matchp[]", array of
1121 * allocated strings.
1122 */
1123- /*ARGSUSED*/
1124 int
1125! expand_spelling(lnum, col, pat, matchp)
1126 linenr_T lnum;
1127- int col;
1128 char_u *pat;
1129 char_u ***matchp;
1130 {
1131--- 16151,16159 ----
1132 * Returns the number of matches. The matches are in "matchp[]", array of
1133 * allocated strings.
1134 */
1135 int
1136! expand_spelling(lnum, pat, matchp)
1137 linenr_T lnum;
1138 char_u *pat;
1139 char_u ***matchp;
1140 {
1141*** ../vim-7.2.168/src/structs.h 2009-05-13 12:46:36.000000000 +0200
1142--- src/structs.h 2009-05-13 16:45:51.000000000 +0200
1143***************
1144*** 16,22 ****
1145 */
1146 #if defined(SASC) && SASC < 658
1147 typedef long linenr_T;
1148! typedef unsigned colnr_T;
1149 typedef unsigned short short_u;
1150 #endif
1151
1152--- 16,22 ----
1153 */
1154 #if defined(SASC) && SASC < 658
1155 typedef long linenr_T;
1156! typedef int colnr_T;
1157 typedef unsigned short short_u;
1158 #endif
1159
1160*** ../vim-7.2.168/src/term.h 2005-03-16 10:53:56.000000000 +0100
1161--- src/term.h 2009-05-13 17:27:41.000000000 +0200
1162***************
1163*** 96,102 ****
1164--- 96,106 ----
1165 * - there should be code in term.c to obtain the value from the termcap
1166 */
1167
1168+ #ifdef S_SPLINT_S /* splint doesn't understand array of pointers */
1169+ extern char_u **term_strings; /* current terminal strings */
1170+ #else
1171 extern char_u *(term_strings[]); /* current terminal strings */
1172+ #endif
1173
1174 /*
1175 * strings used for terminal
1176*** ../vim-7.2.168/src/vim.h 2009-04-29 18:44:38.000000000 +0200
1177--- src/vim.h 2009-05-13 16:45:39.000000000 +0200
1178***************
1179*** 1460,1467 ****
1180 # define PERROR(msg) perror(msg)
1181 #endif
1182
1183! typedef long linenr_T; /* line number type */
1184! typedef unsigned colnr_T; /* column number type */
1185 typedef unsigned short disptick_T; /* display tick type */
1186
1187 #define MAXLNUM (0x7fffffffL) /* maximum (invalid) line number */
1188--- 1460,1467 ----
1189 # define PERROR(msg) perror(msg)
1190 #endif
1191
1192! typedef long linenr_T; /* line number type */
1193! typedef int colnr_T; /* column number type */
1194 typedef unsigned short disptick_T; /* display tick type */
1195
1196 #define MAXLNUM (0x7fffffffL) /* maximum (invalid) line number */
1197*** ../vim-7.2.168/src/version.c 2009-05-13 14:48:55.000000000 +0200
1198--- src/version.c 2009-05-13 18:44:28.000000000 +0200
1199***************
1200*** 678,679 ****
1201--- 678,681 ----
1202 { /* Add new patch number below this line */
1203+ /**/
1204+ 169,
1205 /**/
1206
1207--
1208Females are strictly forbidden to appear unshaven in public.
1209 [real standing law in New Mexico, United States of America]
1210
1211 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
1212/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
1213\\\ download, build and distribute -- http://www.A-A-P.org ///
1214 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
This page took 0.163481 seconds and 4 git commands to generate.