py/repl: Change mp_uint_t to size_t in repl helpers.

This commit is contained in:
Damien George
2017-07-04 23:44:54 +10:00
parent 7bd10c1ffe
commit e66fd56852
4 changed files with 14 additions and 14 deletions

View File

@@ -188,17 +188,17 @@ int readline_process_char(int c) {
} else if (c == 9) {
// tab magic
const char *compl_str;
mp_uint_t compl_len = mp_repl_autocomplete(rl.line->buf + rl.orig_line_len, rl.cursor_pos - rl.orig_line_len, &mp_plat_print, &compl_str);
size_t compl_len = mp_repl_autocomplete(rl.line->buf + rl.orig_line_len, rl.cursor_pos - rl.orig_line_len, &mp_plat_print, &compl_str);
if (compl_len == 0) {
// no match
} else if (compl_len == (mp_uint_t)(-1)) {
} else if (compl_len == (size_t)(-1)) {
// many matches
mp_hal_stdout_tx_str(rl.prompt);
mp_hal_stdout_tx_strn(rl.line->buf + rl.orig_line_len, rl.cursor_pos - rl.orig_line_len);
redraw_from_cursor = true;
} else {
// one match
for (mp_uint_t i = 0; i < compl_len; ++i) {
for (size_t i = 0; i < compl_len; ++i) {
vstr_ins_byte(rl.line, rl.cursor_pos + i, *compl_str++);
}
// set redraw parameters