Silence warnings on appropriate GSourceFunc casts
`g_source_set_callback()` is a generic API that takes a `GFunc`, but
some specific `GSource`s use other signatures for their callback, so
the cast is valid (given the callback is effectively correct).
Silence warnings from `-Wcast-function-type` by inserting an
intermediate `(void(*)(void))` cast, but keep some type checking by
first casting to the actually wanted type:
(GSourceFunc) (void(*)(void)) (GChildWatchFunc) spawn_watch_cb
which reads from right to left:
- `spawn_watch_cb`, the callback that should match `GChildWatchFunc`;
- `(GChildWatchFunc)`, which allows the compiler to verify the function
is effectively compatible with what we know it should be;
- `(void(*)(void))`, dummy cast to silence `-Wcast-function-type`;
- `(GSourceFunc)`, cast to the type expected by the generic API call.
We could use GLib's `G_SOURCE_FUNC()` cast macro to some extent
(everything but the rightmost cast), but it's in 2.58 which is newer
than our target.