[sane-devel] C undefined operations in sane-backends-1.0.7-beta1

Karsten Festag karsten.festag@t-online.de
Thu, 24 Jan 2002 20:17:25 +0100


Tim Waugh wrote:

> On Thu, Jan 24, 2002 at 08:12:53AM +0100, Karsten Festag wrote:
>
> > in the two lines
> >  bit = ++bit;
>
> This will give the same warning of course!
>

o.k, got it.

>
> >  bit %= 8;
>
> Why not just use bit = (bit + 1) % 8, which appears to be the intent?
>

I read somewhere that ++bit would give faster code than bit = bit + 1.
Now my question (as a non-expierienced programmer) is if

++bit;
bit %= 8;

is faster than your suggestion or do you think it makes no difference?

Regards

Karsten