Skip to content

Commit

Permalink
showkey: Fix build warning
Browse files Browse the repository at this point in the history
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 <legion@kernel.org>
legionus committed Sep 17, 2024
1 parent 8246f5f commit 8f5b227
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/showkey.c
Original file line number Diff line number Diff line change
@@ -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) {

0 comments on commit 8f5b227

Please sign in to comment.