Cast void* to return type.