]> git.pld-linux.org Git - packages/vim.git/blame - 7.2.173
- new
[packages/vim.git] / 7.2.173
CommitLineData
b5ccbaa1
ER
1To: vim-dev@vim.org
2Subject: Patch 7.2.173
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.173
11Problem: Without lint there is no check for unused function arguments.
12Solution: Use gcc -Wunused-parameter instead of lint. For a few files add
13 attributes to arguments that are known not to be used.
14Files: src/auto/configure, src/buffer.c, src/charset.c, src/diff.c,
15 src/configure.in, src/config.h.in, src/edit.c, src/ex_cmds.c,
16 src/ex_cmds2.c, src/version.c, src/vim.h
17
18
19*** ../vim-7.2.172/src/auto/configure 2009-05-13 14:48:55.000000000 +0200
20--- src/auto/configure 2009-05-14 22:08:12.000000000 +0200
21***************
22*** 10362,10367 ****
23--- 10372,10427 ----
24
25 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26
27+ { $as_echo "$as_me:$LINENO: checking whether __attribute__((unused)) is allowed" >&5
28+ $as_echo_n "checking whether __attribute__((unused)) is allowed... " >&6; }
29+ cat >conftest.$ac_ext <<_ACEOF
30+ /* confdefs.h. */
31+ _ACEOF
32+ cat confdefs.h >>conftest.$ac_ext
33+ cat >>conftest.$ac_ext <<_ACEOF
34+ /* end confdefs.h. */
35+ #include <stdio.h>
36+ int
37+ main ()
38+ {
39+ int x __attribute__((unused));
40+ ;
41+ return 0;
42+ }
43+ _ACEOF
44+ rm -f conftest.$ac_objext
45+ if { (ac_try="$ac_compile"
46+ case "(($ac_try" in
47+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
48+ *) ac_try_echo=$ac_try;;
49+ esac
50+ eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
51+ $as_echo "$ac_try_echo") >&5
52+ (eval "$ac_compile") 2>conftest.er1
53+ ac_status=$?
54+ grep -v '^ *+' conftest.er1 >conftest.err
55+ rm -f conftest.er1
56+ cat conftest.err >&5
57+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
58+ (exit $ac_status); } && {
59+ test -z "$ac_c_werror_flag" ||
60+ test ! -s conftest.err
61+ } && test -s conftest.$ac_objext; then
62+ { $as_echo "$as_me:$LINENO: result: yes" >&5
63+ $as_echo "yes" >&6; }; cat >>confdefs.h <<\_ACEOF
64+ #define HAVE_ATTRIBUTE_UNUSED 1
65+ _ACEOF
66+
67+ else
68+ $as_echo "$as_me: failed program was:" >&5
69+ sed 's/^/| /' conftest.$ac_ext >&5
70+
71+ { $as_echo "$as_me:$LINENO: result: no" >&5
72+ $as_echo "no" >&6; }
73+ fi
74+
75+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
76+
77 if test "${ac_cv_header_elf_h+set}" = set; then
78 { $as_echo "$as_me:$LINENO: checking for elf.h" >&5
79 $as_echo_n "checking for elf.h... " >&6; }
80*** ../vim-7.2.172/src/buffer.c 2009-05-13 20:47:07.000000000 +0200
81--- src/buffer.c 2009-05-14 21:34:06.000000000 +0200
82***************
83*** 512,523 ****
84 * buf_freeall() - free all things allocated for a buffer that are related to
85 * the file.
86 */
87- /*ARGSUSED*/
88 void
89 buf_freeall(buf, del_buf, wipe_buf)
90 buf_T *buf;
91! int del_buf; /* buffer is going to be deleted */
92! int wipe_buf; /* buffer is going to be wiped out */
93 {
94 #ifdef FEAT_AUTOCMD
95 int is_curbuf = (buf == curbuf);
96--- 512,522 ----
97 * buf_freeall() - free all things allocated for a buffer that are related to
98 * the file.
99 */
100 void
101 buf_freeall(buf, del_buf, wipe_buf)
102 buf_T *buf;
103! int del_buf UNUSED; /* buffer is going to be deleted */
104! int wipe_buf UNUSED; /* buffer is going to be wiped out */
105 {
106 #ifdef FEAT_AUTOCMD
107 int is_curbuf = (buf == curbuf);
108***************
109*** 2437,2447 ****
110 * another tab page.
111 * Returns NULL when there isn't any info.
112 */
113- /*ARGSUSED*/
114 static wininfo_T *
115 find_wininfo(buf, skip_diff_buffer)
116 buf_T *buf;
117! int skip_diff_buffer;
118 {
119 wininfo_T *wip;
120
121--- 2436,2445 ----
122 * another tab page.
123 * Returns NULL when there isn't any info.
124 */
125 static wininfo_T *
126 find_wininfo(buf, skip_diff_buffer)
127 buf_T *buf;
128! int skip_diff_buffer UNUSED;
129 {
130 wininfo_T *wip;
131
132***************
133*** 4278,4287 ****
134 * Make "ffname" a full file name, set "sfname" to "ffname" if not NULL.
135 * "ffname" becomes a pointer to allocated memory (or NULL).
136 */
137- /*ARGSUSED*/
138 void
139 fname_expand(buf, ffname, sfname)
140! buf_T *buf;
141 char_u **ffname;
142 char_u **sfname;
143 {
144--- 4276,4284 ----
145 * Make "ffname" a full file name, set "sfname" to "ffname" if not NULL.
146 * "ffname" becomes a pointer to allocated memory (or NULL).
147 */
148 void
149 fname_expand(buf, ffname, sfname)
150! buf_T *buf UNUSED;
151 char_u **ffname;
152 char_u **sfname;
153 {
154***************
155*** 5577,5587 ****
156 * this buffer. Call this to wipe out a temp buffer that does not contain any
157 * marks.
158 */
159- /*ARGSUSED*/
160 void
161 wipe_buffer(buf, aucmd)
162 buf_T *buf;
163! int aucmd; /* When TRUE trigger autocommands. */
164 {
165 if (buf->b_fnum == top_file_num - 1)
166 --top_file_num;
167--- 5574,5583 ----
168 * this buffer. Call this to wipe out a temp buffer that does not contain any
169 * marks.
170 */
171 void
172 wipe_buffer(buf, aucmd)
173 buf_T *buf;
174! int aucmd UNUSED; /* When TRUE trigger autocommands. */
175 {
176 if (buf->b_fnum == top_file_num - 1)
177 --top_file_num;
178*** ../vim-7.2.172/src/charset.c 2009-05-13 14:10:46.000000000 +0200
179--- src/charset.c 2009-05-14 21:34:30.000000000 +0200
180***************
181*** 1026,1038 ****
182 * string at start of line. Warning: *headp is only set if it's a non-zero
183 * value, init to 0 before calling.
184 */
185- /*ARGSUSED*/
186 int
187 win_lbr_chartabsize(wp, s, col, headp)
188 win_T *wp;
189 char_u *s;
190 colnr_T col;
191! int *headp;
192 {
193 #ifdef FEAT_LINEBREAK
194 int c;
195--- 1026,1037 ----
196 * string at start of line. Warning: *headp is only set if it's a non-zero
197 * value, init to 0 before calling.
198 */
199 int
200 win_lbr_chartabsize(wp, s, col, headp)
201 win_T *wp;
202 char_u *s;
203 colnr_T col;
204! int *headp UNUSED;
205 {
206 #ifdef FEAT_LINEBREAK
207 int c;
208*** ../vim-7.2.172/src/diff.c 2009-05-13 18:54:14.000000000 +0200
209--- src/diff.c 2009-05-14 21:24:59.000000000 +0200
210***************
211*** 652,661 ****
212 * The buffers are written to a file, also for unmodified buffers (the file
213 * could have been produced by autocommands, e.g. the netrw plugin).
214 */
215- /*ARGSUSED*/
216 void
217 ex_diffupdate(eap)
218! exarg_T *eap; /* can be NULL, it's not used */
219 {
220 buf_T *buf;
221 int idx_orig;
222--- 652,660 ----
223 * The buffers are written to a file, also for unmodified buffers (the file
224 * could have been produced by autocommands, e.g. the netrw plugin).
225 */
226 void
227 ex_diffupdate(eap)
228! exarg_T *eap UNUSED; /* can be NULL */
229 {
230 buf_T *buf;
231 int idx_orig;
232***************
233*** 1094,1103 ****
234 /*
235 * Set options to show difs for the current window.
236 */
237- /*ARGSUSED*/
238 void
239 ex_diffthis(eap)
240! exarg_T *eap;
241 {
242 /* Set 'diff', 'scrollbind' on and 'wrap' off. */
243 diff_win_options(curwin, TRUE);
244--- 1093,1101 ----
245 /*
246 * Set options to show difs for the current window.
247 */
248 void
249 ex_diffthis(eap)
250! exarg_T *eap UNUSED;
251 {
252 /* Set 'diff', 'scrollbind' on and 'wrap' off. */
253 diff_win_options(curwin, TRUE);
254*** ../vim-7.2.172/src/configure.in 2009-05-13 14:48:55.000000000 +0200
255--- src/configure.in 2009-05-14 22:08:06.000000000 +0200
256***************
257*** 2067,2072 ****
258--- 2067,2077 ----
259 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_DATE_TIME),
260 AC_MSG_RESULT(no))
261
262+ AC_MSG_CHECKING(whether __attribute__((unused)) is allowed)
263+ AC_TRY_COMPILE([#include <stdio.h>], [int x __attribute__((unused));],
264+ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ATTRIBUTE_UNUSED),
265+ AC_MSG_RESULT(no))
266+
267 dnl Checks for header files.
268 AC_CHECK_HEADER(elf.h, HAS_ELF=1)
269 dnl AC_CHECK_HEADER(dwarf.h, SVR4=1)
270*** ../vim-7.2.172/src/config.h.in 2009-03-02 02:44:54.000000000 +0100
271--- src/config.h.in 2009-05-14 21:15:02.000000000 +0200
272***************
273*** 30,35 ****
274--- 30,38 ----
275 /* Define when __DATE__ " " __TIME__ can be used */
276 #undef HAVE_DATE_TIME
277
278+ /* Define when __attribute__((unused)) can be used */
279+ #undef HAVE_ATTRIBUTE_UNUSED
280+
281 /* defined always when using configure */
282 #undef UNIX
283
284*** ../vim-7.2.172/src/edit.c 2009-05-13 18:54:14.000000000 +0200
285--- src/edit.c 2009-05-14 21:35:08.000000000 +0200
286***************
287*** 1447,1456 ****
288 * Only redraw when there are no characters available. This speeds up
289 * inserting sequences of characters (e.g., for CTRL-R).
290 */
291- /*ARGSUSED*/
292 static void
293 ins_redraw(ready)
294! int ready; /* not busy with something */
295 {
296 if (!char_avail())
297 {
298--- 1447,1455 ----
299 * Only redraw when there are no characters available. This speeds up
300 * inserting sequences of characters (e.g., for CTRL-R).
301 */
302 static void
303 ins_redraw(ready)
304! int ready UNUSED; /* not busy with something */
305 {
306 if (!char_avail())
307 {
308***************
309*** 1962,1971 ****
310 * Only matters when there are composing characters.
311 * Return TRUE when something was deleted.
312 */
313- /*ARGSUSED*/
314 static int
315 del_char_after_col(limit_col)
316! int limit_col;
317 {
318 #ifdef FEAT_MBYTE
319 if (enc_utf8 && limit_col >= 0)
320--- 1961,1969 ----
321 * Only matters when there are composing characters.
322 * Return TRUE when something was deleted.
323 */
324 static int
325 del_char_after_col(limit_col)
326! int limit_col UNUSED;
327 {
328 #ifdef FEAT_MBYTE
329 if (enc_utf8 && limit_col >= 0)
330*** ../vim-7.2.172/src/ex_cmds.c 2009-05-14 21:51:06.000000000 +0200
331--- src/ex_cmds.c 2009-05-14 21:11:01.000000000 +0200
332***************
333*** 43,52 ****
334 /*
335 * ":ascii" and "ga".
336 */
337- /*ARGSUSED*/
338 void
339 do_ascii(eap)
340! exarg_T *eap;
341 {
342 int c;
343 int cval;
344--- 43,51 ----
345 /*
346 * ":ascii" and "ga".
347 */
348 void
349 do_ascii(eap)
350! exarg_T *eap UNUSED;
351 {
352 int c;
353 int cval;
354***************
355*** 2373,2382 ****
356 * ^? ^H
357 * not ^? ^?
358 */
359- /*ARGSUSED*/
360 void
361 do_fixdel(eap)
362! exarg_T *eap;
363 {
364 char_u *p;
365
366--- 2372,2380 ----
367 * ^? ^H
368 * not ^? ^?
369 */
370 void
371 do_fixdel(eap)
372! exarg_T *eap UNUSED;
373 {
374 char_u *p;
375
376***************
377*** 6127,6136 ****
378 /*
379 * ":exusage"
380 */
381- /*ARGSUSED*/
382 void
383 ex_exusage(eap)
384! exarg_T *eap;
385 {
386 do_cmdline_cmd((char_u *)"help ex-cmd-index");
387 }
388--- 6125,6133 ----
389 /*
390 * ":exusage"
391 */
392 void
393 ex_exusage(eap)
394! exarg_T *eap UNUSED;
395 {
396 do_cmdline_cmd((char_u *)"help ex-cmd-index");
397 }
398***************
399*** 6138,6147 ****
400 /*
401 * ":viusage"
402 */
403- /*ARGSUSED*/
404 void
405 ex_viusage(eap)
406! exarg_T *eap;
407 {
408 do_cmdline_cmd((char_u *)"help normal-index");
409 }
410--- 6135,6143 ----
411 /*
412 * ":viusage"
413 */
414 void
415 ex_viusage(eap)
416! exarg_T *eap UNUSED;
417 {
418 do_cmdline_cmd((char_u *)"help normal-index");
419 }
420***************
421*** 7154,7163 ****
422 * Function given to ExpandGeneric() to obtain the sign command
423 * expansion.
424 */
425- /*ARGSUSED*/
426 char_u *
427 get_sign_name(xp, idx)
428! expand_T *xp;
429 int idx;
430 {
431 sign_T *sp;
432--- 7150,7158 ----
433 * Function given to ExpandGeneric() to obtain the sign command
434 * expansion.
435 */
436 char_u *
437 get_sign_name(xp, idx)
438! expand_T *xp UNUSED;
439 int idx;
440 {
441 sign_T *sp;
442*** ../vim-7.2.172/src/ex_cmds2.c 2009-05-13 18:54:14.000000000 +0200
443--- src/ex_cmds2.c 2009-05-14 21:35:40.000000000 +0200
444***************
445*** 680,689 ****
446 /*
447 * ":breaklist".
448 */
449- /*ARGSUSED*/
450 void
451 ex_breaklist(eap)
452! exarg_T *eap;
453 {
454 struct debuggy *bp;
455 int i;
456--- 680,688 ----
457 /*
458 * ":breaklist".
459 */
460 void
461 ex_breaklist(eap)
462! exarg_T *eap UNUSED;
463 {
464 struct debuggy *bp;
465 int i;
466***************
467*** 1342,1355 ****
468 /*
469 * return TRUE if buffer was changed and cannot be abandoned.
470 */
471- /*ARGSUSED*/
472 int
473 check_changed(buf, checkaw, mult_win, forceit, allbuf)
474 buf_T *buf;
475 int checkaw; /* do autowrite if buffer was changed */
476 int mult_win; /* check also when several wins for the buf */
477 int forceit;
478! int allbuf; /* may write all buffers */
479 {
480 if ( !forceit
481 && bufIsChanged(buf)
482--- 1341,1353 ----
483 /*
484 * return TRUE if buffer was changed and cannot be abandoned.
485 */
486 int
487 check_changed(buf, checkaw, mult_win, forceit, allbuf)
488 buf_T *buf;
489 int checkaw; /* do autowrite if buffer was changed */
490 int mult_win; /* check also when several wins for the buf */
491 int forceit;
492! int allbuf UNUSED; /* may write all buffers */
493 {
494 if ( !forceit
495 && bufIsChanged(buf)
496***************
497*** 1759,1770 ****
498 *
499 * Return FAIL for failure, OK otherwise.
500 */
501- /*ARGSUSED*/
502 static int
503 do_arglist(str, what, after)
504 char_u *str;
505! int what;
506! int after; /* 0 means before first one */
507 {
508 garray_T new_ga;
509 int exp_count;
510--- 1757,1767 ----
511 *
512 * Return FAIL for failure, OK otherwise.
513 */
514 static int
515 do_arglist(str, what, after)
516 char_u *str;
517! int what UNUSED;
518! int after UNUSED; /* 0 means before first one */
519 {
520 garray_T new_ga;
521 int exp_count;
522***************
523*** 2549,2559 ****
524
525 static void source_callback __ARGS((char_u *fname, void *cookie));
526
527- /*ARGSUSED*/
528 static void
529 source_callback(fname, cookie)
530 char_u *fname;
531! void *cookie;
532 {
533 (void)do_source(fname, FALSE, DOSO_NONE);
534 }
535--- 2546,2555 ----
536
537 static void source_callback __ARGS((char_u *fname, void *cookie));
538
539 static void
540 source_callback(fname, cookie)
541 char_u *fname;
542! void *cookie UNUSED;
543 {
544 (void)do_source(fname, FALSE, DOSO_NONE);
545 }
546***************
547*** 2680,2689 ****
548 /*
549 * ":options"
550 */
551- /*ARGSUSED*/
552 void
553 ex_options(eap)
554! exarg_T *eap;
555 {
556 cmd_source((char_u *)SYS_OPTWIN_FILE, NULL);
557 }
558--- 2676,2684 ----
559 /*
560 * ":options"
561 */
562 void
563 ex_options(eap)
564! exarg_T *eap UNUSED;
565 {
566 cmd_source((char_u *)SYS_OPTWIN_FILE, NULL);
567 }
568***************
569*** 3190,3199 ****
570 /*
571 * ":scriptnames"
572 */
573- /*ARGSUSED*/
574 void
575 ex_scriptnames(eap)
576! exarg_T *eap;
577 {
578 int i;
579
580--- 3185,3193 ----
581 /*
582 * ":scriptnames"
583 */
584 void
585 ex_scriptnames(eap)
586! exarg_T *eap UNUSED;
587 {
588 int i;
589
590***************
591*** 3317,3328 ****
592 * Return a pointer to the line in allocated memory.
593 * Return NULL for end-of-file or some error.
594 */
595- /* ARGSUSED */
596 char_u *
597 getsourceline(c, cookie, indent)
598! int c; /* not used */
599 void *cookie;
600! int indent; /* not used */
601 {
602 struct source_cookie *sp = (struct source_cookie *)cookie;
603 char_u *line;
604--- 3311,3321 ----
605 * Return a pointer to the line in allocated memory.
606 * Return NULL for end-of-file or some error.
607 */
608 char_u *
609 getsourceline(c, cookie, indent)
610! int c UNUSED;
611 void *cookie;
612! int indent UNUSED;
613 {
614 struct source_cookie *sp = (struct source_cookie *)cookie;
615 char_u *line;
616***************
617*** 3649,3658 ****
618 * ":scriptencoding": Set encoding conversion for a sourced script.
619 * Without the multi-byte feature it's simply ignored.
620 */
621- /*ARGSUSED*/
622 void
623 ex_scriptencoding(eap)
624! exarg_T *eap;
625 {
626 #ifdef FEAT_MBYTE
627 struct source_cookie *sp;
628--- 3642,3650 ----
629 * ":scriptencoding": Set encoding conversion for a sourced script.
630 * Without the multi-byte feature it's simply ignored.
631 */
632 void
633 ex_scriptencoding(eap)
634! exarg_T *eap UNUSED;
635 {
636 #ifdef FEAT_MBYTE
637 struct source_cookie *sp;
638***************
639*** 4101,4110 ****
640 * Function given to ExpandGeneric() to obtain the possible arguments of the
641 * ":language" command.
642 */
643- /*ARGSUSED*/
644 char_u *
645 get_lang_arg(xp, idx)
646! expand_T *xp;
647 int idx;
648 {
649 if (idx == 0)
650--- 4093,4101 ----
651 * Function given to ExpandGeneric() to obtain the possible arguments of the
652 * ":language" command.
653 */
654 char_u *
655 get_lang_arg(xp, idx)
656! expand_T *xp UNUSED;
657 int idx;
658 {
659 if (idx == 0)
660*** ../vim-7.2.172/src/version.c 2009-05-14 22:00:37.000000000 +0200
661--- src/version.c 2009-05-14 22:14:51.000000000 +0200
662***************
663*** 1623,1632 ****
664 /*
665 * ":intro": clear screen, display intro screen and wait for return.
666 */
667- /*ARGSUSED*/
668 void
669 ex_intro(eap)
670! exarg_T *eap;
671 {
672 screenclear();
673 intro_message(TRUE);
674--- 1625,1633 ----
675 /*
676 * ":intro": clear screen, display intro screen and wait for return.
677 */
678 void
679 ex_intro(eap)
680! exarg_T *eap UNUSED;
681 {
682 screenclear();
683 intro_message(TRUE);
684*** ../vim-7.2.172/src/vim.h 2009-05-13 18:54:14.000000000 +0200
685--- src/vim.h 2009-05-14 21:17:51.000000000 +0200
686***************
687*** 262,267 ****
688--- 262,275 ----
689 # define __PARMS(x) __ARGS(x)
690 #endif
691
692+ /* Mark unused function arguments with UNUSED, so that gcc -Wunused-parameter
693+ * can be used to check for mistakes. */
694+ #ifdef HAVE_ATTRIBUTE_UNUSED
695+ # define UNUSED __attribute__((unused))
696+ #else
697+ # define UNUSED
698+ #endif
699+
700 /* if we're compiling in C++ (currently only KVim), the system
701 * headers must have the correct prototypes or nothing will build.
702 * conversely, our prototypes might clash due to throw() specifiers and
703*** ../vim-7.2.172/src/version.c 2009-05-14 22:00:37.000000000 +0200
704--- src/version.c 2009-05-14 22:14:51.000000000 +0200
705***************
706*** 678,679 ****
707--- 678,681 ----
708 { /* Add new patch number below this line */
709+ /**/
710+ 173,
711 /**/
712
713--
714SIGIRO -- irony detected (iron core dumped)
715
716 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
717/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
718\\\ download, build and distribute -- http://www.A-A-P.org ///
719 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
This page took 0.120294 seconds and 4 git commands to generate.