comparison src/if_ruby.c @ 1888:ae2251be41f9 v7.2.185

updated for version 7.2-185
author vimboss
date Fri, 22 May 2009 16:20:57 +0000
parents 880ece6b2476
children 1c7a66d820e4
comparison
equal deleted inserted replaced
1887:fc89a4f98a8b 1888:ae2251be41f9
490 EMSG(buff); 490 EMSG(buff);
491 break; 491 break;
492 } 492 }
493 } 493 }
494 494
495 static VALUE vim_message(VALUE self, VALUE str) 495 static VALUE vim_message(VALUE self UNUSED, VALUE str)
496 { 496 {
497 char *buff, *p; 497 char *buff, *p;
498 498
499 str = rb_obj_as_string(str); 499 str = rb_obj_as_string(str);
500 buff = ALLOCA_N(char, RSTRING(str)->len); 500 buff = ALLOCA_N(char, RSTRING(str)->len);
503 if (p) *p = '\0'; 503 if (p) *p = '\0';
504 MSG(buff); 504 MSG(buff);
505 return Qnil; 505 return Qnil;
506 } 506 }
507 507
508 static VALUE vim_set_option(VALUE self, VALUE str) 508 static VALUE vim_set_option(VALUE self UNUSED, VALUE str)
509 { 509 {
510 do_set((char_u *)STR2CSTR(str), 0); 510 do_set((char_u *)STR2CSTR(str), 0);
511 update_screen(NOT_VALID); 511 update_screen(NOT_VALID);
512 return Qnil; 512 return Qnil;
513 } 513 }
514 514
515 static VALUE vim_command(VALUE self, VALUE str) 515 static VALUE vim_command(VALUE self UNUSED, VALUE str)
516 { 516 {
517 do_cmdline_cmd((char_u *)STR2CSTR(str)); 517 do_cmdline_cmd((char_u *)STR2CSTR(str));
518 return Qnil; 518 return Qnil;
519 } 519 }
520 520
521 static VALUE vim_evaluate(VALUE self, VALUE str) 521 static VALUE vim_evaluate(VALUE self UNUSED, VALUE str)
522 { 522 {
523 #ifdef FEAT_EVAL 523 #ifdef FEAT_EVAL
524 char_u *value = eval_to_string((char_u *)STR2CSTR(str), NULL, TRUE); 524 char_u *value = eval_to_string((char_u *)STR2CSTR(str), NULL, TRUE);
525 525
526 if (value != NULL) 526 if (value != NULL)
578 } 578 }
579 579
580 return INT2NUM(n); 580 return INT2NUM(n);
581 } 581 }
582 582
583 static VALUE buffer_s_aref(VALUE self, VALUE num) 583 static VALUE buffer_s_aref(VALUE self UNUSED, VALUE num)
584 { 584 {
585 buf_T *b; 585 buf_T *b;
586 int n = NUM2INT(num); 586 int n = NUM2INT(num);
587 587
588 for (b = firstbuf; b != NULL; b = b->b_next) 588 for (b = firstbuf; b != NULL; b = b->b_next)
627 { 627 {
628 char *line = (char *)ml_get_buf(buf, n, FALSE); 628 char *line = (char *)ml_get_buf(buf, n, FALSE);
629 return line ? rb_str_new2(line) : Qnil; 629 return line ? rb_str_new2(line) : Qnil;
630 } 630 }
631 rb_raise(rb_eIndexError, "index %d out of buffer", n); 631 rb_raise(rb_eIndexError, "index %d out of buffer", n);
632 #ifndef __GNUC__
632 return Qnil; /* For stop warning */ 633 return Qnil; /* For stop warning */
634 #endif
633 } 635 }
634 636
635 static VALUE buffer_aref(VALUE self, VALUE num) 637 static VALUE buffer_aref(VALUE self, VALUE num)
636 { 638 {
637 buf_T *buf = get_buf(self); 639 buf_T *buf = get_buf(self);
666 update_curbuf(NOT_VALID); 668 update_curbuf(NOT_VALID);
667 } 669 }
668 else 670 else
669 { 671 {
670 rb_raise(rb_eIndexError, "index %d out of buffer", n); 672 rb_raise(rb_eIndexError, "index %d out of buffer", n);
673 #ifndef __GNUC__
671 return Qnil; /* For stop warning */ 674 return Qnil; /* For stop warning */
675 #endif
672 } 676 }
673 return str; 677 return str;
674 } 678 }
675 679
676 static VALUE buffer_aset(VALUE self, VALUE num, VALUE str) 680 static VALUE buffer_aset(VALUE self, VALUE num, VALUE str)
787 static VALUE line_s_current() 791 static VALUE line_s_current()
788 { 792 {
789 return get_buffer_line(curbuf, curwin->w_cursor.lnum); 793 return get_buffer_line(curbuf, curwin->w_cursor.lnum);
790 } 794 }
791 795
792 static VALUE set_current_line(VALUE self, VALUE str) 796 static VALUE set_current_line(VALUE self UNUSED, VALUE str)
793 { 797 {
794 return set_buffer_line(curbuf, curwin->w_cursor.lnum, str); 798 return set_buffer_line(curbuf, curwin->w_cursor.lnum, str);
795 } 799 }
796 800
797 static VALUE current_line_number() 801 static VALUE current_line_number()
813 #else 817 #else
814 return INT2NUM(1); 818 return INT2NUM(1);
815 #endif 819 #endif
816 } 820 }
817 821
818 static VALUE window_s_aref(VALUE self, VALUE num) 822 static VALUE window_s_aref(VALUE self UNUSED, VALUE num)
819 { 823 {
820 win_T *w; 824 win_T *w;
821 int n = NUM2INT(num); 825 int n = NUM2INT(num);
822 826
823 #ifndef FEAT_WINDOWS 827 #ifndef FEAT_WINDOWS
895 check_cursor(); /* put cursor on an existing line */ 899 check_cursor(); /* put cursor on an existing line */
896 update_screen(NOT_VALID); 900 update_screen(NOT_VALID);
897 return Qnil; 901 return Qnil;
898 } 902 }
899 903
900 static VALUE f_p(int argc, VALUE *argv, VALUE self) 904 static VALUE f_p(int argc, VALUE *argv, VALUE self UNUSED)
901 { 905 {
902 int i; 906 int i;
903 VALUE str = rb_str_new("", 0); 907 VALUE str = rb_str_new("", 0);
904 908
905 for (i = 0; i < argc; i++) { 909 for (i = 0; i < argc; i++) {