- cast through void * to silence alignment warnings (presumably false
positives resulting from poor API design)
- constify a few function arguments
- move prototypes for callbacks into a common header
- now that the prototypes are in scope, fix instances of function
definitions that don't match the prototype or what the caller
actually passes
- hide a conditionally unused global variable behind the same #ifdef
that controls its use
Approved by: re (blanket)