81c2858
To: vim-dev@vim.org
81c2858
Subject: Patch 7.2.185
81c2858
Fcc: outbox
81c2858
From: Bram Moolenaar <Bram@moolenaar.net>
81c2858
Mime-Version: 1.0
81c2858
Content-Type: text/plain; charset=UTF-8
81c2858
Content-Transfer-Encoding: 8bit
81c2858
------------
81c2858
81c2858
Patch 7.2.185
81c2858
Problem:    Some more compiler warnings when using gcc -Wextra.
81c2858
Solution:   Add UNUSED and type casts.
81c2858
Files:	    src/Makefile, src/if_tlc.c, src/if_ruby.c
81c2858
81c2858
81c2858
*** ../vim-7.2.184/src/Makefile	2009-05-21 23:25:47.000000000 +0200
81c2858
--- src/Makefile	2009-05-22 18:18:44.000000000 +0200
81c2858
***************
81c2858
*** 105,112 ****
81c2858
  # 4. "make test"  {{{1
81c2858
  #	This is optional.  This will run Vim scripts on a number of test
81c2858
  #	files, and compare the produced output with the expected output.
81c2858
! #	If all is well, you will get the "ALL DONE" message in the end.  See
81c2858
! #	below (search for "/^test").
81c2858
  #
81c2858
  # 5. "make install"  {{{1
81c2858
  #	If the new Vim seems to be working OK you can install it and the
81c2858
--- 105,112 ----
81c2858
  # 4. "make test"  {{{1
81c2858
  #	This is optional.  This will run Vim scripts on a number of test
81c2858
  #	files, and compare the produced output with the expected output.
81c2858
! #	If all is well, you will get the "ALL DONE" message in the end.  If a
81c2858
! #	test fails you get "TEST FAILURE".  See below (search for "/^test").
81c2858
  #
81c2858
  # 5. "make install"  {{{1
81c2858
  #	If the new Vim seems to be working OK you can install it and the
81c2858
***************
81c2858
*** 533,538 ****
81c2858
--- 533,543 ----
81c2858
  #CFLAGS = -g -DDEBUG -Wall -Wshadow -Wmissing-prototypes
81c2858
  #CFLAGS = -g -O2 '-DSTARTUPTIME="vimstartup"' -fno-strength-reduce -Wall -Wmissing-prototypes
81c2858
  
81c2858
+ # Use this with GCC to check for mistakes, unused arguments, etc.
81c2858
+ #CFLAGS = -g -Wall -Wextra -Wmissing-prototypes -Wunreachable-code
81c2858
+ #PYTHON_CFLAGS_EXTRA = -Wno-missing-field-initializers
81c2858
+ #MZSCHEME_CFLAGS_EXTRA = -Wno-unreachable-code
81c2858
+ 
81c2858
  # EFENCE - Electric-Fence malloc debugging: catches memory accesses beyond
81c2858
  # allocated memory (and makes every malloc()/free() very slow).
81c2858
  # Electric Fence is free (search ftp sites).
81c2858
***************
81c2858
*** 551,562 ****
81c2858
  # }}}
81c2858
  
81c2858
  # LINT - for running lint
81c2858
! #  For standard lint
81c2858
! #LINT = lint
81c2858
! #LINT_OPTIONS = -beprxzF
81c2858
! #  For splint  (see cleanlint.vim for filtering the output)
81c2858
! LINT = splint
81c2858
! LINT_OPTIONS = +unixlib -weak -macrovarprefixexclude -showfunc -linelen 9999
81c2858
  
81c2858
  # PROFILING - Uncomment the next two lines to do profiling with gcc and gprof.
81c2858
  # Might not work with GUI or Perl.
81c2858
--- 556,568 ----
81c2858
  # }}}
81c2858
  
81c2858
  # LINT - for running lint
81c2858
! #  For standard Unix lint
81c2858
! LINT = lint
81c2858
! LINT_OPTIONS = -beprxzF
81c2858
! #  For splint
81c2858
! #  It doesn't work well, crashes on include files and non-ascii characters.
81c2858
! #LINT = splint
81c2858
! #LINT_OPTIONS = +unixlib -weak -macrovarprefixexclude -showfunc -linelen 9999
81c2858
  
81c2858
  # PROFILING - Uncomment the next two lines to do profiling with gcc and gprof.
81c2858
  # Might not work with GUI or Perl.
81c2858
***************
81c2858
*** 1743,1749 ****
81c2858
  # messages.  Don't worry about that.
81c2858
  # If there is a real error, there will be a difference between "test.out" and
81c2858
  # a "test99.ok" file.
81c2858
! # If everything is alright, the final message will be "ALL DONE".
81c2858
  #
