File kdebindings-3.5.10-alt-ruby-compile.patch of Package kdebindings3

diff -urN kdebindings-3.5.10-orig/korundum/bin/krubyinit.cpp kdebindings-3.5.10/korundum/bin/krubyinit.cpp
--- kdebindings-3.5.10-orig/korundum/bin/krubyinit.cpp	2005-09-10 12:16:14 +0400
+++ kdebindings-3.5.10/korundum/bin/krubyinit.cpp	2009-07-02 21:28:24 +0400
@@ -24,6 +24,5 @@
 int main(int argc, char **argv) {
      ruby_init();
      ruby_script((char*)script_name);
-     ruby_options(argc, argv); 
-     ruby_run();
+     ruby_run_node(ruby_options(argc, argv));
 }
diff -urN kdebindings-3.5.10-orig/korundum/rubylib/korundum/kdehandlers.cpp kdebindings-3.5.10/korundum/rubylib/korundum/kdehandlers.cpp
--- kdebindings-3.5.10-orig/korundum/rubylib/korundum/kdehandlers.cpp	2008-08-19 22:11:29 +0400
+++ kdebindings-3.5.10/korundum/rubylib/korundum/kdehandlers.cpp	2009-07-02 18:55:38 +0400
@@ -122,7 +122,7 @@
 		break;
 	    }
 
-	    int count = RARRAY(list)->len;
+	    int count = RARRAY_LEN(list);
 	    QCStringList *stringlist = new QCStringList;
 
 	    for(long i = 0; i < count; i++) {
@@ -131,7 +131,7 @@
 		    stringlist->append(QCString());
 		    continue;
 		}
-		stringlist->append(QCString(StringValuePtr(item), RSTRING(item)->len + 1));
+		stringlist->append(QCString(StringValuePtr(item), RSTRING_LEN(item) + 1));
 	    }
 
 	    m->item().s_voidp = stringlist;
@@ -184,19 +184,19 @@
 			VALUE optionslist = *(m->var());
 			if (optionslist == Qnil
 			|| TYPE(optionslist) != T_ARRAY
-			|| RARRAY(optionslist)->len == 0 )
+			|| RARRAY_LEN(optionslist) == 0 )
 			{
 					m->item().s_voidp = 0;
 					break;
 			}
 
 			// Allocate 'length + 1' entries, to include an all NULLs last entry
