emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master a1fa3d24d7: Clean up some Haiku toolkit code


From: Po Lu
Subject: master a1fa3d24d7: Clean up some Haiku toolkit code
Date: Mon, 14 Mar 2022 02:50:37 -0400 (EDT)

branch: master
commit a1fa3d24d7f96542530f30c28daf9bf8aaaeae13
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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 ff684df433..f9fa4095f9 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 cb8ffaf2d7..27d4bbafaf 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 8b21fafad7..41bd1e1c84 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);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]