C++ to C


 
Thread Tools Search this Thread
Top Forums Programming C++ to C
# 15  
Old 02-19-2010
and I do the same changes to "static const uint16_t crc16_tab[] =" ?
# 16  
Old 02-19-2010
yes, all uint16_t needs to be replaced with unsigned short int.
# 17  
Old 02-19-2010
static const cyg_uint16 crc16_tab[] = {

shall I change cyg_unit16 to unsigned short int too?
# 18  
Old 02-20-2010
yes, change it to unsigned short. and any other variation on uint16 you find is also unsigned short.
# 19  
Old 02-20-2010
parse error before "crc16_tab"
# 20  
Old 02-21-2010
That is not the complete error. And I can't see your code from here.

---------- Post updated 02-21-10 at 11:00 AM ---------- Previous update was 02-20-10 at 11:02 AM ----------

Please don't take this to PM's, I'm supposed to help you here so the solution can help everyone with this problem.

Seeing the code, you still need to change "static const cyg_unsigned" to "static const unsigned short".
# 21  
Old 02-21-2010
thanks, that solved the problem of uint16, but I'm still not sure how to pass my structure to CRC

e.g.

typedef struct header
{

unsigned short s;
unsigned short d;
unsigned int sq;
unsigned int a;
char hdr;
char rs;
char flg;
unsigned short w;
unsigned short cksum;


} header;


typedef struct Message {
struct header hdr;
char data[1024];
}Message;

=================

I need to pass these parameters and find the total CRC then save it in cksum,
no syntax error for my code but I'm getting a segmentation error!
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question