software/bios/readline: Fix warnings if char is signed
When building with --cpu-type=mor1kx: litex/soc/software/bios/readline.c: In function 'readline': litex/soc/software/bios/readline.c:271:3: warning: case label value exceeds maximum value for type [-Wswitch-outside-range] 271 | case KEY_END: | ^~~~ litex/soc/software/bios/readline.c:297:3: warning: case label value exceeds maximum value for type [-Wswitch-outside-range] 297 | case KEY_DEL: | ^~~~ litex/soc/software/bios/readline.c:281:3: warning: case label value exceeds maximum value for type [-Wswitch-outside-range] 281 | case DEL: | ^~~~ The C standard does not specify the signedness of "char", hence this depends on the implementation. On e.g. RISC-V, "char" is unsigned, but on OpenRISC, it is signed. Fix this by making the "ichar" variable explicitly unsigned. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:
parent
5430c1455e
commit
8e4202ced1
|
@ -190,7 +190,7 @@ int readline(char *buf, int len)
|
|||
unsigned int eol_num = 0;
|
||||
unsigned int wlen;
|
||||
int insert = 1;
|
||||
char ichar;
|
||||
unsigned char ichar;
|
||||
|
||||
#ifndef TERM_NO_COMPLETE
|
||||
char tmp;
|
||||
|
|
Loading…
Reference in New Issue