Avoids static analyzer warnings.
Adds required C++ casting from void*.