-			KCmdLineOptions *cmdLineOptions = (KCmdLineOptions *) calloc(	RARRAY(optionslist)->len + 1, 
+			KCmdLineOptions *cmdLineOptions = (KCmdLineOptions *) calloc(	RARRAY_LEN(optionslist) + 1, 
 																			sizeof(struct KCmdLineOptions) );
 			
 			VALUE options;
 			long i;
-			for(i = 0; i < RARRAY(optionslist)->len; i++) {
+			for(i = 0; i < RARRAY_LEN(optionslist); i++) {
 				options = rb_ary_entry(optionslist, i);
 				VALUE temp = rb_ary_entry(options, 0);
 				cmdLineOptions[i].name = StringValuePtr(temp);
@@ -244,7 +244,7 @@
 		m->item().s_voidp = 0;
 		break;
 	    }
-	    int count = RARRAY(list)->len;
+	    int count = RARRAY_LEN(list);
 	    QValueList<WId> *valuelist = new QValueList<WId>;
 	    long i;
 	    for(i = 0; i < count; i++) {
@@ -815,7 +815,7 @@
 				m->item().s_voidp = 0;
 				break;
 			}
-			int count = RARRAY(list)->len;
+			int count = RARRAY_LEN(list);
 			KURL::List *kurllist = new KURL::List;
 			long i;
 			for(i = 0; i < count; i++) {
@@ -916,11 +916,11 @@
 		
 		KIO::UDSEntryList *cpplist = new KIO::UDSEntryList;
 		
-		for(long i = 0; i < RARRAY(list)->len; i++) {
+		for(long i = 0; i < RARRAY_LEN(list); i++) {
 			VALUE item = rb_ary_entry(list, i);
 			KIO::UDSEntry *cppsublist = new KIO::UDSEntry;
 			
-			for (int j = 0; j < RARRAY(item)->len; j++) {
+			for (int j = 0; j < RARRAY_LEN(item); j++) {
 				VALUE subitem = rb_ary_entry(item, j);
 				smokeruby_object *o = value_obj_info(subitem);
 				if(!o || !o->ptr)
@@ -998,7 +998,7 @@
 		m->item().s_voidp = 0;
 		break;
 	    }
-	    int count = RARRAY(list)->len;
+	    int count = RARRAY_LEN(list);
 	    ItemList *cpplist = new ItemList;
 	    long i;
 	    for(i = 0; i < count; i++) {
@@ -1103,7 +1103,7 @@
 		m->item().s_voidp = 0;
 		break;
 	    }
-	    int count = RARRAY(list)->len;
+	    int count = RARRAY_LEN(list);
 	    ItemList *cpplist = new ItemList;
 	    long i;
 	    for(i = 0; i < count; i++) {
@@ -1211,7 +1211,7 @@
 		// Convert the ruby hash to an array of key/value arrays
 		VALUE temp = rb_funcall(hash, rb_intern("to_a"), 0);
 
-		for (long i = 0; i < RARRAY(temp)->len; i++) {
+		for (long i = 0; i < RARRAY_LEN(temp); i++) {
 			VALUE key = rb_ary_entry(rb_ary_entry(temp, i), 0);
 			VALUE value = rb_ary_entry(rb_ary_entry(temp, i), 1);
 			
@@ -1316,7 +1316,7 @@
 		// Convert the ruby hash to an array of key/value arrays
 		VALUE temp = rb_funcall(hash, rb_intern("to_a"), 0);
 
-		for (long i = 0; i < RARRAY(temp)->len; i++) {
+		for (long i = 0; i < RARRAY_LEN(temp); i++) {
 			VALUE key = rb_ary_entry(rb_ary_entry(temp, i), 0);
 			VALUE value = rb_ary_entry(rb_ary_entry(temp, i), 1);
 			
diff -urN kdebindings-3.5.10-orig/korundum/rubylib/korundum/Korundum.cpp kdebindings-3.5.10/korundum/rubylib/korundum/Korundum.cpp
--- kdebindings-3.5.10-orig/korundum/rubylib/korundum/Korundum.cpp	2007-01-15 14:19:09 +0300
+++ kdebindings-3.5.10/korundum/rubylib/korundum/Korundum.cpp	2009-07-02 20:11:46 +0400
@@ -805,7 +805,7 @@
 			// isn't in the Smoke runtime
 			QValueList<DCOPRef> windowList;
 			
-			for (long i = 0; i < RARRAY(result)->len; i++) {
+			for (long i = 0; i < RARRAY_LEN(result); i++) {
 				VALUE item = rb_ary_entry(result, i);
 				smokeruby_object *o = value_obj_info(item);
 				if( !o || !o->ptr)
@@ -822,7 +822,7 @@
 			// And special case this type too 
 			QValueList<QCString> propertyList;
 			
-			for (long i = 0; i < RARRAY(result)->len; i++) {
+			for (long i = 0; i < RARRAY_LEN(result); i++) {
 				VALUE item = rb_ary_entry(result, i);
 				propertyList.append(QCString(StringValuePtr(item)));
 			}
@@ -836,7 +836,7 @@
 			// Convert the ruby hash to an array of key/value arrays
 			VALUE temp = rb_funcall(result, rb_intern("to_a"), 0);
 
-			for (long i = 0; i < RARRAY(temp)->len; i++) {
+			for (long i = 0; i < RARRAY_LEN(temp); i++) {
 				VALUE action = rb_ary_entry(rb_ary_entry(temp, i), 0);
 				VALUE item = rb_ary_entry(rb_ary_entry(temp, i), 1);
 				
@@ -926,7 +926,7 @@
 {
 	VALUE dcopObject = rb_funcall(kde_module, rb_intern("createDCOPObject"), 1, self);
 	
-    QString signalname(rb_id2name(rb_frame_last_func()));
+    QString signalname(rb_id2name(rb_frame_this_func()));
     VALUE args = getdcopinfo(self, signalname);
 
     if(args == Qnil) return Qfalse;
@@ -1020,7 +1020,7 @@
 	
 	if (rb_funcall(kde_module, rb_intern("hasDCOPSignals"), 1, klass) == Qtrue) {
 		VALUE signalNames = rb_funcall(kde_module, rb_intern("getDCOPSignalNames"), 1, klass);
-		for (long index = 0; index < RARRAY(signalNames)->len; index++) {
+		for (long index = 0; index < RARRAY_LEN(signalNames); index++) {
 			VALUE signal = rb_ary_entry(signalNames, index);
 			rb_define_method(klass, StringValuePtr(signal), (VALUE (*) (...)) k_dcop_signal, -1);
 		}
@@ -1088,9 +1088,9 @@
 	QStrList *args = new QStrList;
 
 	if (value_args != Qnil) {
-		for (long i = 0; i < RARRAY(value_args)->len; i++) {
+		for (long i = 0; i < RARRAY_LEN(value_args); i++) {
 			VALUE item = rb_ary_entry(value_args, i);
-			args->append(QString::fromLatin1(StringValuePtr(item), RSTRING(item)->len));
+			args->append(QString::fromLatin1(StringValuePtr(item), RSTRING_LEN(item)));
 		}
 	}
 
diff -urN kdebindings-3.5.10-orig/qtruby/bin/qtrubyinit.cpp kdebindings-3.5.10/qtruby/bin/qtrubyinit.cpp
--- kdebindings-3.5.10-orig/qtruby/bin/qtrubyinit.cpp	2005-09-10 12:16:10 +0400
+++ kdebindings-3.5.10/qtruby/bin/qtrubyinit.cpp	2009-07-02 21:28:22 +0400
@@ -24,6 +24,5 @@
 int main(int argc, char **argv) {
      ruby_init();
      ruby_script((char*)script_name);
-     ruby_options(argc, argv); 
-     ruby_run();
+     ruby_run_node(ruby_options(argc, argv));
 }
diff -urN kdebindings-3.5.10-orig/qtruby/rubylib/qtruby/handlers.cpp kdebindings-3.5.10/qtruby/rubylib/qtruby/handlers.cpp
--- kdebindings-3.5.10-orig/qtruby/rubylib/qtruby/handlers.cpp	2007-01-15 14:19:09 +0300
+++ kdebindings-3.5.10/qtruby/rubylib/qtruby/handlers.cpp	2009-07-02 18:55:44 +0400
@@ -755,7 +755,7 @@
             break;
         }
 	
-        int len = RSTRING(rv)->len;
+        int len = RSTRING_LEN(rv);
         char* mem = (char*) malloc(len+1);
         memcpy(mem, StringValuePtr(rv), len);
         mem[len] ='\0';
@@ -788,7 +788,7 @@
             m->item().s_voidp = 0;
             break;
         }
-        int len = RSTRING(rv)->len;
+        int len = RSTRING_LEN(rv);
         char* mem = (char*) malloc(len+1);
         memcpy(mem, StringValuePtr(rv), len);
         mem[len] ='\0';
@@ -824,7 +824,7 @@
 	
 	QString *	s;
 	if (qstrcmp(KCODE, "UTF8") == 0)
-		s = new QString(QString::fromUtf8(StringValuePtr(rstring), RSTRING(rstring)->len));
+		s = new QString(QString::fromUtf8(StringValuePtr(rstring), RSTRING_LEN(rstring)));
 	else if (qstrcmp(KCODE, "EUC") == 0)
 		s = new QString(codec->toUnicode(StringValuePtr(rstring)));
 	else if (qstrcmp(KCODE, "SJIS") == 0)
@@ -832,7 +832,7 @@
 	else if(qstrcmp(KCODE, "NONE") == 0)
 		s = new QString(QString::fromLatin1(StringValuePtr(rstring)));
 	else
-		s = new QString(QString::fromLocal8Bit(StringValuePtr(rstring), RSTRING(rstring)->len));
+		s = new QString(QString::fromLocal8Bit(StringValuePtr(rstring), RSTRING_LEN(rstring)));
 	return s;
 }
 
@@ -944,7 +944,7 @@
 		s = new QCString(); 
         } else {
 		// Add 1 to the ruby string length to allow for a QCString '\0' terminator
-		s = new QCString(StringValuePtr(*(m->var())), RSTRING(*(m->var()))->len + 1); 
+		s = new QCString(StringValuePtr(*(m->var())), RSTRING_LEN(*(m->var())) + 1); 
 		}
 	    m->item().s_voidp = s;
 	    
@@ -1007,7 +1007,7 @@
 		m->item().s_voidp = 0;
 		break;
 	    }
-	    int count = RARRAY(av)->len;
+	    int count = RARRAY_LEN(av);
 	    QCOORD *coord = new QCOORD[count + 2];
 	    for(long i = 0; i < count; i++) {
 		VALUE svp = rb_ary_entry(av, i);
@@ -1167,15 +1167,15 @@
 	    VALUE arglist = *(m->var());
 	    if (arglist == Qnil
 	    || TYPE(arglist) != T_ARRAY
-	    || RARRAY(arglist)->len == 0 )
+	    || RARRAY_LEN(arglist) == 0 )
 	    {
                 m->item().s_voidp = 0;
                 break;
 	    }
 
-	    char **argv = new char *[RARRAY(arglist)->len + 1];
+	    char **argv = new char *[RARRAY_LEN(arglist) + 1];
 	    long i;
-	    for(i = 0; i < RARRAY(arglist)->len; i++) {
+	    for(i = 0; i < RARRAY_LEN(arglist); i++) {
                 VALUE item = rb_ary_entry(arglist, i);
                 char *s = StringValuePtr(item);
                 argv[i] = new char[strlen(s) + 1];
@@ -1207,7 +1207,7 @@
 		break;
 	    }
 
-	    int count = RARRAY(list)->len;
+	    int count = RARRAY_LEN(list);
 	    QStringList *stringlist = new QStringList;
 
 	    for(long i = 0; i < count; i++) {
@@ -1269,7 +1269,7 @@
 		break;
 	    }
 
-	    int count = RARRAY(list)->len;
+	    int count = RARRAY_LEN(list);
 	    QStrList *stringlist = new QStrList;
 
 	    for(long i = 0; i < count; i++) {
@@ -1278,7 +1278,7 @@
 		    stringlist->append(QString());
 		    continue;
 		}
-		stringlist->append(QString::fromUtf8(StringValuePtr(item), RSTRING(item)->len));
+		stringlist->append(QString::fromUtf8(StringValuePtr(item), RSTRING_LEN(item)));
 	    }
 
 	    m->item().s_voidp = stringlist;
@@ -1331,7 +1331,7 @@
 		m->item().s_voidp = 0;
 		break;
 	    }
-	    int count = RARRAY(list)->len;
+	    int count = RARRAY_LEN(list);
 	    ItemList *cpplist = new ItemList;
 	    long i;
 	    for(i = 0; i < count; i++) {
@@ -1421,7 +1421,7 @@
 		m->item().s_voidp = 0;
 		break;
 	    }
-	    int count = RARRAY(list)->len;
+	    int count = RARRAY_LEN(list);
 	    QValueList<int> *valuelist = new QValueList<int>;
 	    long i;
 	    for(i = 0; i < count; i++) {
@@ -1513,7 +1513,7 @@
 		// Convert the ruby hash to an array of key/value arrays
 		VALUE temp = rb_funcall(hash, rb_intern("to_a"), 0);
 
-		for (long i = 0; i < RARRAY(temp)->len; i++) {
+		for (long i = 0; i < RARRAY_LEN(temp); i++) {
 			VALUE key = rb_ary_entry(rb_ary_entry(temp, i), 0);
 			VALUE value = rb_ary_entry(rb_ary_entry(temp, i), 1);
 			(*map)[QString(StringValuePtr(key))] = QString(StringValuePtr(value));
@@ -1569,7 +1569,7 @@
 		// Convert the ruby hash to an array of key/value arrays
 		VALUE temp = rb_funcall(hash, rb_intern("to_a"), 0);
 
-		for (long i = 0; i < RARRAY(temp)->len; i++) {
+		for (long i = 0; i < RARRAY_LEN(temp); i++) {
 			VALUE key = rb_ary_entry(rb_ary_entry(temp, i), 0);
 			VALUE value = rb_ary_entry(rb_ary_entry(temp, i), 1);
 			
@@ -1673,7 +1673,7 @@
 		m->item().s_voidp = 0;
 		break;
 	    }
-	    int count = RARRAY(list)->len;
+	    int count = RARRAY_LEN(list);
 	    QRgb *rgb = new QRgb[count + 2];
 	    long i;
 	    for(i = 0; i < count; i++) {
@@ -1702,7 +1702,7 @@
       case Marshall::FromVALUE:
 	{
 	    VALUE list = *(m->var());
-	    if (TYPE(list) != T_ARRAY || RARRAY(list)->len != 2) {
+	    if (TYPE(list) != T_ARRAY || RARRAY_LEN(list) != 2) {
 		m->item().s_voidp = 0;
 		break;
 	    }
@@ -1770,7 +1770,7 @@
 		m->item().s_voidp = 0;
 		break;
 	    }
-	    int count = RARRAY(list)->len;
+	    int count = RARRAY_LEN(list);
 	    ItemList *cpplist = new ItemList;
 	    long i;
 	    for(i = 0; i < count; i++) {
diff -urN kdebindings-3.5.10-orig/qtruby/rubylib/qtruby/Qt.cpp kdebindings-3.5.10/qtruby/rubylib/qtruby/Qt.cpp
--- kdebindings-3.5.10-orig/qtruby/rubylib/qtruby/Qt.cpp	2009-07-02 18:37:40 +0400
+++ kdebindings-3.5.10/qtruby/rubylib/qtruby/Qt.cpp	2009-07-02 20:11:46 +0400
@@ -110,7 +110,6 @@
 };
 
 #define logger logger_backend
-void rb_str_catf(VALUE self, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
 
 static VALUE (*_new_kde)(int, VALUE *, VALUE) = 0;
 static VALUE (*_kconfigskeletonitem_immutable)(VALUE) = 0;
@@ -820,19 +819,6 @@
     }
 };
 
-void rb_str_catf(VALUE self, const char *format, ...) 
-{
-    va_list ap;
-    va_start(ap, format);
-    char *p = 0;
-    int len;
-    if (len = vasprintf(&p, format, ap), len != -1) {
-	rb_str_cat(self, p, len);
-	free(p);
-    }
-    va_end(ap);
-}
-
 extern "C" {
 
 static VALUE
@@ -1177,7 +1163,7 @@
 	// Start with #<Qt::HBoxLayout:0x30139030> from the original inspect() call
 	// Drop the closing '>'
 	VALUE inspect_str = rb_call_super(0, 0);	
-	rb_str_resize(inspect_str, RSTRING(inspect_str)->len - 1);
+	rb_str_resize(inspect_str, RSTRING_LEN(inspect_str) - 1);
 	
 	smokeruby_object * o = 0;
     Data_Get_Struct(self, smokeruby_object, o);	
@@ -1220,7 +1206,7 @@
 	// Start with #<Qt::HBoxLayout:0x30139030>
 	// Drop the closing '>'
 	VALUE inspect_str = rb_funcall(self, rb_intern("to_s"), 0, 0);	
-	rb_str_resize(inspect_str, RSTRING(inspect_str)->len - 1);
+	rb_str_resize(inspect_str, RSTRING_LEN(inspect_str) - 1);
 	rb_funcall(pp, rb_intern("text"), 1, inspect_str);
 	rb_funcall(pp, rb_intern("breakable"), 0);
 	
@@ -1236,7 +1222,7 @@
 		VALUE obj = getPointerObject(qobject->parent());
 		if (obj != Qnil) {
 			VALUE parent_inspect_str = rb_funcall(obj, rb_intern("to_s"), 0, 0);	
-			rb_str_resize(parent_inspect_str, RSTRING(parent_inspect_str)->len - 1);
+			rb_str_resize(parent_inspect_str, RSTRING_LEN(parent_inspect_str) - 1);
 			parentInspectString = StringValuePtr(parent_inspect_str);
 		} else {
 			parentInspectString.sprintf("#<%s:0x0", qobject->parent()->className());
@@ -1382,7 +1368,7 @@
     	return *(c.var());
 	} else if (	argc == 1 
 				&& TYPE(argv[0]) == T_ARRAY
-				&& RARRAY(argv[0])->len > 0
+				&& RARRAY_LEN(argv[0]) > 0
 				&& TYPE(rb_ary_entry(argv[0], 0)) != T_STRING )
 	{
 		_current_method = new_qvariant_qlist;
@@ -1741,7 +1727,7 @@
 		VALUE * local_argv = (VALUE *) calloc(argc + 1, sizeof(VALUE));
 		VALUE temp = rb_ary_dup(argv[0]);
 		rb_ary_unshift(temp, rb_gv_get("$0"));
-		local_argv[0] = INT2NUM(RARRAY(temp)->len);
+		local_argv[0] = INT2NUM(RARRAY_LEN(temp));
 		local_argv[1] = temp;
 		result = new_qt(2, local_argv, klass);
 		free(local_argv);
@@ -1772,7 +1758,7 @@
 VALUE
 getmetainfo(VALUE self, int &offset, int &index)
 {
-    const char * signalname = rb_id2name(rb_frame_last_func());
+    const char * signalname = rb_id2name(rb_frame_this_func());
     VALUE metaObject_value = rb_funcall(qt_internal_module, rb_intern("getMetaObject"), 1, self);
 
     smokeruby_object *ometa = value_obj_info(metaObject_value);
@@ -1862,7 +1848,7 @@
     // Now, I need to find out if this means me
     int index;
     char *slotname;
-    bool isSignal = qstrcmp(rb_id2name(rb_frame_last_func()), "qt_emit") == 0;
+    bool isSignal = qstrcmp(rb_id2name(rb_frame_this_func()), "qt_emit") == 0;
     VALUE mocArgs = getslotinfo(self, id, slotname, index, isSignal);
     if(mocArgs == Qnil) {
 		// No ruby slot/signal found, assume the target is a C++ one
@@ -2009,7 +1995,7 @@
 		return Qnil;
 	}
 	QByteArray * dataArray = (QByteArray*) o->ptr;
-	dataArray->setRawData(StringValuePtr(data), RSTRING(data)->len);
+	dataArray->setRawData(StringValuePtr(data), RSTRING_LEN(data));
 	return self;
 }
 
@@ -2195,7 +2181,7 @@
     m->name = new char[strlen(name) + 1];	// this too
     strcpy((char*)m->name, name);
     m->parameters = 0;
-    m->count = RARRAY(params)->len;
+    m->count = RARRAY_LEN(params);
 
     if (m->count > 0) {
 	m->parameters = new QUParameter[m->count];
@@ -2213,7 +2199,7 @@
 static VALUE
 make_QMetaData_tbl(VALUE /*self*/, VALUE list)
 {
-    long count = RARRAY(list)->len;
+    long count = RARRAY_LEN(list);
     QMetaData *m = new QMetaData[count];
 
     for (long i = 0; i < count; i++) {
@@ -2281,7 +2267,7 @@
 static VALUE
 add_signal_methods(VALUE self, VALUE klass, VALUE signalNames)
 {
-	for (long index = 0; index < RARRAY(signalNames)->len; index++) {
+	for (long index = 0; index < RARRAY_LEN(signalNames); index++) {
 		VALUE signal = rb_ary_entry(signalNames, index);
 		rb_define_method(klass, StringValuePtr(signal), (VALUE (*) (...)) qt_signal, -1);
 	}
@@ -2597,7 +2583,7 @@
 {
     VALUE errmsg = rb_str_new2("");
     if(rmeths != Qnil) {
-	int count = RARRAY(rmeths)->len;
+	int count = RARRAY_LEN(rmeths);
         for(int i = 0; i < count; i++) {
 	    rb_str_catf(errmsg, "\t");
 	    int id = NUM2INT(rb_ary_entry(rmeths, i));
openSUSE Build Service is sponsored by