[sane-devel] Fixing sequencing issues (was Re: Proposed Upgrade (pu) branches on GitLab)

m. allan noah kitno455 at gmail.com
Tue Sep 29 01:07:47 UTC 2015


On Mon, Sep 28, 2015 at 7:04 AM, Johannes Meixner <jsmeix at suse.de> wrote:
>
> Hello,
>
> On Sep 28 18:59 Olaf Meeuwissen wrote (excerpt):
>>
>> With the sequencing issues, we can only speculate at what
>> the intended behaviour is, so we can't really fix things.
>> That notwithstanding, I think we can make a decent, educated
>> guess at a fix for both cases and make the warning go away :-|
>
>
> I don't know if the following sequencing bug was already found:
>
> In sane-backends-git20150928 in backend/microtek2.c
> there is line 7456:
>
>         ms->buf.current_src = ++ms->buf.current_src % 2;
>
> My "decent educated guess" is that
>
>         ++ms->buf.current_src;
>         ms->buf.current_src = ms->buf.current_src % 2;
>
> is meant.

I'd guess it is just trying to swap 0 and 1, since all it is used for
is an index into ms->buf.src_buffer, which is defined as:
uint8_t *src_buffer[2];     /* two buffers because of CCD gap */

So all the code should do is:

ms->buf.current_src = ! ms->buf.current_src;

allan

-- 
"well, I stand up next to a mountain- and I chop it down with the edge
of my hand"



More information about the sane-devel mailing list