[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #55943] pause() with no arguments returns imme
From: |
Mike Miller |
Subject: |
[Octave-bug-tracker] [bug #55943] pause() with no arguments returns immediately on Windows |
Date: |
Fri, 29 Mar 2019 00:22:16 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36 |
Follow-up Comment #16, bug #55943 (project octave):
I have a suspicion about this bug. It's Windows specific, which means it may
be caused by the Windows specific section of code here:
https://hg.savannah.gnu.org/hgweb/octave/file/4388526646ef/libinterp/corefcn/sysdep.cc#l596
Now I don't really know how these functions work on Windows, but it looks to
me like in non-blocking mode, it's either returning a valid character or the
value 0 if no keys were pressed.
Can someone please test a patch on Windows that simply returns -1 instead of 0
in that ternary expression?
In the Unix section of code, the return value when no character is available
is 'EOF', which is defined to be -1 in stdio.h.
Meanwhile, in the new 'octave::sleep(inf)' section of code that was added in
Octave 5.1, 'octave::kbhit' is called in a loop, and any non-negative value,
including 0, breaks out of the loop. So that may explain why this returns
immediately on Windows.
https://hg.savannah.gnu.org/hgweb/octave/file/4388526646ef/libinterp/corefcn/utils.cc#l1295
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?55943>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #55943] The pause function fails when there is no argument, (continued)
- [Octave-bug-tracker] [bug #55943] The pause function fails when there is no argument, Alan, 2019/03/27
- [Octave-bug-tracker] [bug #55943] The pause function fails when there is no argument, Rik, 2019/03/27
- [Octave-bug-tracker] [bug #55943] The pause function fails when there is no argument, Daniel PĂ©rez, 2019/03/27
- [Octave-bug-tracker] [bug #55943] The pause function fails when there is no argument, Rik, 2019/03/27
- [Octave-bug-tracker] [bug #55943] The pause function fails when there is no argument, Michael Godfrey, 2019/03/27
- [Octave-bug-tracker] [bug #55943] The pause function fails when there is no argument, Mike Miller, 2019/03/27
- [Octave-bug-tracker] [bug #55943] The pause function fails when there is no argument, Mike Miller, 2019/03/27
- [Octave-bug-tracker] [bug #55943] The pause function fails when there is no argument, Rik, 2019/03/27
- [Octave-bug-tracker] [bug #55943] pause() with no arguments returns immediately on Windows, Mike Miller, 2019/03/27
- [Octave-bug-tracker] [bug #55943] pause() with no arguments returns immediately on Windows, Michael Godfrey, 2019/03/27
- [Octave-bug-tracker] [bug #55943] pause() with no arguments returns immediately on Windows,
Mike Miller <=
- [Octave-bug-tracker] [bug #55943] pause() with no arguments returns immediately on Windows, Mike Miller, 2019/03/29