<html>
<body>
Hi Sylvain,<br><br>
Parentheses are required to keep the macro arguments together and there
can be no space between the macro name and the opening parenthesis. As an
example, consider the macro:<br><br>
<font face="Courier New, Courier">#define SQUARE(x)&nbsp;&nbsp;&nbsp;
x*x<br><br>
</font>When invoked as:<br><br>
<font face="Courier New, Courier">y = SQUARE(z + 1);<br><br>
</font>the resulting calculation after preprocessor substitution will be
:<br><br>
<font face="Courier New, Courier">y = z*z + 1;<br><br>
</font>Because of operator precedence, that does not return the correct
value, which should be:<br><br>
<font face="Courier New, Courier">y = (z + 1)*(z + 1);<br><br>
</font>Writing the macro as:<br><br>
<font face="Courier New, Courier">#define SQUARE(x)&nbsp; (x*x)<br><br>
</font>will make the correct substitution.<br><br>
The parentheses are even more important when the macro has multiple
arguments, as in:<br><br>
<font face="Courier New, Courier">#define MAX(a, b)&nbsp; ((a) &gt; (b) ?
(a) : (b))<br><br>
</font>which when&nbsp; invoked as:<br><br>
<font face="Courier New, Courier">y = MAX(p+q, r+s);<br><br>
</font>will result in:<br><br>
<font face="Courier New, Courier">y = ((p+q) &gt; (r+s) ? (p+q) :
(r+s));<br><br>
<br>
</font>This is a good general reference for the C language:<br><br>
&nbsp;<a href="http://www.its.strath.ac.uk/courses/c/" eudora="autourl">
http://www.its.strath.ac.uk/courses/c/<br><br>
</a>and more specific detail can be found here:<br><br>
&nbsp;<a href="http://www.its.strath.ac.uk/courses/c/subsection3_13_2.html#SECTION00013200000000000000" eudora="autourl">
http://www.its.strath.ac.uk/courses/c/subsection3_13_2.html#SECTION00013200000000000000<br>
<br>
</a>Hope that helps.<br><br>
All the best for now,<br>
John<br><br>
<br>
At 16:10 06/03/2007, you wrote:<br>
<blockquote type=cite class=cite cite="">Hi,<br><br>
&nbsp; could you told me why #define MINDELAY(x) &quot;what ()
do?&quot;<br>
and is it the same for ( ((x)) - 0.148285449) * 59.94444469<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
^^^<br><br>
Thanks<br>
Sylvain<br><br>
<br>
_______________________________________________<br>
Icc-avr mailing list<br>
Icc-avr@imagecraft.com<br>
<a href="http://dragonsgate.net/mailman/listinfo/icc-avr" eudora="autourl">
http://dragonsgate.net/mailman/listinfo/icc-avr</a></blockquote></body>
</html>