expr: remove unused parameters from 'Exdisc_t.matchf'
I guess when I committed 260f650085eb25b5b68c81a5960232d025fb6942 it was not
obvious to me that this is entirely part of private internal interfaces and the
callback signature involved is not exposed publicly.
expr: remove unused parameters from 'Exdisc_t.setf'
I guess when I committed 5b4de3922a2f169c2e773ffe85651898aedd9351 it was not
obvious to me that this is entirely part of private internal interfaces and the
callback signature involved is not exposed publicly.
expr: remove unused parameters from 'Exdisc_t.keyf'
I guess when I committed 2e9753d9c9886f5bc013212420528e9a18bc592b it was not
obvious to me that this is entirely part of private internal interfaces and the
callback signature involved is not exposed publicly.
expr: remove unused parameters from 'Exdisc_t.binaryf'
I guess when I committed b0ec7b2eb448a2cb68ffb3751e9e054aecc60c24 it was not
obvious to me that this is entirely part of private internal interfaces and the
callback signature involved is not exposed publicly.
expr: remove unused parameters from 'Exdisc_t.convertf'
I guess when I committed 17479ab6569d40a4778870f712226aa7916f3ca3 it was not
obvious to me that this is entirely part of private internal interfaces and the
callback signature involved is not exposed publicly.
expr: remove further unused parameters from 'Exdisc_t.reff'
I guess when I committed ef3ed2a98a46d0641d936c62fde78e719cef98f8 it was not
obvious to me that this is entirely part of private internal interfaces and the
callback signature involved is not exposed publicly.
expr: replace 'exdump' SFIO buffer with an 'agxbuf'
Unfortunately there is no easy way to stage this. We need to do it all at once,
updating every use of `deparse` and all `exdump`’s internals.
This change improves locality – it is more obvious to both users and the
compiler that the contents of this temporary buffer does not need to be retained
beyond calls to `exerror`. This is a small step towards deprecating SFIO.
Now that `Excc_t` is encapsulated in excc.c and no longer considered an
extensible struct, we can stop playing macro tricks to give it extra fields and
just express these more naturally.
This function invokes `dtwalk` passing the callback `global` to be called with
a state parameter it supplies. It was supplying `cc`, but the callback only uses
a single member of this struct. So we can simplify this code by just passing the
stream the callback writes to, `cc->ccdisc-text`, or equivalently `disc->text`.
This also removes the `method` parameter to this function, which was only ever
set to a single value. This squashes 8 compiler warnings and drops a lot of dead
code.
gvpr canontoken: use char instead of unsigned char, introduce casts
It is not clear to me why this code was using unsigned char when it can do the
same thing with less typing and fewer compiler warnings using char. This also
introduces casts to squash warnings from some of the more pedantic compiler
implementations. See 6c29170f9f29466374fbc6e8e62a1b6916c6bc59 for details.
ast onematch: rephrase hash-based switch into string comparisons
This code was using a hand rolled hash function to implement a series of string
comparisons as a jump table. I guess at some point this must have been a
necessary optimization due to limitations of the day’s compilers/machines. In a
modern environment, this is a deoptimization, impeding the compiler’s ability to
understand your intent. Modern compilers know the string comparison functions as
built-ins and can use SIMD¹/SWAR² tricks to emit a short string comparison as a
single instruction. They are also capable of transforming an if-then-else ladder
into a switch if their heuristics predict it will be worthwhile.
The computation of the return value for this function was relying on string
lengths that fitted in an `int`, something that is generally but not always
true. The compiler complained about this with -Wconversion. The only caller of
this function does not use the return value, so lets just remove it.
This is computing the number of bytes remaining in `buf`; the number of bytes
between a pointer to the current offset and the end of `buf`. Thus it is always
non-negative.
Note that the call to this function from
`constrained_majorization_new_with_gaps` also seems confused about the meaning
of its parameters. But no attempt is made to correct this.
smyrna on_attrAddBtn_clicked: use const type to squash a -Wcast-qual warning
Unfortunately we cannot also do the same for `attr_name` in this function
because it is passed to a Graphviz function that accepts a non-const pointer.
smyrna set_refresh_filters: use const types to squash some -Wcast-qual warnings
Unfortunately we cannot also do the same for `attr_name` in this function
because it is passed to a Graphviz function that accepts a non-const pointer.
Note this also makes `widget` unused in `on_attrApplyBtn_clicked` which is a
Glade callback and cannot have its corresponding parameter removed. So we squash
the resulting warning there.