[rkward-cvs] [rkward] rkward: Guard "#warning" directives for better cross-compiler compatibility.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Fri Dec 19 21:15:47 UTC 2014


Git commit b83417e54d73a76cf587b7273149dbbbb94dafcf by Thomas Friedrichsmeier.
Committed on 19/12/2014 at 21:14.
Pushed by tfry into branch 'master'.

Guard "#warning" directives for better cross-compiler compatibility.

M  +3    -1    rkward/core/rcontainerobject.cpp
M  +6    -2    rkward/core/robject.cpp
M  +3    -1    rkward/dataeditor/rkeditordataframe.cpp
M  +0    -2    rkward/misc/rkstandardicons.cpp
M  +3    -1    rkward/plugin/rkcomponentproperties.cpp
M  +3    -1    rkward/plugin/rktabpage.cpp
M  +3    -1    rkward/rbackend/rkrbackendprotocol_backend.cpp
M  +2    -1    rkward/rbackend/rkreventloop.cpp
M  +3    -1    rkward/rbackend/rkstructuregetter.cpp
M  +3    -1    rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
M  +3    -1    rkward/rkwardapplication.cpp

http://commits.kde.org/rkward/b83417e54d73a76cf587b7273149dbbbb94dafcf

diff --git a/rkward/core/rcontainerobject.cpp b/rkward/core/rcontainerobject.cpp
index 3e5f1dc..b0873b2 100644
--- a/rkward/core/rcontainerobject.cpp
+++ b/rkward/core/rcontainerobject.cpp
@@ -293,7 +293,9 @@ RObject *RContainerObject::createPendingChild (const QString &name, int position
 	RK_TRACE (OBJECTS);
 	RK_ASSERT (isType (GlobalEnv) || isInGlobalEnv ());
 
-#warning TODO validize name
+#ifdef __GNUC__
+#	warning TODO validize name
+#endif
 	RObject *ret;
 	if (container) {
 		ret = new RContainerObject (this, name);
diff --git a/rkward/core/robject.cpp b/rkward/core/robject.cpp
index 44104cd..87fad6e 100644
--- a/rkward/core/robject.cpp
+++ b/rkward/core/robject.cpp
@@ -227,7 +227,9 @@ void RObject::updateFromR (RCommandChain *chain) {
 
 	RCommand *command;
 	if (parentObject () == RObjectList::getGlobalEnv ()) {
-#warning TODO: find a generic solution
+#ifdef __GNUC__
+#	warning TODO: find a generic solution
+#endif
 // We handle objects directly in .GlobalEnv differently. That's to avoid forcing promises, when addressing the object directly. In the long run, .rk.get.structure should be reworked to simply not need the value-argument in any case.
 		 command = new RCommand (".rk.get.structure.global (" + rQuote (getShortName ()) + ')', RCommand::App | RCommand::Sync | RCommand::GetStructuredData, QString::null, this, ROBJECT_UDPATE_STRUCTURE_COMMAND);
 	} else {
@@ -465,7 +467,9 @@ bool RObject::updateDimensions (RData *new_data) {
 				return (true);
 			}
 		} else {
-#warning TODO: ugly hack. Should be moved to RKVariable, somehow.
+#ifdef __GNUC__
+#	warning TODO: ugly hack. Should be moved to RKVariable, somehow.
+#endif
 			if (type & Variable) static_cast<RKVariable*> (this)->extendToLength (new_dimensions[0]);
 
 			dimensions = new_dimensions;
diff --git a/rkward/dataeditor/rkeditordataframe.cpp b/rkward/dataeditor/rkeditordataframe.cpp
index f69b5ba..f68d27b 100644
--- a/rkward/dataeditor/rkeditordataframe.cpp
+++ b/rkward/dataeditor/rkeditordataframe.cpp
@@ -125,7 +125,9 @@ void RKEditorDataFrame::rCommandDone (RCommand *command) {
 void RKEditorDataFrame::restoreObject (RObject *object) {
 	RK_TRACE (EDITOR);
 
-#warning TODO: this interface should be moved to the model for good.
+#ifdef __GNUC__
+#	warning TODO: this interface should be moved to the model for good.
+#endif
 	datamodel->restoreObject (object, 0);
 }
 
diff --git a/rkward/misc/rkstandardicons.cpp b/rkward/misc/rkstandardicons.cpp
index c78d925..5e490fa 100644
--- a/rkward/misc/rkstandardicons.cpp
+++ b/rkward/misc/rkstandardicons.cpp
@@ -76,8 +76,6 @@ void RKStandardIcons::initIcons () {
 	icons[ActionDetachWindow] = KIcon ("view-fullscreen");
 	icons[ActionAttachWindow] = KIcon ("view-restore");
 
-#warning TODO add further action icons here
-
 	// objects
 	icons[ObjectList] = QIcon (rkward_icon_base + "list.png");
 	icons[ObjectFunction] = QIcon (rkward_icon_base + "function.png");
diff --git a/rkward/plugin/rkcomponentproperties.cpp b/rkward/plugin/rkcomponentproperties.cpp
index 75dc514..017db0a 100644
--- a/rkward/plugin/rkcomponentproperties.cpp
+++ b/rkward/plugin/rkcomponentproperties.cpp
@@ -142,7 +142,9 @@ void RKComponentPropertyBase::connectToGovernor (RKComponentPropertyBase *govern
 
 void RKComponentPropertyBase::governorValueChanged (RKComponentPropertyBase *property) {
 	RK_TRACE (PLUGIN);
-#warning TOOD: connected value should be stored as qvariant
+#ifdef __GNUC__
+#	warning TOOD: connected value should be stored as qvariant
+#endif
 	setValue (property->value (governor_modifier).toString ());
 }
 
diff --git a/rkward/plugin/rktabpage.cpp b/rkward/plugin/rktabpage.cpp
index a769701..3610364 100644
--- a/rkward/plugin/rktabpage.cpp
+++ b/rkward/plugin/rktabpage.cpp
@@ -58,7 +58,9 @@ void RKTabPage::visibleEnabledChanged (RKComponentPropertyBase *property) {
 	if (property == visibility_property) {
 		if (visibility_property->boolValue ()) {
 			if (!inserted) {
-#warning this may not be reliable, if an earlier page is invisible as well
+#ifdef __GNUC__
+#	warning this may not be reliable, if an earlier page is invisible as well
+#endif
 				tabbook->insertTab (index, this, label);
 				inserted = true;
 			}
diff --git a/rkward/rbackend/rkrbackendprotocol_backend.cpp b/rkward/rbackend/rkrbackendprotocol_backend.cpp
index 47309ce..da80864 100644
--- a/rkward/rbackend/rkrbackendprotocol_backend.cpp
+++ b/rkward/rbackend/rkrbackendprotocol_backend.cpp
@@ -85,7 +85,9 @@
 			} else if (args[i].startsWith ("--server-name")) {
 				servername = args[i].section ('=', 1);
 			} else if (args[i].startsWith ("--data-dir")) {
-#warning What about paths with spaces?!
+#ifdef __GNUC__
+#	warning What about paths with spaces?!
+#endif
 				data_dir = args[i].section ('=', 1);
 			} else if (args[i].startsWith ("--locale-dir")) {
 				locale_dir = args[i].section ('=', 1);
diff --git a/rkward/rbackend/rkreventloop.cpp b/rkward/rbackend/rkreventloop.cpp
index e15d270..f6faf01 100644
--- a/rkward/rbackend/rkreventloop.cpp
+++ b/rkward/rbackend/rkreventloop.cpp
@@ -42,7 +42,8 @@ static void processX11EventsWorker (void *) {
 	/* This seems to be needed to make Rcmdr react to events. Has this always been the case? It was commented out for a long time, without anybody noticing. */
 	R_PolledEvents ();
 #else
-#warning TODO: correct?
+	// TODO: correct?
+	// NOTE: We essentially process events while waiting. Perhaps we should simply use the equivalent of "try(sleep(0.01))", instead.
 	R_ProcessEvents();
 #endif
 
diff --git a/rkward/rbackend/rkstructuregetter.cpp b/rkward/rbackend/rkstructuregetter.cpp
index 6b225d3..43a8d60 100644
--- a/rkward/rbackend/rkstructuregetter.cpp
+++ b/rkward/rbackend/rkstructuregetter.cpp
@@ -226,7 +226,9 @@ void RKStructureGetter::getStructureWorker (SEXP val, const QString &name, int a
 
 	// basic classification
 	for (int i = classes.size () - 1; i >= 0; --i) {
-#warning: Using is.data.frame() may be more reliable (would need to be called only on List-objects, thus no major performance hit)
+#ifdef __GNUC__
+#	warning: Using is.data.frame() may be more reliable (would need to be called only on List-objects, thus no major performance hit)
+#endif
 		if (classes[i] == "data.frame") type |= RObject::DataFrame;
 	}
 
diff --git a/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp b/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
index ee09bf3..e98002d 100644
--- a/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
+++ b/rkward/rbackend/rkwarddevice/rkgraphicsdevice_frontendtransmitter.cpp
@@ -146,7 +146,9 @@ static QFont readFont (QDataStream &instream) {
 	quint8 fontface;
 	QString fontfamily;
 	instream >> cex >> ps >> lineheight >> fontface >> fontfamily;
-#warning TODO deal with line-height
+#ifdef __GNUC__
+#	warning TODO deal with line-height
+#endif
 	QFont ret (fontfamily);
 	if (fontface == 2 || fontface == 4) ret.setWeight (QFont::Bold);
 	if (fontface == 3 || fontface == 4) ret.setItalic (true);
diff --git a/rkward/rkwardapplication.cpp b/rkward/rkwardapplication.cpp
index 6495a50..cb3c602 100644
--- a/rkward/rkwardapplication.cpp
+++ b/rkward/rkwardapplication.cpp
@@ -39,7 +39,9 @@ Atom wm_name_property;
 
 #include "debug.h"
 
-#warning TODO: We could really use the detection logic from windows for x11, too. It seems much easier.
+#ifdef __GNUC__
+#	warning TODO: We could really use the detection logic from windows for x11, too. It seems much easier.
+#endif
 #ifdef Q_WS_WIN
 #include <stdio.h>
 namespace RKWardApplicationPrivate {





More information about the rkward-tracker mailing list