From 33c0dd0d8510c27678f230b9c2799a7fe91324a0 Mon Sep 17 00:00:00 2001 From: Zihao Yu Date: Wed, 10 Jan 2024 23:48:00 +0800 Subject: [PATCH] am-tests,keyboard: fix comparison of char * The sign of char is implemention-defined. char is unsigned in RISC-V. --- tests/am-tests/src/tests/keyboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/am-tests/src/tests/keyboard.c b/tests/am-tests/src/tests/keyboard.c index 3439333..f9a1c0c 100644 --- a/tests/am-tests/src/tests/keyboard.c +++ b/tests/am-tests/src/tests/keyboard.c @@ -11,7 +11,7 @@ static void drain_keys() { if (has_uart) { while (1) { char ch = io_read(AM_UART_RX).data; - if (ch == -1) break; + if (ch == (char)-1) break; printf("Got (uart): %c (%d)\n", ch, ch & 0xff); } }