[apps] Fixed size_t / int comparison warnings.

Change-Id: I08bae0d687a52d708053c4279f68b42c5bb5d180
This commit is contained in:
Léa Saviot
2017-11-10 16:06:03 +01:00
committed by Romain Goyet
parent 42e6435973
commit 4194165217
4 changed files with 8 additions and 8 deletions

View File

@@ -229,7 +229,7 @@ bool ConsoleController::textFieldDidAbortEditing(TextField * textField, const ch
/* printText is called by the Python machine.
* The text argument is not always null-terminated. */
void ConsoleController::printText(const char * text, size_t length) {
int textCutIndex = firstNewLineCharIndex(text, length);
size_t textCutIndex = firstNewLineCharIndex(text, length);
// If there is no new line in text, just append it to the output accumulation
// buffer.
if (textCutIndex >= length) {
@@ -281,7 +281,7 @@ void ConsoleController::flushOutputAccumulationBufferToStore() {
void ConsoleController::appendTextToOutputAccumulationBuffer(const char * text, size_t length) {
int endOfAccumulatedText = strlen(m_outputAccumulationBuffer);
int spaceLeft = k_outputAccumulationBufferSize - endOfAccumulatedText;
if (spaceLeft > length) {
if (spaceLeft > (int)length) {
memcpy(&m_outputAccumulationBuffer[endOfAccumulatedText], text, length);
return;
}
@@ -296,8 +296,8 @@ void ConsoleController::emptyOutputAccumulationBuffer() {
}
}
int ConsoleController::firstNewLineCharIndex(const char * text, size_t length) {
int index = 0;
size_t ConsoleController::firstNewLineCharIndex(const char * text, size_t length) {
size_t index = 0;
while (index < length) {
if (text[index] == '\n') {
return index;