[sane-devel] hs2p backend

jazz_johnson at verizon.net jazz_johnson at verizon.net
Tue Nov 20 20:51:29 UTC 2007


On Monday 19 November 2007, m. allan noah wrote:
> oops- with patch this time.
>
> On Nov 19, 2007 3:33 PM, m. allan noah <kitno455 at gmail.com> wrote:
> > ok, lets try this again. i should have listened to the reversed patch
> > complaints :)
> >
> > this is your current master patch, i guess no need to apply the _new
> > patch.
> >
> > looks much better, but this is a 32 bit system, where sizeof(size_t)
> > == sizeof(int).
> >
> > if you cant make all your strings const, then turn your casts around,
> > and make the function take the const type. casting to const to check
> > the length wont hurt anything, and should silence the errors.
> >
> > allan

Are there any option I need to pass to configure or gcc 
in order to generate the C90/C99 warnings?  
I've compiled hs2p backend on both a Pentium3 x86 and 
an amd64 x86_64 platform but can't seem to generate the warnings in your 
logfile.

Anyhow, 
I've replaced printf("%zd", size_t(x)) with printf("%lu", (u_long)size_t(x))
and printf("%d", sizeof(x)) with printf("%lu", (u_long)sizeof(x))
which should clear up some ISO C90 warnings.
and 
I've changed free( (void *)dev->sane.name) to free( (char*) dev->sane.name)
and
I've changed max_string_size(SANE_String strings[]) to 
max_string_size(SANE_String_Const strings[])


I've checked out today's cvs version of sane-backends
and made a new  patch between my current hs2p backend and the cvs backend:

diff -r -N -u $CVS $CUR | gzip -c - >hs2p_patch.gz
which I've placed at
http://www.acjlaw.net:8080/~jeremy/Ricoh/hs2p_sane_backend/hs2p_patch.gz

This patch builds for me on x86 and x86_64 without any errors or warnings.
I've placed the x86_log.gz and x86_64_log.gz at
http://www.acjlaw.net:8080/~jeremy/Ricoh/hs2p_sane_backend/





More information about the sane-devel mailing list