I believe the issue was caused by the product of two u16s being promoted
to (signed) int, which can cause unwanted overflow behaviour when
comparing to size_t. Casting each term to size_t before the
multiplication makes the comparison unsigned.
According to the spec, these calls should be identical to an invocation
of `glVertex2*`, which sets the W-coordinate to 1 by default.
This fixes the credits sequence rendering of Tux Racer.
If a triangle edge is completely horizontal and moving in a positive X
direction, we were erroneously treating it as a top edge. This adds
a better check that accounts for those edges. :^)
By setting the clip plane normals' W coordinate to 1, we can skip two
coordinate retrievals and three additions. This works because the
Vector `.dot()` operation multiplies the W coordinates of both vectors.
We sat on a throne of lies: our `edge_function()` returned positive
values for _clockwise_ vertex rotation instead of _counter-clockwise_,
which was hidden by the fact that we were forcing everything into CW
rotation by an erroneous area comparison (`> 0` instead of `< 0`).
This simplifies our culling code significantly.
This was defined twice, despite being the very same thing:
- ClassElement::ClassFieldDefinition
- ECMAScriptFunctionObject::InstanceField
Move the former to a new header and use it everywhere. Also update the
define_field() AO to take a single field instead of separate name and
initializer arguments.
Previously this had its own massive tagged union implementation with
some POD types to represent non-POD types that could be put in the
variant; implement it via a Variant and get rid of the manual
pointer/ref handling.
This commit does not change any semantics on the type, just the
underlying implementation (and removes an unused ::clear() method).
Some functions want to ignore cv-qualifiers, and it's much easier to
constrain the type through a concept than a separate requires clause on
the function.
POSIX says that localtime should fail with EOVERFLOW if the result
cannot be represented, which is the case for most large (in absolute
value) time_t inputs, since they overflow (or underflow) tm_year, which
is an int. This patch introduces this functionality. Previously, tm_year
just overflowed (or underflowed) silently.
Incidentally, this partially fixes#12729 without solving the root
problem, which is that time_to_tm is linear in its input to determine
the number of years since epoch.
This means that the bash port mktime test no longer times-out in 60s,
but it still fails (faster) in some other place. Due to underlying issue
in the algorithm, the worst case inputs still take a couple of seconds
on my machine.
Previously the CI would hang on the "Check manpages for completeness"
step on any utility that unveils the /tmp/portal/lookup file because
it was not created during the generate-manpages SystemMode.
This will allow utilities that resolve hostnames (e.g. netstat, arp) to
pass the export-argsparser-mangpages.sh check.
Every StyleValue type now has its own `equals()` method, rather than
relying on the default "compare the to_string() output" method, which
has now been removed. This logic is still used by UnresolvedSV and
CalculatedSV, because it's probably the best option for them unless
performance becomes a real issue.
Also took this opportunity to move all the `equals()` implementations
into the .cpp file, which may or may not actually help with compile
times but StyleValue.h is huge and included everywhere, so it can't
hurt.
On the QEMU microvm machine type, it became apparent that the BIOS was
not setting the i8042 controller to function as expected. To ensure that
the controller is always outputting correct scan codes, set it to scan
code 2 and enable first port translation to ensure all scan codes are
translated to scan code set 1. This is the expected behavior when using
SeaBIOS, but on qboot (the BIOS for the QEMU microvm machine type), the
firmware doesn't take care of this so we need to do this ourselves.
31ca48e made this default to paths, but now that we have a few sensible
ways to complete things, let's make those work too.
For instance, prior to this `kill <tab>` would've suggested paths, but
now it will suggest processes.
Setting 'allow_commit_without_listing' to false will now make LibLine
show the suggestion before actually committing to it; this is useful for
completions that will replace all the user input, where mistakes can go
unnoticed without some visual cue.
Now that we can resolve these correctly and they're per-suggestion, we
can finally use them for their intended purpose of letting suggestions
overwrite stuff in the buffer.
The shell now expects a JSON object of the form {"kind":<kind>,...} per
line in the standard output of the completion process, where 'kind' is
one of:
- "plain": Just a plain suggestion.
- "program": Prompts the shell to complete a program name starting with
the given "name".
- "proxy": Prompts the shell to act as if a completion for "argv" was
requested.
- "path": Prompts the shell to complete a path given the "base" and
"part" (same as completing part in cwd=base).
We previously allowed globs as match pattern, but for more complex
matching needs, it's nice to have regular expressions.
And as the existing "name a part of the match" concept maps nicely to
named capture groups, we can simply reuse the same code and make groups
with names available in the match body.
We would have to fclose() it to be clean and nice, but that would close
the fd; instead just duplicate it and write through that, this makes it
actually write to the file.