sources/interface.cpp

changeset 179
7fc34735178e
parent 156
ce66d7e374bf
child 181
e254398fcc7c
--- a/sources/interface.cpp	Wed Jan 27 12:38:00 2021 +0200
+++ b/sources/interface.cpp	Wed Jan 27 13:02:51 2021 +0200
@@ -90,7 +90,7 @@
 	}
 
 	int oldcursor = m_inputCursor;
-	m_inputCursor = clamp(m_inputCursor + delta, 0, m_inputHistory.size() - 1);
+	m_inputCursor = clamp(m_inputCursor + delta, 0, static_cast<int>(m_inputHistory.size() - 1));
 
 	if (m_inputCursor != oldcursor)
 	{
@@ -165,7 +165,7 @@
 	::refresh();
 	::timeout(0);
 	m_inputHistory.clear();
-	m_inputHistory << "";
+	m_inputHistory.push_back("");
 	m_outputLines.clear();
 	m_outputLines << ColoredLine();
 	m_session.setInterface(this);
@@ -389,7 +389,7 @@
 	{
 		mvhline(y, x, ' ', width);
 
-		if (i < m_playerNames.size())
+		if (i < static_cast<signed>(m_playerNames.size()))
 			renderColorline(y, x, width, m_playerNames[i], false);
 
 		y++;
@@ -1022,7 +1022,7 @@
 		ColoredLine coloredname;
 		coloredname.addString(name);
 		coloredname.finalize();
-		m_playerNames.append(coloredname);
+		m_playerNames.push_back(coloredname);
 	}
 
 	m_needNicklistRender = true;
@@ -1054,7 +1054,7 @@
 
 	StringList args = input.right(input.length() - 1).split(" ");
 	String command = args[0].toLowerCase();
-	args.remove_at(0);
+	args.erase(args.begin());
 
 	if (command == "connect")
 	{
@@ -1118,7 +1118,7 @@
 //
 void Interface::flushInput()
 {
-	m_inputHistory.insert(0, "");
+	m_inputHistory.insert(m_inputHistory.begin(), "");
 	m_inputCursor = 0;
 	m_needInputRender = true;
 }

mercurial