P
Peter
Hi,
I am trying to compile an existing project (originally c) in .NET (rename .c
files to .cpp). After fixing some problems, here are the ones that I don't
know how to deal with:
--------------------------------------------------------------------------
....
.... \myfile.cpp(987) : error C2440: 'initializing' : cannot convert from
'int (__cdecl *)(mytype *,char *,int)' to 'int (__cdecl *)(void)'
None of the functions with this name in scope match the target type
....
----------------------------------------------------------------------------
-------------------------------------------------
The above error happened on a file pointer variable (on each function
address), which is as follows:
------------------------------
int (*fsm_ptr [ OP_MAX + 1 ] [ OP_MAX + 1 ] ) () = {
fsm_invalid, /* [sent = 0] [recv = OP_RRQ] */ // Line 987!
fsm_recv_RRQ, /* [sent = 0] [recv = OP_RRQ] */
fsm_recv_WRQ, /* [sent = 0] [recv = OP_WRQ] */
....
m_invalid, /* [sent = OP_ERROR] [recv = OP_DATA] */
fsm_invalid, /* [sent = OP_ERROR] [recv = OP_ACK] */
fsm_error /* [sent = OP_ERROR] [recv = OP_ERROR] */
};
The pointer variable was used in the main file like this:
....
retVal = (*fsm_ptr[pTd->op_sent][pTd->op_recv])(pTd,
pTd->recvbuff + OPCODE_BYTE_SIZE, nbytes - OPCODE_BYTE_SIZE);
....
--------------------------
Each function in the pointer is declared/implemented in the same file and
returns 0, -1, or -2. For example:
static int
fsm_invalid(struct mytype *pTd, char *ptr, int nbytes)
{
....
return ABORT;//Defined as -2
}
Can anybody help?
Thanks,
Peter
I am trying to compile an existing project (originally c) in .NET (rename .c
files to .cpp). After fixing some problems, here are the ones that I don't
know how to deal with:
--------------------------------------------------------------------------
....
.... \myfile.cpp(987) : error C2440: 'initializing' : cannot convert from
'int (__cdecl *)(mytype *,char *,int)' to 'int (__cdecl *)(void)'
None of the functions with this name in scope match the target type
....
----------------------------------------------------------------------------
-------------------------------------------------
The above error happened on a file pointer variable (on each function
address), which is as follows:
------------------------------
int (*fsm_ptr [ OP_MAX + 1 ] [ OP_MAX + 1 ] ) () = {
fsm_invalid, /* [sent = 0] [recv = OP_RRQ] */ // Line 987!
fsm_recv_RRQ, /* [sent = 0] [recv = OP_RRQ] */
fsm_recv_WRQ, /* [sent = 0] [recv = OP_WRQ] */
....
m_invalid, /* [sent = OP_ERROR] [recv = OP_DATA] */
fsm_invalid, /* [sent = OP_ERROR] [recv = OP_ACK] */
fsm_error /* [sent = OP_ERROR] [recv = OP_ERROR] */
};
The pointer variable was used in the main file like this:
....
retVal = (*fsm_ptr[pTd->op_sent][pTd->op_recv])(pTd,
pTd->recvbuff + OPCODE_BYTE_SIZE, nbytes - OPCODE_BYTE_SIZE);
....
--------------------------
Each function in the pointer is declared/implemented in the same file and
returns 0, -1, or -2. For example:
static int
fsm_invalid(struct mytype *pTd, char *ptr, int nbytes)
{
....
return ABORT;//Defined as -2
}
Can anybody help?
Thanks,
Peter