[Kde-bindings] KDE/kdebindings/ruby/qtruby

Richard Dale Richard_Dale at tipitina.demon.co.uk
Mon Jun 9 10:44:46 UTC 2008


SVN commit 818707 by rdale:

* The rb_id2name() function has changed to return a 'const char *'
  in Ruby 1.8.7, which meant the QtRuby wouldn't compile. So attempt
  to make it build on both 1.8.6 and 1.8.7. Thanks to Stefano Crocco
  for reporting the bug.

CCMAIL: kde-bindings at kde.org


 M  +7 -0      ChangeLog  
 M  +4 -4      src/Qt.cpp  


--- trunk/KDE/kdebindings/ruby/qtruby/ChangeLog #818706:818707
@@ -1,3 +1,10 @@
+2008-06-09  Richard Dale  <richard.j.dale at gmail.com>
+
+	* The rb_id2name() function has changed to return a 'const char *'
+	  in Ruby 1.8.7, which meant the QtRuby wouldn't compile. So attempt
+	  to make it build on both 1.8.6 and 1.8.7. Thanks to Stefano Crocco
+	  for reporting the bug.
+
 2008-06-08  Richard Dale  <richard.j.dale at gmail.com>
 
 	* Move the template based List marshallers to a new header
--- trunk/KDE/kdebindings/ruby/qtruby/src/Qt.cpp #818706:818707
@@ -673,7 +673,7 @@
 }
 
 QByteArray *
-find_cached_selector(int argc, VALUE * argv, VALUE klass, char * methodName)
+find_cached_selector(int argc, VALUE * argv, VALUE klass, const char * methodName)
 {
     // Look in the cache
 static QByteArray * mcid = 0;
@@ -712,7 +712,7 @@
 VALUE
 method_missing(int argc, VALUE * argv, VALUE self)
 {
-	char * methodName = rb_id2name(SYM2ID(argv[0]));
+	const char * methodName = rb_id2name(SYM2ID(argv[0]));
     VALUE klass = rb_funcall(self, rb_intern("class"), 0);
 
     VALUE retval = Qnil;
@@ -764,7 +764,7 @@
 
 			retval = rb_funcall2(qt_internal_module, rb_intern("do_method_missing"), argc+3, temp_stack);
 			if (_current_method.index == -1) {
-				char * op = rb_id2name(SYM2ID(argv[0]));
+				const char * op = rb_id2name(SYM2ID(argv[0]));
 				if (	qstrcmp(op, "-") == 0
 						|| qstrcmp(op, "+") == 0
 						|| qstrcmp(op, "/") == 0
@@ -871,7 +871,7 @@
 {
 	VALUE result = Qnil;
 	VALUE retval = Qnil;
-	char * methodName = rb_id2name(SYM2ID(argv[0]));
+	const char * methodName = rb_id2name(SYM2ID(argv[0]));
 	VALUE * temp_stack = ALLOCA_N(VALUE, argc+3);
     temp_stack[0] = rb_str_new2("Qt");
     temp_stack[1] = rb_str_new2(methodName);



More information about the Kde-bindings mailing list