I have a function which I would like to pass to another function as an argument (let's call it funX). Here's funX prototype:
void funX(const unsigned char *, unsigned char *, size_t, const somestruct *, unsigned char *, const int);
and my function (lets call it funY) which calls funX:
unsigned char * funY(unsigned char *in, unsigned char *out, size_t len, unsigned char *i, void *k, int ed, void (*f)(unsigned char *, unsigned char *, size_t, const void *, unsigned char *, const int))
{
f(in, out, len, k, i, ed);
}
But I have some warnings while compiling:
test.c: In function ‘main’:
test.c:70:5: warning: passing argument 7 of ‘funY’ from incompatible pointer type [enabled by default]
test.c:11:17: note: expected ‘void (*)(unsigned char *, unsigned char *, size_t, const void *, unsigned char *, const int)’ but argument is of type ‘void (*)(const unsigned char *, unsigned char *, size_t, const struct somestruct *, unsigned char *, const int)’