I have a little problem here, I have this function:
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)
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, the body of this function has CONST_VALUE_X . I would like to be able to remove the constant and use the fifth argument instead. Since I cannot change the signature, I was wondering if I need to do something or copy-paste a function with any possible constant value ...
thanks
source share