A
Alfonso Morra
Hi,
I have two func ptr prototypes declared as :
typedef void (*VFP)(void) ;
typedef int(MyCallback*)(enum_1, enum2, int, void*) ;
I hav a struct as ff:
typedef struct {
VFP mini_callback ;
VFP data_callback ;
...
}FunctorStruct ;
I can assign a function ptr of type MyCallback to mini_callback or
data_callback (after suitable casts to VFP).
Assuming i have function foo defined as ff:
int foo( FunctorStruct *fctor ) {
/* code here to call function pointed to by data_callback
assuming we know the function pointed to is of type
MyCallback */
(MyCallback)fctor->data_callback( ONE, TWO, 100, NULL ) ; /* <- dosen't
compile !*/
}
The compiler dosen't grok this. When I try to compile the above snippet,
it (the compiler) barfs and issues the ff message: "'VFP' : too many
arguments for call through pointer-to-function".
How do I call the function - cast to its correct type?
tkx
I have two func ptr prototypes declared as :
typedef void (*VFP)(void) ;
typedef int(MyCallback*)(enum_1, enum2, int, void*) ;
I hav a struct as ff:
typedef struct {
VFP mini_callback ;
VFP data_callback ;
...
}FunctorStruct ;
I can assign a function ptr of type MyCallback to mini_callback or
data_callback (after suitable casts to VFP).
Assuming i have function foo defined as ff:
int foo( FunctorStruct *fctor ) {
/* code here to call function pointed to by data_callback
assuming we know the function pointed to is of type
MyCallback */
(MyCallback)fctor->data_callback( ONE, TWO, 100, NULL ) ; /* <- dosen't
compile !*/
}
The compiler dosen't grok this. When I try to compile the above snippet,
it (the compiler) barfs and issues the ff message: "'VFP' : too many
arguments for call through pointer-to-function".
How do I call the function - cast to its correct type?
tkx