Files
magic/graphics
Intubun fdfb54badb graphics/grNull.c: typed no-op stubs for WASM call_indirect
Magic's graphics layer routes every drawing primitive through
function pointers (GrXxxPtr / grXxxPtr) that are bound to a driver
at startup. The original null driver assigned a single 0-arg
nullDoNothing() to every pointer, which works in native builds
because of K&R loose prototype rules but fails in WASM where
call_indirect requires an exact type match between caller and
callee.

This commit:
* Adds typed no-op stubs nullDoNothingI/II/IIII/IIIIIII for
  void-returning callbacks of various arities.
* Adds nullReturnFalseI/II/III for bool-returning callbacks and
  nullReturnZeroI for int-returning callbacks.
* Casts each pointer assignment in nullSetDisplay() to the K&R
  pointer type the public header still uses, while the underlying
  function carries the correct WASM signature.
* Fills in window-management and backing-store pointers that the
  original null driver left at NULL — many of these are called
  unconditionally by WindUpdate paths, and need at least a no-op
  to avoid traps.
* Guards the stdin watch in nullSetDisplay() with #ifndef
  __EMSCRIPTEN__: WASM has no real stdin file descriptor and
  TxAdd1InputDevice() / SigWatchFile() are POSIX-specific.

Native builds are unaffected: the K&R-loose prototype machinery
still accepts the previous and the new code identically.
2026-05-11 14:20:47 -04:00
..
2020-05-23 17:00:38 -04:00
2020-05-23 17:00:38 -04:00
2020-05-23 17:00:38 -04:00
2026-03-26 09:21:18 -04:00
2026-03-26 09:21:18 -04:00
2026-03-26 09:21:18 -04:00
2026-03-26 09:21:18 -04:00
2026-03-26 09:21:18 -04:00
2026-03-26 09:21:18 -04:00
2026-03-26 09:21:18 -04:00
2026-03-26 09:21:18 -04:00
2026-03-26 09:21:18 -04:00
2026-03-26 09:21:18 -04:00
2025-10-04 20:50:31 -04:00
2026-03-26 09:21:18 -04:00
2025-10-04 20:50:31 -04:00

This driver is a modification of the Stanford X10 driver.  The modifications
were done by Walter Scott and Eric Lunow at Lawrence Livermore National Labs.