81c2858
  test check:
81c2858
  	$(MAKE) -f Makefile $(VIMTARGET)
81c2858
--- 1749,1756 ----
81c2858
  # messages.  Don't worry about that.
81c2858
  # If there is a real error, there will be a difference between "test.out" and
81c2858
  # a "test99.ok" file.
81c2858
! # If everything is alright, the final message will be "ALL DONE".  If not you
81c2858
! # get "TEST FAILURE".
81c2858
  #
81c2858
  test check:
81c2858
  	$(MAKE) -f Makefile $(VIMTARGET)
81c2858
***************
81c2858
*** 2427,2433 ****
81c2858
  	$(CCC) -o $@ if_xcmdsrv.c
81c2858
  
81c2858
  objects/if_mzsch.o: if_mzsch.c
81c2858
! 	$(CCC) -o $@ if_mzsch.c
81c2858
  
81c2858
  objects/if_perl.o: auto/if_perl.c
81c2858
  	$(CCC) -o $@ auto/if_perl.c
81c2858
--- 2434,2440 ----
81c2858
  	$(CCC) -o $@ if_xcmdsrv.c
81c2858
  
81c2858
  objects/if_mzsch.o: if_mzsch.c
81c2858
! 	$(CCC) -o $@ $(MZSCHEME_CFLAGS_EXTRA) if_mzsch.c
81c2858
  
81c2858
  objects/if_perl.o: auto/if_perl.c
81c2858
  	$(CCC) -o $@ auto/if_perl.c
81c2858
***************
81c2858
*** 2436,2442 ****
81c2858
  	$(CCC) -o $@ if_perlsfio.c
81c2858
  
81c2858
  objects/if_python.o: if_python.c
81c2858
! 	$(CCC) -o $@ if_python.c
81c2858
  
81c2858
  objects/if_ruby.o: if_ruby.c
81c2858
  	$(CCC) -o $@ if_ruby.c
81c2858
--- 2443,2449 ----
81c2858
  	$(CCC) -o $@ if_perlsfio.c
81c2858
  
81c2858
  objects/if_python.o: if_python.c
81c2858
! 	$(CCC) -o $@ $(PYTHON_CFLAGS_EXTRA) if_python.c
81c2858
  
81c2858
  objects/if_ruby.o: if_ruby.c
81c2858
  	$(CCC) -o $@ if_ruby.c
81c2858
*** ../vim-7.2.184/src/if_ruby.c	2007-09-13 15:00:49.000000000 +0200
81c2858
--- src/if_ruby.c	2009-05-22 15:32:04.000000000 +0200
81c2858
***************
81c2858
*** 492,498 ****
81c2858
      }
81c2858
  }
81c2858
  
81c2858
! static VALUE vim_message(VALUE self, VALUE str)
81c2858
  {
81c2858
      char *buff, *p;
81c2858
  
81c2858
--- 492,498 ----
81c2858
      }
81c2858
  }
81c2858
  
81c2858
! static VALUE vim_message(VALUE self UNUSED, VALUE str)
81c2858
  {
81c2858
      char *buff, *p;
81c2858
  
81c2858
***************
81c2858
*** 505,524 ****
81c2858
      return Qnil;
81c2858
  }
81c2858
  
81c2858
! static VALUE vim_set_option(VALUE self, VALUE str)
81c2858
  {
81c2858
      do_set((char_u *)STR2CSTR(str), 0);
81c2858
      update_screen(NOT_VALID);
81c2858
      return Qnil;
81c2858
  }
81c2858
  
81c2858
! static VALUE vim_command(VALUE self, VALUE str)
81c2858
  {
81c2858
      do_cmdline_cmd((char_u *)STR2CSTR(str));
81c2858
      return Qnil;
81c2858
  }
81c2858
  
81c2858
! static VALUE vim_evaluate(VALUE self, VALUE str)
81c2858
  {
81c2858
  #ifdef FEAT_EVAL
81c2858
      char_u *value = eval_to_string((char_u *)STR2CSTR(str), NULL, TRUE);
81c2858
--- 505,524 ----
81c2858
      return Qnil;
81c2858
  }
81c2858
  
81c2858
! static VALUE vim_set_option(VALUE self UNUSED, VALUE str)
81c2858
  {
81c2858
      do_set((char_u *)STR2CSTR(str), 0);
81c2858
      update_screen(NOT_VALID);
81c2858
      return Qnil;
81c2858
  }
81c2858
  
81c2858
! static VALUE vim_command(VALUE self UNUSED, VALUE str)
81c2858
  {
81c2858
      do_cmdline_cmd((char_u *)STR2CSTR(str));
81c2858
      return Qnil;
81c2858
  }
81c2858
  
