From a1fa3d24d7f96542530f30c28daf9bf8aaaeae13 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 14 Mar 2022 06:48:34 +0000 Subject: [PATCH] Clean up some Haiku toolkit code * src/haiku_io.c (haiku_read_with_timeout): Accept `bigtime_t' instead of `time_t' for values which are cast to bigtime_t anyway. * src/haiku_support.cc (BMenu_run): Read all help events instead of just one. * src/haiku_support.h: Update prototypes. --- src/haiku_io.c | 2 +- src/haiku_support.cc | 2 +- src/haiku_support.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/haiku_io.c b/src/haiku_io.c index ff684df4337..f9fa4095f9f 100644 --- a/src/haiku_io.c +++ b/src/haiku_io.c @@ -145,7 +145,7 @@ haiku_read (enum haiku_event_type *type, void *buf, ssize_t len) Input is blocked when an attempt to read is in progress. */ int haiku_read_with_timeout (enum haiku_event_type *type, void *buf, ssize_t len, - time_t timeout, bool popup_menu_p) + bigtime_t timeout, bool popup_menu_p) { int32 typ; port_id from = (popup_menu_p diff --git a/src/haiku_support.cc b/src/haiku_support.cc index cb8ffaf2d7b..27d4bbafaf7 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc @@ -2957,7 +2957,7 @@ BMenu_run (void *menu, int x, int y, if (infos[0].events & B_EVENT_READ) { - if (!haiku_read_with_timeout (&type, buf, 200, 1000000, true)) + while (!haiku_read_with_timeout (&type, buf, 200, 0, true)) { switch (type) { diff --git a/src/haiku_support.h b/src/haiku_support.h index 8b21fafad73..41bd1e1c84f 100644 --- a/src/haiku_support.h +++ b/src/haiku_support.h @@ -420,7 +420,7 @@ extern "C" extern int haiku_read_with_timeout (enum haiku_event_type *type, void *buf, ssize_t len, - time_t timeout, bool popup_menu_p); + bigtime_t timeout, bool popup_menu_p); extern int haiku_write (enum haiku_event_type type, void *buf); -- 2.39.5