[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebindings/qtruby/rubylib/qtruby
From:       Richard Dale <Richard_Dale () tipitina ! demon ! co ! uk>
Date:       2006-12-04 16:11:39
Message-ID: 1165248699.599956.8231.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 610598 by rdale:

* Replace strcmp() calls with qstrcmp(), remove all instances of
  !strcmp(foo,bar) in conditions



 M  +1 -1      Qt.cpp  
 M  +20 -20    handlers.cpp  
 M  +2 -2      marshall_types.cpp  
 M  +2 -2      smokeruby.h  


--- trunk/KDE/kdebindings/qtruby/rubylib/qtruby/Qt.cpp #610597:610598
@@ -1412,7 +1412,7 @@
 		Smoke::Index i = o->smoke->methodMaps[meth].method;
 		i = -i;		// turn into ambiguousMethodList index
 		while (o->smoke->ambiguousMethodList[i] != 0) {
-			if (	strcmp(	o->smoke->types[o->smoke->argumentList[o->smoke->methods[o->smoke->ambiguousMethodList[i]].args \
+ 2]].name, +			if (	qstrcmp(	o->smoke->types[o->smoke->argumentList[o->smoke->methods[o->smoke->ambiguousMethodList[i]].args \
+ 2]].name,  "void*" ) == 0 )
 			{
 	    		Smoke::Method &m = o->smoke->methods[o->smoke->ambiguousMethodList[i]];
--- trunk/KDE/kdebindings/qtruby/rubylib/qtruby/handlers.cpp #610597:610598
@@ -254,11 +254,11 @@
 	unmapPointer(o, o->classId, 0);
 	object_count --;
 	
-	if (	strcmp(className, "QObject") == 0
-			|| strcmp(className, "QListBoxItem") == 0
-			|| strcmp(className, "QStyleSheetItem") == 0
-			|| strcmp(className, "QSqlCursor") == 0
-			|| strcmp(className, "QModelIndex") == 0 )
+	if (	qstrcmp(className, "QObject") == 0
+			|| qstrcmp(className, "QListBoxItem") == 0
+			|| qstrcmp(className, "QStyleSheetItem") == 0
+			|| qstrcmp(className, "QSqlCursor") == 0
+			|| qstrcmp(className, "QModelIndex") == 0 )
 	{
 		// Don't delete instances of these classes for now
 		free_smokeruby_object(o);
@@ -269,19 +269,19 @@
 			free_smokeruby_object(o);
 			return;
 		}
-//	} else if (strcmp(className, "QIconViewItem") == 0) {
+//	} else if (qstrcmp(className, "QIconViewItem") == 0) {
 //		Q3IconViewItem * item = (Q3IconViewItem *) o->ptr;
 //		if (item->iconView() != 0) {
 //			free_smokeruby_object(o);
 //			return;
 //		}
-//	} else if (strcmp(className, "QCheckListItem") == 0) {
+//	} else if (qstrcmp(className, "QCheckListItem") == 0) {
 //		Q3CheckListItem * item = (Q3CheckListItem *) o->ptr;
 //		if (item->parent() != 0 || item->listView() != 0) {
 //			free_smokeruby_object(o);
 //			return;
 //		}
-	} else if (strcmp(className, "QListWidgetItem") == 0) {
+	} else if (qstrcmp(className, "QListWidgetItem") == 0) {
 		QListWidgetItem * item = (QListWidgetItem *) o->ptr;
 		if (item->listWidget() != 0) {
 			free_smokeruby_object(o);
@@ -293,7 +293,7 @@
 			free_smokeruby_object(o);
 			return;
 		}
-//	} else if (strcmp(className, "QPopupMenu") == 0) {
+//	} else if (qstrcmp(className, "QPopupMenu") == 0) {
 //		Q3PopupMenu * item = (Q3PopupMenu *) o->ptr;
 //		if (item->parentWidget(false) != 0) {
 //			free_smokeruby_object(o);
@@ -566,7 +566,7 @@
 {
 	Smoke::Index *arg = smoke->argumentList + smoke->methods[meth].args + argidx;
 	SmokeType type = SmokeType(smoke, *arg);
-	if (type.name() && strcmp(type.name(), argtype) == 0) {
+	if (type.name() && qstrcmp(type.name(), argtype) == 0) {
 		return true;
 	}
 	return false;
@@ -777,9 +777,9 @@
 init_codec() {
 	VALUE temp = rb_gv_get("$KCODE");
 	KCODE = StringValuePtr(temp);
-	if (strcmp(KCODE, "EUC") == 0) {
+	if (qstrcmp(KCODE, "EUC") == 0) {
 		codec = QTextCodec::codecForName("eucJP");
-	} else if (strcmp(KCODE, "SJIS") == 0) {
+	} else if (qstrcmp(KCODE, "SJIS") == 0) {
 		codec = QTextCodec::codecForName("Shift-JIS");
 	}
 }
@@ -790,13 +790,13 @@
 		init_codec();
 	}
 	
-	if (strcmp(KCODE, "UTF8") == 0)
+	if (qstrcmp(KCODE, "UTF8") == 0)
 		return new QString(QString::fromUtf8(StringValuePtr(rstring), \
                RSTRING(rstring)->len));
-	else if (strcmp(KCODE, "EUC") == 0)
+	else if (qstrcmp(KCODE, "EUC") == 0)
 		return new QString(codec->toUnicode(StringValuePtr(rstring)));
-	else if (strcmp(KCODE, "SJIS") == 0)
+	else if (qstrcmp(KCODE, "SJIS") == 0)
 		return new QString(codec->toUnicode(StringValuePtr(rstring)));
-	else if(strcmp(KCODE, "NONE") == 0)
+	else if(qstrcmp(KCODE, "NONE") == 0)
 		return new QString(QString::fromLatin1(StringValuePtr(rstring)));
 
 	return new QString(QString::fromLocal8Bit(StringValuePtr(rstring), \
RSTRING(rstring)->len)); @@ -808,13 +808,13 @@
 		init_codec();
 	}
 	
-	if (strcmp(KCODE, "UTF8") == 0)
+	if (qstrcmp(KCODE, "UTF8") == 0)
 		return rb_str_new2(s->toUtf8());
-	else if (strcmp(KCODE, "EUC") == 0)
+	else if (qstrcmp(KCODE, "EUC") == 0)
 		return rb_str_new2(codec->fromUnicode(*s));
-	else if (strcmp(KCODE, "SJIS") == 0)
+	else if (qstrcmp(KCODE, "SJIS") == 0)
 		return rb_str_new2(codec->fromUnicode(*s));
-	else if (strcmp(KCODE, "NONE") == 0)
+	else if (qstrcmp(KCODE, "NONE") == 0)
 		return rb_str_new2(s->toLatin1());
 	else
 		return rb_str_new2(s->toLocal8Bit());
--- trunk/KDE/kdebindings/qtruby/rubylib/qtruby/marshall_types.cpp #610597:610598
@@ -287,7 +287,7 @@
 const char *
 MethodReturnValue::classname() 
 { 
-	return strcmp(MethodReturnValueBase::classname(), "QGlobalSpace") == 0 ? "" : \
MethodReturnValueBase::classname();  +	return \
qstrcmp(MethodReturnValueBase::classname(), "QGlobalSpace") == 0 ? "" : \
MethodReturnValueBase::classname();   }
 
 
@@ -454,7 +454,7 @@
 const char *
 MethodCall::classname() 
 { 
-	return strcmp(MethodCallBase::classname(), "QGlobalSpace") == 0 ? "" : \
MethodCallBase::classname();  +	return qstrcmp(MethodCallBase::classname(), \
"QGlobalSpace") == 0 ? "" : MethodCallBase::classname();   }
 
 SigSlotBase::SigSlotBase(VALUE args) : _cur(-1), _called(false) 
--- trunk/KDE/kdebindings/qtruby/rubylib/qtruby/smokeruby.h #610597:610598
@@ -64,7 +64,7 @@
     bool operator ==(const SmokeType &b) const {
 	const SmokeType &a = *this;
 	if(a.name() == b.name()) return true;
-	if(a.name() && b.name() && !strcmp(a.name(), b.name()))
+	if(a.name() && b.name() && qstrcmp(a.name(), b.name()) == 0)
 	    return true;
 	return false;
     }
@@ -98,7 +98,7 @@
     bool operator ==(const SmokeClass &b) const {
 	const SmokeClass &a = *this;
 	if(a.className() == b.className()) return true;
-	if(a.className() && b.className() && !strcmp(a.className(), b.className()))
+	if(a.className() && b.className() && qstrcmp(a.className(), b.className()) == 0)
 	    return true;
 	return false;
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic