|
From: | Bjarne Laursen |
Subject: | Re: [avr-gcc-list] Got strange compilation problem |
Date: | Thu, 16 Feb 2006 10:41:33 +0100 |
User-agent: | Mozilla Thunderbird 0.7.3 (Windows/20040803) |
David Bourgeois wrote:
uint8_t fifoLength(fifo_t *p) { uint8_t length; length = (p->inIdx) - (p->outIdx); length %= FIFO_SIZE; return length; }
You are casting the result of the subtraction to uint8_t before doing the modulos. If you write it in one statement it will be the same as the operants or at least int.
This could be the difference. -Bjarne Laursen, RoseTechnology A/S
[Prev in Thread] | Current Thread | [Next in Thread] |