From 8f5b2273c6a200044e95ccc2db72674e3c50ede1 Mon Sep 17 00:00:00 2001 From: Alexey Gladkov Date: Tue, 17 Sep 2024 11:56:51 +0200 Subject: [PATCH] showkey: Fix build warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit showkey.c: In function ‘main’: showkey.c:275:31: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion] 275 | alarm(timeout); | ^~~~~~~ showkey.c:287:23: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion] 287 | alarm(timeout); | ^~~~~~~ Signed-off-by: Alexey Gladkov --- src/showkey.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/showkey.c b/src/showkey.c index dfd1dce0..e5dadc38 100644 --- a/src/showkey.c +++ b/src/showkey.c @@ -272,7 +272,7 @@ int main(int argc, char *argv[]) /* show scancodes */ if (!show_keycodes) { while (1) { - alarm(timeout); + alarm((unsigned int) timeout); n = read(fd, buf, sizeof(buf)); for (i = 0; i < n; i++) printf("0x%02x ", buf[i]); @@ -284,7 +284,7 @@ int main(int argc, char *argv[]) /* show keycodes - 2.6 allows 3-byte reports */ while (1) { - alarm(timeout); + alarm((unsigned int) timeout); n = read(fd, buf, sizeof(buf)); i = 0; while (i < n) {