[Tinyos-help] Casting between independent type and dependent type in tinyos

Tran Thi Thuy Trang thuytranga1 at yahoo.com
Tue Apr 13 06:10:45 PDT 2010


Hi,
I am a beginner in TinyOS and nesC programming. I am using nesC 
and sending message between platforms.
If we have two following structs

typedef nx_uint8_t nx_typeB;
typedef uint8_t typeB;

typedef
 struct nx_typeA {
nx_uint8_t a;
nx_typeB b;
nx_uint8_t c;
} 
nx_typeA;

typedef struct typeA{
uint8_t a;
typeB b;
uint8_t
 c;
} typeA;

can I do casting between these two types like following
nx_typeA y;
typeA  x = (typeA) y;

If it can, I wonder there is any notice that I should remember to handle these types of casting...Is there any possible error?

Thank
 you in advance.
Regards,
Trang
Trang 


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20100413/c55f91d4/attachment.htm 


More information about the Tinyos-help mailing list