81c2858
! static VALUE vim_evaluate(VALUE self UNUSED, VALUE str)
81c2858
  {
81c2858
  #ifdef FEAT_EVAL
81c2858
      char_u *value = eval_to_string((char_u *)STR2CSTR(str), NULL, TRUE);
81c2858
***************
81c2858
*** 580,586 ****
81c2858
      return INT2NUM(n);
81c2858
  }
81c2858
  
81c2858
! static VALUE buffer_s_aref(VALUE self, VALUE num)
81c2858
  {
81c2858
      buf_T *b;
81c2858
      int n = NUM2INT(num);
81c2858
--- 580,586 ----
81c2858
      return INT2NUM(n);
81c2858
  }
81c2858
  
81c2858
! static VALUE buffer_s_aref(VALUE self UNUSED, VALUE num)
81c2858
  {
81c2858
      buf_T *b;
81c2858
      int n = NUM2INT(num);
81c2858
***************
81c2858
*** 629,635 ****
81c2858
--- 629,637 ----
81c2858
  	return line ? rb_str_new2(line) : Qnil;
81c2858
      }
81c2858
      rb_raise(rb_eIndexError, "index %d out of buffer", n);
81c2858
+ #ifndef __GNUC__
81c2858
      return Qnil; /* For stop warning */
81c2858
+ #endif
81c2858
  }
81c2858
  
81c2858
  static VALUE buffer_aref(VALUE self, VALUE num)
81c2858
***************
81c2858
*** 668,674 ****
81c2858
--- 670,678 ----
81c2858
      else
81c2858
      {
81c2858
  	rb_raise(rb_eIndexError, "index %d out of buffer", n);
81c2858
+ #ifndef __GNUC__
81c2858
  	return Qnil; /* For stop warning */
81c2858
+ #endif
81c2858
      }
81c2858
      return str;
81c2858
  }
81c2858
***************
81c2858
*** 789,795 ****
81c2858
      return get_buffer_line(curbuf, curwin->w_cursor.lnum);
81c2858
  }
81c2858
  
81c2858
! static VALUE set_current_line(VALUE self, VALUE str)
81c2858
  {
81c2858
      return set_buffer_line(curbuf, curwin->w_cursor.lnum, str);
81c2858
  }
81c2858
--- 793,799 ----
81c2858
      return get_buffer_line(curbuf, curwin->w_cursor.lnum);
81c2858
  }
81c2858
  
81c2858
! static VALUE set_current_line(VALUE self UNUSED, VALUE str)
81c2858
  {
81c2858
      return set_buffer_line(curbuf, curwin->w_cursor.lnum, str);
81c2858
  }
81c2858
***************
81c2858
*** 815,821 ****
81c2858
  #endif
81c2858
  }
81c2858
  
81c2858
! static VALUE window_s_aref(VALUE self, VALUE num)
81c2858
  {
81c2858
      win_T *w;
81c2858
      int n = NUM2INT(num);
81c2858
--- 819,825 ----
81c2858
  #endif
81c2858
  }
81c2858
  
81c2858
! static VALUE window_s_aref(VALUE self UNUSED, VALUE num)
81c2858
  {
81c2858
      win_T *w;
81c2858
      int n = NUM2INT(num);
81c2858
***************
81c2858
*** 897,903 ****
81c2858
      return Qnil;
81c2858
  }
81c2858
  
81c2858
! static VALUE f_p(int argc, VALUE *argv, VALUE self)
81c2858
  {
81c2858
      int i;
81c2858
      VALUE str = rb_str_new("", 0);
81c2858
--- 901,907 ----
81c2858
      return Qnil;
81c2858
  }
81c2858
  
81c2858
! static VALUE f_p(int argc, VALUE *argv, VALUE self UNUSED)
81c2858
  {
81c2858
      int i;
81c2858
      VALUE str = rb_str_new("", 0);
81c2858
*** ../vim-7.2.184/src/version.c	2009-05-21 23:25:38.000000000 +0200
81c2858
--- src/version.c	2009-05-22 18:18:58.000000000 +0200
81c2858
***************
81c2858
*** 678,679 ****
81c2858
--- 678,681 ----
81c2858
  {   /* Add new patch number below this line */
81c2858
+ /**/
81c2858
+     185,
81c2858
  /**/
81c2858
81c2858
-- 
81c2858
BODY:        I'm not dead!
81c2858
CART DRIVER: 'Ere.  He says he's not dead.
81c2858
LARGE MAN:   Yes he is.
81c2858
BODY:        I'm not!
81c2858
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
81c2858
81c2858
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
81c2858
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
81c2858
\\\        download, build and distribute -- http://www.A-A-P.org        ///
81c2858
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///