??? 03/16/06 12:22 Read: times |
#112296 - Excellent! Responding to: ???'s previous message |
I'm sure most will agree, the code is a lot easier to understand.
Another little hint to make the code easier to read (this one's from MISRA C). As you wrote: if(r_out >= RBUF_SIZE) r_out = 0; ............ or another common method if(r_out >= RBUF_SIZE) r_out = 0; ................. MISRA C tells us this way is recommended as there is no confusion what the 'if' statement relates to. if(r_out >= RBUF_SIZE) { r_out = 0; } Just a little change to the coding style can make a big difference to detecting and/or avoiding defects. |