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