Unfortunately (or fortunately, IMO :-)), C++ mandates this cast (and Gjs is now written in C++ because mozilla is deprecating the C interface for SpiderMonkey). You have to cast from void * to the target pointer type.

I'll bring the typed user data back to the scope though.