A nx_struct is actually defined as a structure of byte arrays.

So you would need something like

subscriber_t sub[{1}, {2}};

that is what is going on.

eric


On Fri, Jun 27, 2008 at 2:55 AM, Symon Vezina <
[EMAIL PROTECTED]> wrote:

> Hi,
>
> I'm trying to initialize an nx_struct like follows:
>
>        typedef nx_struct subscriber {
>                nx_uint8_t taskId;
>                nx_uint8_t eventId;
>        } subscriber_t;
>
>        subscriber_t sub = {1,2};
>
> but the compiler keeps giving me theses warnings:
>
> source/TestListP.nc:30: warning: missing braces around initializer
> source/TestListP.nc:30: warning: (near initialization for `sub.taskId')
>
>
> The initialization doesn't generate warnings if I take away the "nx_"
> prefix keyword from the whole structure.
>
> Thanks,
> Symon.
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
Autonomous Systems Lab
Jack Baskin School of Engineering
UCSC
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to