[education/rkward] rkward: bool/int cleanup

Thomas Friedrichsmeier null at kde.org
Mon Mar 28 16:38:18 BST 2022


Git commit 9e8866ad60083d744ce11c4107a1b95ac30f0eb5 by Thomas Friedrichsmeier.
Committed on 28/03/2022 at 15:37.
Pushed by tfry into branch 'master'.

bool/int cleanup

M  +1    -1    rkward/core/rkrownames.cpp
M  +1    -1    rkward/rbackend/rkrbackend.cpp
M  +1    -1    rkward/rbackend/rksessionvars.cpp
M  +2    -3    rkward/scriptbackends/qtscriptbackend.cpp

https://invent.kde.org/education/rkward/commit/9e8866ad60083d744ce11c4107a1b95ac30f0eb5

diff --git a/rkward/core/rkrownames.cpp b/rkward/core/rkrownames.cpp
index 65dc7b06..62996634 100644
--- a/rkward/core/rkrownames.cpp
+++ b/rkward/core/rkrownames.cpp
@@ -139,7 +139,7 @@ bool RKRowNames::makeUnique (QString *text, bool non_sequentials_only) {
 
 	if (!check_duplicates) return true;
 
-	bool from_index = 0;
+	int from_index = 0;
 	if (non_sequentials_only) from_index = is_sequential_up_to_row + 1;
 
 	QString dummy = *text;
diff --git a/rkward/rbackend/rkrbackend.cpp b/rkward/rbackend/rkrbackend.cpp
index 4fd5fefb..7ebe09e9 100644
--- a/rkward/rbackend/rkrbackend.cpp
+++ b/rkward/rbackend/rkrbackend.cpp
@@ -274,7 +274,7 @@ int RReadConsole (const char* prompt, unsigned char* buf, int buflen, int hist)
 	}
 	
 	if ((!RKRBackend::repl_status.browser_context) && (RKRBackend::repl_status.eval_depth == 0)) {
-		while (1) {
+		while (true) {
 			if (RKRBackend::repl_status.user_command_status == RKRBackend::RKReplStatus::NoUserCommand) {
 				RCommandProxy *command = RKRBackend::this_pointer->fetchNextCommand ();
 				if (!command) {
diff --git a/rkward/rbackend/rksessionvars.cpp b/rkward/rbackend/rksessionvars.cpp
index ed226b77..a860f631 100644
--- a/rkward/rbackend/rksessionvars.cpp
+++ b/rkward/rbackend/rksessionvars.cpp
@@ -77,7 +77,7 @@ quint32 RKSessionVars::parseVersionString (const QString &version, QString *suff
 	int pos = -1;
 	int opos = 0;
 	for (int i = 3; i >= 0; --i) {
-		while (1) {
+		while (true) {
 			++pos;
 			if (!(pos < version.size () && version[pos].isDigit ())) {
 				int val = version.midRef(opos, pos - opos).toInt();
diff --git a/rkward/scriptbackends/qtscriptbackend.cpp b/rkward/scriptbackends/qtscriptbackend.cpp
index a40079da..d8d84e6a 100644
--- a/rkward/scriptbackends/qtscriptbackend.cpp
+++ b/rkward/scriptbackends/qtscriptbackend.cpp
@@ -196,9 +196,8 @@ QVariant QtScriptBackendThread::getValue (const QString &identifier, const int h
 	RK_TRACE (PHP);
 
 	emit needData(identifier, hint);
-
 	QVariant ret;
-	while (1) {
+	while (true) {
 		if (killed) return QVariant ();
 
 		mutex.lock ();
@@ -296,7 +295,7 @@ void QtScriptBackendThread::run () {
 	emit commandDone("startup complete");
 
 	QString command;
-	while (1) {
+	while (true) {
 		if (killed) return;
 		if (sleeping) {
 			sleep_mutex.lock ();


More information about the rkward-tracker mailing list