[rkward-cvs] SF.net SVN: rkward: [1037] trunk/rkward/rkward/core

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Jan 2 12:39:10 UTC 2007


Revision: 1037
          http://svn.sourceforge.net/rkward/?rev=1037&view=rev
Author:   tfry
Date:     2007-01-02 04:39:09 -0800 (Tue, 02 Jan 2007)

Log Message:
-----------
Fixes commanded by krazy source code checker

Modified Paths:
--------------
    trunk/rkward/rkward/core/rcontainerobject.h
    trunk/rkward/rkward/core/renvironmentobject.cpp
    trunk/rkward/rkward/core/renvironmentobject.h
    trunk/rkward/rkward/core/rkvariable.cpp
    trunk/rkward/rkward/core/robject.cpp
    trunk/rkward/rkward/core/robject.h
    trunk/rkward/rkward/core/robjectlist.cpp
    trunk/rkward/rkward/core/robjectlist.h

Modified: trunk/rkward/rkward/core/rcontainerobject.h
===================================================================
--- trunk/rkward/rkward/core/rcontainerobject.h	2007-01-02 04:49:38 UTC (rev 1036)
+++ trunk/rkward/rkward/core/rcontainerobject.h	2007-01-02 12:39:09 UTC (rev 1037)
@@ -52,13 +52,13 @@
 	
 	/** creates a new child. Right now only RKVariables (false, false), or data.frames (true, true), or unspecified containers (true, false) can be created.
 	API will likely change. The child is NOT created in the workspace. That's your resonsibility. All this function returns is a new RObject* of the given
-	type and with the name (if neccessary) changed to a legal value. TODO: checking for and changing illegal names is not yet implemented */
+	type and with the name (if necessary) changed to a legal value. TODO: checking for and changing illegal names is not yet implemented */
 	virtual RObject *createNewChild (const QString &name, RKEditor *creator=0, bool container=false, bool data_frame=false);
 
 	/** returns true, if there are no children in this container. Note: of course the object list may not be up to date! */
 	bool isEmpty () { return childmap.isEmpty (); };
 
-	/** given child_name, constructs a name which is as close as possible to the orginial but valid (i.e. not alreay in use, not contaning illegal characters */
+	/** given child_name, constructs a name which is as close as possible to the orginial but valid (i.e. not already in use, not contaning illegal characters */
 	virtual QString validizeName (const QString &child_name, bool unique=true);
 
 	/** reimplemented from RObject to actually search for the object */

Modified: trunk/rkward/rkward/core/renvironmentobject.cpp
===================================================================
--- trunk/rkward/rkward/core/renvironmentobject.cpp	2007-01-02 04:49:38 UTC (rev 1036)
+++ trunk/rkward/rkward/core/renvironmentobject.cpp	2007-01-02 12:39:09 UTC (rev 1037)
@@ -58,9 +58,9 @@
 /* Some items are placed outside of their native namespace. E.g. in package:boot item "motor". It can be retrieved using as.environment ("package:boot")$motor. This is extremly ugly. We need to give them (and only them) this special treatment. */
 // TODO: hopefully one day operator "::" will work even in those cases. So check back later, and remove after a sufficient amount of backwards compatibility time
 		if ((type & PackageEnv) && (!misplaced)) return (namespace_name + "::" + RObject::rQuote (short_child_name));
-		return (getFullName () + "$" + RObject::rQuote (short_child_name));
+		return (getFullName () + '$' + RObject::rQuote (short_child_name));
 	}
-	return (name + "$" + short_child_name);
+	return (name + '$' + short_child_name);
 }
 
 QString REnvironmentObject::makeChildBaseName (const QString &short_child_name) {
@@ -69,7 +69,7 @@
 	if (type & ToplevelEnv) {
 		return (short_child_name);
 	}
-	return (name + "$" + short_child_name);
+	return (name + '$' + short_child_name);
 }
 
 void REnvironmentObject::writeMetaData (RCommandChain *chain) {
@@ -85,7 +85,7 @@
 	if (type & GlobalEnv) options = ", envlevel=-1";	// in the .GlobalEnv recurse one more level
 	if (type & ToplevelEnv) options.append (", namespacename=" + rQuote (namespace_name));
 
-	RCommand *command = new RCommand (".rk.get.structure (" + getFullName () + ", " + rQuote (getShortName ()) + options + ")", RCommand::App | RCommand::Sync | RCommand::GetStructuredData, QString::null, this, ROBJECT_UDPATE_STRUCTURE_COMMAND);
+	RCommand *command = new RCommand (".rk.get.structure (" + getFullName () + ", " + rQuote (getShortName ()) + options + ')', RCommand::App | RCommand::Sync | RCommand::GetStructuredData, QString::null, this, ROBJECT_UDPATE_STRUCTURE_COMMAND);
 	RKGlobals::rInterface ()->issueCommand (command, chain);
 }
 
