Same as Vector, ByteBuffer now also signals allocation failure by
returning an ENOMEM Error instead of a bool, allowing us to use the
TRY() and MUST() patterns.
Derivatives of Core::Object should be constructed through
ClassName::construct(), to avoid handling ref-counted objects with
refcount zero. Fixing the visibility means that misuses like this are
more difficult.
This used to be a target to demonstrate a bug in Inspector (#3159).
However, now that the inspection direction has inverted, this no longer
makes any sense.
While mathematically equivalent, the presence of a size_t forces the
comparison to work with size_t's. This means that '-1 < 0' is false,
contrary to the 'mathematically pure' interpretation of the inequality.
I like using hexdump to 'have a look' at binary files, for example
/dev/random or /dev/hda. Obviously, this usecase requires that hexdump
tries not to buffer the 'entire' device.
Enclose the ASCII-interpretation in pipes, show non-ASCII bytes as a
dot, and fix the length of the last line.
Note that this makes it more similar to the behavior of many other
implementations.
Before this patch less would query the terminal geometry only at
startup and use this information to render the file when
appropriate. If the terminal is resized then the output is broken in
several different ways because of this.
This patch adds a SIGWINCH signal handler receive notification any
time the terminal is resized. This signal handler just sets a flag to
notify the main loop that a resize has occurred.
The main loop of the program just calls get_key_sequence() to get
input from the user, interpreting keystrokes as commands like scroll
up or down. The get_key_sequence() function has been changed to return
Optional<String>, so it either returns a keystroke from the user or it
returns nothing as an empty Optional.
While the user is not pressing any keys on the keyboard, the program
is blocking on a read() system call in get_key_sequence(). When
SIGWINCH is received, this read() will return with -1 and errno is set
to EINTR since the system call was interrupted by the signal. When
this happens we just return an empty Optional.
The mainloop now checks to see if a resize has been requested by
checking the flag, and if it has it performs a resize.
init() now just calls resize() since the required logic is the same.
Setters for m_filename and m_prompt are removed because these are now
just initialized by the constructor, as they never change for the life
of the program.
We create a base class called GenericFramebufferDevice, which defines
all the virtual functions that must be implemented by a
FramebufferDevice. Then, we make the VirtIO FramebufferDevice and other
FramebufferDevice implementations inherit from it.
The most important consequence of rearranging the classes is that we now
have one IOCTL method, so all drivers should be committed to not
override the IOCTL method or make their own IOCTLs of FramebufferDevice.
All graphical IOCTLs are known to all FramebufferDevices, and it's up to
the specific implementation whether to support them or discard them (so
we require extensive usage of KResult and KResultOr, together with
virtual characteristic functions).
As a result, the interface is much cleaner and understandable to read.