Skip to content

Commit

Permalink
unix: fix -Wsign-compare warning in tty.c
Browse files Browse the repository at this point in the history
The mode argument is an enum now and the signedness of an enum is
implementation-defined when it doesn't have negative members.

Cast it to int in the comparison to tty->mode because the latter is
still an int.

PR: libuv#134
Reviewed-by: Saúl Ibarra Corretgé <[email protected]>
  • Loading branch information
bnoordhuis authored and saghul committed Jan 14, 2015
1 parent 55ea371 commit bb5f5d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/unix/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ int uv_tty_set_mode(uv_tty_t* tty, uv_tty_mode_t mode) {
struct termios tmp;
int fd;

if (tty->mode == mode)
if (tty->mode == (int) mode)
return 0;

fd = uv__stream_fd(tty);
Expand Down

0 comments on commit bb5f5d1

Please sign in to comment.