reinterpret_cast<void *>(ptr)The C style for casting (also works in C++) is
(void *)ptrTo get a pointer to a different type, replace void with the desired type. C++ provides other casts, but this is the one to use in this case.
Normally the procedure some_canned would have been compiled separately and doesn't know anything about the parameters, nor does it touch them - it just passes them blindly through to the supplied function func. The supplied function recasts the void pointer to the correct original type. It is up to us to be sure we recast to the original type. The compiler can't check.
This sort of casting defeats the compiler's ability to do strong type checking. That is, with this device we can cast a pointer so it points to anything we like and suffer the consequences if we make a mistake. For example, we can change a pointer to a double into a pointer to a float. But then when we try to get the floating point value to which it points, we get garbage. The compiler has no way of protecting us from such foolishness. So one should cast pointers only when absolutely necessary.
Change the name of the class from SomeParams to NewParams and delete the unused integer member i. Make appropriate changes throughout the code, so the new code compiles and gives the same results. What procedures did you have to change? Did you make any changes to the procedure some_canned? (You shouldn't have.)
List the changes in your answer file.