mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
Fix warnings about comparing different signedness
Some variables were declared as int while they are size_t. As we try to compare them to unsigned values, a warning was raised (comparison of integer expressions of different signedness).
This commit is contained in:
@@ -36,7 +36,7 @@ static inline KDColor TokenColor(mp_token_kind_t tokenKind) {
|
||||
return KDColorBlack;
|
||||
}
|
||||
|
||||
static inline int TokenLength(mp_lexer_t * lex) {
|
||||
static inline size_t TokenLength(mp_lexer_t * lex) {
|
||||
if (lex->tok_kind == MP_TOKEN_STRING) {
|
||||
return lex->vstr.len + 2;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ void PythonTextArea::ContentView::drawLine(KDContext * ctx, int line, const char
|
||||
* basis. This can work, however the MicroPython lexer won't accept a line
|
||||
* starting with a whitespace. So we're discarding leading whitespaces
|
||||
* beforehand. */
|
||||
int whitespaceOffset = 0;
|
||||
size_t whitespaceOffset = 0;
|
||||
while (text[whitespaceOffset] == ' ' && whitespaceOffset < length) {
|
||||
whitespaceOffset++;
|
||||
}
|
||||
@@ -130,8 +130,8 @@ void PythonTextArea::ContentView::drawLine(KDContext * ctx, int line, const char
|
||||
mp_lexer_t * lex = mp_lexer_new_from_str_len(0, text + whitespaceOffset, length - whitespaceOffset, 0);
|
||||
LOG_DRAW("Pop token %d\n", lex->tok_kind);
|
||||
|
||||
int tokenFrom = 0;
|
||||
int tokenLength = 0;
|
||||
size_t tokenFrom = 0;
|
||||
size_t tokenLength = 0;
|
||||
KDColor tokenColor = KDColorBlack;
|
||||
|
||||
while (lex->tok_kind != MP_TOKEN_NEWLINE && lex->tok_kind != MP_TOKEN_END) {
|
||||
|
||||
Reference in New Issue
Block a user