I'm running in a little issue here, I've got this function pointer :
typedef void* (* funcPointer)(const void *in, int ilen, void *out, int *olen)
And this function
void* foo1(const void *in, int ilen, void *out, int *olen)
{
if(CONST_VALUE_1 > iLen)
//do something
else
//do something else
return whatever;
}
Somewhere in the code
// ...
funcPointer fpointer = foo1;
if(someArgument > SOME_OTHER_CONSTANT)
// where foo2 is the same as foo1 except that it uses CONST_VALUE_2
fpointer = foo2;
bar( someVariable, anotherVariable, fpointer);
// ...
As you can see, there is a CONST_VALUE_X
in the body of this function. I would like to be able to remove the constant and use a fifth argument instead. Since I can't modify the signature, I was wondering if there was something to do or copy-paste the function with every possible constant value...
Thank you