@@ -133,11 +133,11 @@
 QString REnvironmentObject::renameChildCommand (RObject *object, const QString &new_name) {
 	RK_TRACE (OBJECTS);
 
-	return (makeChildName (new_name) + " <- " + object->getFullName () + "\n" + removeChildCommand (object));
+	return (makeChildName (new_name) + " <- " + object->getFullName () + '\n' + removeChildCommand (object));
 }
 
 QString REnvironmentObject::removeChildCommand (RObject *object) {
 	RK_TRACE (OBJECTS);
 
-	return ("remove (" + object->getFullName () + ")");
+	return ("remove (" + object->getFullName () + ')');
 }

Modified: trunk/rkward/rkward/core/renvironmentobject.h
===================================================================
--- trunk/rkward/rkward/core/renvironmentobject.h	2007-01-02 04:49:38 UTC (rev 1036)
+++ trunk/rkward/rkward/core/renvironmentobject.h	2007-01-02 12:39:09 UTC (rev 1037)
@@ -23,7 +23,7 @@
 class RCommandChain;
 
 /**
-This class roughly corresponds to an enviroment in R. It keeps a list of all objects in that environment.
+This class roughly corresponds to an environment in R. It keeps a list of all objects in that environment.
 
 @author Thomas Friedrichsmeier
 */

Modified: trunk/rkward/rkward/core/rkvariable.cpp
===================================================================
--- trunk/rkward/rkward/core/rkvariable.cpp	2007-01-02 04:49:38 UTC (rev 1036)
+++ trunk/rkward/rkward/core/rkvariable.cpp	2007-01-02 12:39:09 UTC (rev 1037)
@@ -249,7 +249,7 @@
 	RK_TRACE (OBJECTS);
 	RK_ASSERT (myData ());
 
-	RKGlobals::rInterface ()->issueCommand (".rk.get.vector.data (" + getFullName () + ")", RCommand::App | RCommand::Sync | RCommand::GetStructuredData, QString::null, this, GET_DATA_COMMAND, chain);
+	RKGlobals::rInterface ()->issueCommand (".rk.get.vector.data (" + getFullName () + ')', RCommand::App | RCommand::Sync | RCommand::GetStructuredData, QString::null, this, GET_DATA_COMMAND, chain);
 }
 
 // virtual
@@ -314,7 +314,7 @@
 	RK_TRACE (OBJECTS);
 
 	if (myData ()->invalid_fields[row]) {
-		RKGlobals::rInterface ()->issueCommand (".rk.set.invalid.field (" + getFullName () + ", " + QString::number (row+1) + ", " + rQuote (*(myData ()->invalid_fields[row])) + ")", RCommand::App | RCommand::Sync, QString::null, 0,0, chain);
+		RKGlobals::rInterface ()->issueCommand (".rk.set.invalid.field (" + getFullName () + ", " + QString::number (row+1) + ", " + rQuote (*(myData ()->invalid_fields[row])) + ')', RCommand::App | RCommand::Sync, QString::null, 0,0, chain);
 	} else {
 		RKGlobals::rInterface ()->issueCommand (".rk.set.invalid.field (" + getFullName () + ", " + QString::number (row+1) + ", NULL)", RCommand::App | RCommand::Sync, QString::null, 0,0, chain);
 	}
@@ -327,7 +327,7 @@
 
 	// TODO: try to sync in correct storage mode
 	if (from_row == to_row) {
-		RKGlobals::rInterface ()->issueCommand (getFullName () + "[" + QString::number (from_row+1) + "] <- " + getRText (from_row), RCommand::App | RCommand::Sync, QString::null, 0,0, chain);
+		RKGlobals::rInterface ()->issueCommand (getFullName () + '[' + QString::number (from_row+1) + "] <- " + getRText (from_row), RCommand::App | RCommand::Sync, QString::null, 0,0, chain);
 		if (myData ()->cell_states[from_row] & RKVarEditData::UnsyncedInvalidState) writeInvalidField (from_row, chain);
 	} else {
 		QString data_string = "c (";
@@ -340,7 +340,7 @@
 			if (myData ()->cell_states[row] & RKVarEditData::UnsyncedInvalidState) writeInvalidField (row, chain);
 		}
 		data_string.append (")");
-		RKGlobals::rInterface ()->issueCommand (getFullName () + "[" + QString::number (from_row + 1) + ":" + QString::number (to_row + 1) + "] <- " + data_string, RCommand::App | RCommand::Sync, QString::null, 0,0, chain);
+		RKGlobals::rInterface ()->issueCommand (getFullName () + '[' + QString::number (from_row + 1) + ':' + QString::number (to_row + 1) + "] <- " + data_string, RCommand::App | RCommand::Sync, QString::null, 0,0, chain);
 	}
 
 	ChangeSet *set = new ChangeSet;
@@ -797,7 +797,7 @@
 		
 		return level_string;
 	} else {
-		return QString::null;
+		return QString ();
 	}
 }
 

Modified: trunk/rkward/rkward/core/robject.cpp
===================================================================
--- trunk/rkward/rkward/core/robject.cpp	2007-01-02 04:49:38 UTC (rev 1036)
+++ trunk/rkward/rkward/core/robject.cpp	2007-01-02 12:39:09 UTC (rev 1037)
@@ -95,7 +95,7 @@
 			return (it.data ());
 		}
 	}
