On 6/12/07, J. Ryan Stinnett <[EMAIL PROTECTED]> wrote:
Does the @number() attribute work across multiple layers?  I would think that it
should be able to, but perhaps I'm not using it correctly.  I realize that the
test case below wouldn't do anything at run time, but I believe the syntax is
still correct.  I get the error:

It should. If it doesn't, it's a bug... I'll look into it.

David Gay


In file included from TestNumberC.nc:5:
In component `NumberC':
NumberC.nc:5: parameter 1 must be a numerical type

TestNumberC.nc:

configuration TestNumberC {}

implementation {

  components new NumberC(uint8_t);

}

NumberC.nc:

generic configuration NumberC (typedef num_t @number()) {}

implementation {

  components new NumberP(num_t);

}

NumberP.nc:

generic module NumberP (typedef num_t @number()) {}

implementation {

  num_t test;

}

Thanks,
Ryan

Quoting David Gay <[EMAIL PROTECTED]>:

> From the nesC documentation (somewhat hidden in /usr/share/ncc/doc,
> admittedly):
>
> It is also possible to declare, using the special @integer() and @number()
> attributes, that a type parameter is of an integral (respectively numerical)
> type. In that case, all the operations allowed on integers (respectively,
> integers and floating-point numbers) are allowed:
>
>   generic module Sort(typedef t @number()) { }
>   implementation {
>     ...
>     void f() {
>       t x1, x2;
>       ...
>       if (x1 < x2)
>         ...
>   }
>
> David Gay
>
>



_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to