From 6ce6fe57127d39730694684a6ed6026b051d552e Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 20 Mar 2019 10:50:44 +0000 Subject: [PATCH] Use the SELECT_* enum for a few more uxsel flags. This cleans up some spots that were missed in 47202c4e16. --- unix/gtkcomm.c | 12 ++++++------ unix/uxser.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/unix/gtkcomm.c b/unix/gtkcomm.c index b50b6d59..265cdda3 100644 --- a/unix/gtkcomm.c +++ b/unix/gtkcomm.c @@ -107,18 +107,18 @@ uxsel_id *uxsel_input_add(int fd, int rwx) { #if GTK_CHECK_VERSION(2,0,0) int flags = 0; - if (rwx & 1) flags |= G_IO_IN | G_IO_HUP; - if (rwx & 2) flags |= G_IO_OUT; - if (rwx & 4) flags |= G_IO_PRI; + if (rwx & SELECT_R) flags |= G_IO_IN | G_IO_HUP; + if (rwx & SELECT_W) flags |= G_IO_OUT; + if (rwx & SELECT_X) flags |= G_IO_PRI; id->chan = g_io_channel_unix_new(fd); g_io_channel_set_encoding(id->chan, NULL, NULL); id->watch_id = g_io_add_watch_full(id->chan, GDK_PRIORITY_REDRAW+1, flags, fd_input_func, NULL, NULL); #else int flags = 0; - if (rwx & 1) flags |= GDK_INPUT_READ; - if (rwx & 2) flags |= GDK_INPUT_WRITE; - if (rwx & 4) flags |= GDK_INPUT_EXCEPTION; + if (rwx & SELECT_R) flags |= GDK_INPUT_READ; + if (rwx & SELECT_W) flags |= GDK_INPUT_WRITE; + if (rwx & SELECT_X) flags |= GDK_INPUT_EXCEPTION; assert(flags); id->id = gdk_input_add(fd, flags, fd_input_func, NULL); #endif diff --git a/unix/uxser.c b/unix/uxser.c index 22391548..135a658a 100644 --- a/unix/uxser.c +++ b/unix/uxser.c @@ -417,9 +417,9 @@ static void serial_uxsel_setup(Serial *serial) int rwx = 0; if (serial->inbufsize <= SERIAL_MAX_BACKLOG) - rwx |= 1; + rwx |= SELECT_R; if (bufchain_size(&serial->output_data)) - rwx |= 2; /* might also want to write to it */ + rwx |= SELECT_W; /* might also want to write to it */ uxsel_set(serial->fd, rwx, serial_select_result); }