[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] efficiency of assigning bits (getting OT)

From: E. Weddington
Subject: Re: [avr-gcc-list] efficiency of assigning bits (getting OT)
Date: Mon, 21 Mar 2005 09:42:33 -0700
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

Graham Davies wrote:

Unnecessarily sprinkling the code
with (unsigned char) casts does nothing for the code efficiency, or code
portability, and detracts from code readability - so don't do it.

Right - with emphasis on the first word of your sentence.

As an aside, if it detracts from readability, then that's what macros are for. You can hide the unreadability behind a series of macros and you still get the same assurances. For example:

#define bit_clear_8(v, m)   ((uint8_t)(v) &= (uint8_t)~(m))

But this has already been discussed to death before in the archives.

We're going around in a circle.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]