These bugs all exist in stock Magic but were tolerated by the K&R-loose
native build. The strict WASM call_indirect type checks turned them up.
* cif/CIFhier.c: ASSERT in cifFlatMaskHints accessed
oldproprec->prop_value.prop_type, but prop_type is a top-level member
of PropertyRecord. Changed to oldproprec->prop_type.
* extflat/EFargs.c: efLoadSearchPath was assigning a pointer to a
string literal ("." in RO data), which callers later try to free or
StrDup. Replaced with StrDup(path, ".") so the pointer always lives
on the heap.
* router/rtrVia.c: rtrFollowName called RtrMilestonePrint("#"), but
the function takes no arguments.
* sim/SimSelect.c: SimAddLabels called DBWLabelChanged with five
arguments, but its real signature is (CellDef *, Label *, int).
Replaced with the equivalent DBWAreaChanged call.
* windows/windView.c: extern declaration of DBMovePoint had return
type void, but the function actually returns bool.
and forcing it to be passed as an argument to all the callback
functions for the search routines that require it. Magic now
compiles and runs with the new code, but there are a number of
known issues that need to be fixed up. Committing now so that
I can rebase on the last update to the master branch.
This commit makes the code (mostly) C99-compatible, enabling to compile
it without the -Wno-error=implicit-function-declaration flag. This
way, Magic becomes usable on arm64 architectures, specifically on Apple
computers with M1/M2 SoC.