-	return QString::null;
+	return QString ();
 }
 
 QString RObject::getDescription () {
@@ -103,7 +103,7 @@
 	if (meta_map) {
 		RObject::MetaMap::iterator it;
 		if ((it = meta_map->find ("label")) != meta_map->end ()) {
-			return (getShortName () + " (" + it.data () + ")");
+			return (getShortName () + " (" + it.data () + ')');
 		}
 	}
 	return getShortName ();;
@@ -123,7 +123,7 @@
 
 	if (isType (Function)) {
 		ret.append (i18n ("Function"));
-		ret.append ("<br><b>" + i18n ("Usage: ") + " </b>" + getShortName ().ESCS + "(" + static_cast<RFunctionObject *> (this)->printArgs ().ESCS + ")");
+		ret.append ("<br><b>" + i18n ("Usage: ") + " </b>" + getShortName ().ESCS + '(' + static_cast<RFunctionObject *> (this)->printArgs ().ESCS + ')');
 	} else if (isType (DataFrame)) {
 		ret.append (i18n ("Data frame"));
 	} else if (isType (Array)) {
@@ -240,7 +240,7 @@
 		if (it != meta_map->constBegin ()) {
 			command_string.append (", ");
 		}
-		command_string.append (rQuote (it.key ()) + "=" + rQuote (it.data ()));
+		command_string.append (rQuote (it.key ()) + '=' + rQuote (it.data ()));
 	}
 	command_string.append ("))");
 	
@@ -253,7 +253,7 @@
 void RObject::updateFromR (RCommandChain *chain) {
 	RK_TRACE (OBJECTS);
 
-	RCommand *command = new RCommand (".rk.get.structure (" + getFullName () + ", " + rQuote (getShortName ()) + ")", RCommand::App | RCommand::Sync | RCommand::GetStructuredData, QString::null, this, ROBJECT_UDPATE_STRUCTURE_COMMAND);
+	RCommand *command = new RCommand (".rk.get.structure (" + getFullName () + ", " + rQuote (getShortName ()) + ')', RCommand::App | RCommand::Sync | RCommand::GetStructuredData, QString::null, this, ROBJECT_UDPATE_STRUCTURE_COMMAND);
 	RKGlobals::rInterface ()->issueCommand (command, chain);
 }
 

Modified: trunk/rkward/rkward/core/robject.h
===================================================================
--- trunk/rkward/rkward/core/robject.h	2007-01-02 04:49:38 UTC (rev 1036)
+++ trunk/rkward/rkward/core/robject.h	2007-01-02 12:39:09 UTC (rev 1037)
@@ -179,7 +179,7 @@
 
 /** try to find the object as a child object of this object. Default implementation always returns 0, as this is not a container
 @param name of the object (relative to this object)
- at param is_canonified the object name may usually have to be canonified. Since this function may be called recursively, canonification may already have occured on a higher level. In this case the argument is set to true to avoid some duplicate work. When calling from outside always leave the default false.
+ at param is_canonified the object name may usually have to be canonified. Since this function may be called recursively, canonification may already have occurred on a higher level. In this case the argument is set to true to avoid some duplicate work. When calling from outside always leave the default false.
 @returns a pointer to the object (if found) or 0 if not found */
 	virtual RObject *findObject (const QString &name, bool is_canonified=false);
 protected:

Modified: trunk/rkward/rkward/core/robjectlist.cpp
===================================================================
--- trunk/rkward/rkward/core/robjectlist.cpp	2007-01-02 04:49:38 UTC (rev 1036)
+++ trunk/rkward/rkward/core/robjectlist.cpp	2007-01-02 12:39:09 UTC (rev 1037)
@@ -254,13 +254,13 @@
 QString RObjectList::renameChildCommand (RObject *object, const QString &new_name) {
 	RK_TRACE (OBJECTS);
 
-	return (makeChildName (new_name, false) + " <- " + object->getFullName () + "\n" + removeChildCommand (object));
+	return (makeChildName (new_name, false) + " <- " + object->getFullName () + '\n' + removeChildCommand (object));
 }
 
 QString RObjectList::removeChildCommand (RObject *object) {
 	RK_TRACE (OBJECTS);
 
-	return ("remove (" + object->getFullName () + ")");
+	return ("remove (" + object->getFullName () + ')');
 }
 
 void RObjectList::removeChild (RObject *object, bool removed_in_workspace) {

Modified: trunk/rkward/rkward/core/robjectlist.h
===================================================================
--- trunk/rkward/rkward/core/robjectlist.h	2007-01-02 04:49:38 UTC (rev 1036)
+++ trunk/rkward/rkward/core/robjectlist.h	2007-01-02 12:39:09 UTC (rev 1037)
@@ -47,7 +47,7 @@
 
 	void updateFromR (RCommandChain *chain);
 	
-	QString getFullName () { return QString::null; };
+	QString getFullName () { return QString (); };
 	QString makeChildName (const QString &short_child_name, bool) { return short_child_name; };
 	/** reimplemented from RContainerObject: do nothing. The object-list has no meta data. */
 	void writeMetaData (RCommandChain *) {};


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list