diff --git a/litex/soc/software/bios/readline.c b/litex/soc/software/bios/readline.c index 48d8f1a6c..f507f1a65 100644 --- a/litex/soc/software/bios/readline.c +++ b/litex/soc/software/bios/readline.c @@ -150,10 +150,10 @@ void hist_init(void) } #endif -static void cread_add_char(char ichar, int insert, unsigned long *num, - unsigned long *eol_num, char *buf, unsigned long len) +static void cread_add_char(char ichar, int insert, unsigned int *num, + unsigned int *eol_num, char *buf, unsigned int len) { - unsigned long wlen; + unsigned int wlen; if (insert || *num == *eol_num) { if (*eol_num > len - 1) { @@ -186,9 +186,9 @@ static void cread_add_char(char ichar, int insert, unsigned long *num, int readline(char *buf, int len) { - unsigned long num = 0; - unsigned long eol_num = 0; - unsigned long wlen; + unsigned int num = 0; + unsigned int eol_num = 0; + unsigned int wlen; int insert = 1; char ichar; @@ -254,7 +254,7 @@ int readline(char *buf, int len) wlen = eol_num - num - 1; if (wlen) { memmove(&buf[num], &buf[num+1], wlen); - putnstr(buf + num, (int)wlen); + putnstr(buf + num, wlen); } getcmd_putch(' '); @@ -286,7 +286,7 @@ int readline(char *buf, int len) num--; memmove(buf + num, buf + num + 1, wlen); getcmd_putch(CTL_BACKSPACE); - putnstr(buf + num, (int)wlen); + putnstr(buf + num, wlen); getcmd_putch(' '); do { getcmd_putch(CTL_BACKSPACE); @@ -298,7 +298,7 @@ int readline(char *buf, int len) if (num < eol_num) { wlen = eol_num - num; memmove(buf + num, buf + num + 1, wlen); - putnstr(buf + num, (int)(wlen - 1)); + putnstr(buf + num, wlen - 1); getcmd_putch(' '); do { getcmd_putch(CTL_BACKSPACE); diff --git a/litex/soc/software/bios/readline.h b/litex/soc/software/bios/readline.h index f1284c5d1..290b2e2c0 100644 --- a/litex/soc/software/bios/readline.h +++ b/litex/soc/software/bios/readline.h @@ -72,7 +72,7 @@ struct esc_cmds { #define REFRESH_TO_EOL() { \ if (num < eol_num) { \ wlen = eol_num - num; \ - putnstr(buf + num, (int)wlen); \ + putnstr(buf + num, wlen); \ num = eol_num; \ } \ }