[Tinyos-help] C struct questions in TinyOS
Supasate Choochaisri
kaizerwing at gmail.com
Thu Aug 2 08:28:11 PDT 2007
Hi all,
I'm not quite familiar with C language, so I doubt about the following codes
in Mate (TinyOS-VM) :
1: typedef struct {
2: int16_t var;
3: } MateValueVariable;
4:
5: typedef struct {
6: uint8_t type;
7: uint8_t size;
8: int16_t entries[MATE_BUF_LEN];
9: } MateDataBuffer;
10:
11: typedef struct {
12: MateDataBuffer* var;
13: } MateBufferVariable;
14:
15: typedef struct {
16: uint8_t type;
17: union {
18: MateValueVariable value;
19: MateBufferVariable buffer;
20: };
21: } MateStackVariable;
Line 1-3, compare to "typedef int16_t MateValueVariable", how difference is
it?
Line 11-13, why do we have to use this struct? why not just change line 9 to
MateBufferVariable and delete line 11-13?
Thanks in advance,
Supasate
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20070802/8a9f0fa2/attachment.html
More information about the Tinyos-help
mailing list