void* and cast will work fine even though it looks bad.
Maybe you should switch to C++ instead? grin