[sane-devel] hs2p backend

m. allan noah kitno455 at gmail.com
Mon Nov 19 16:36:20 UTC 2007

On Nov 18, 2007 11:08 PM,  <jazz_johnson at verizon.net> wrote:
> On Saturday 17 November 2007, m. allan noah wrote:
> As you can see, there's still one unused parameter in sense_handler(..., void *arg) definition
> and there's a bunch of hs2p scsi commands for which I wrote functions but have not used
> in the main hs2p backend. I also defined some structs for hs2p compression types which I've
> also not used.

ok, lets start by saying that lots of other sane backends produce
warnings, and i am probably running a newer version of gcc than you,
so it's not a requirement that we remove all of them. it's just a pet
peev of mine.

1. if you put a little 'arg = arg;' line in the function, gcc will
shutup about the param.
2. if you wrap the unused functions in #if 0/#endif, you can keep them
for later.

i've applied your patch, but most of the issues remain. see the attached log.

the errors break down into a couple classes:

1. iso C90 or 99 errors, like using new printf formats or extra
semicolons, or mixing your variable declarations with code. these are
the most important to correct, as they will prevent sane from building
on other platforms.

make sure your debug statements are after your variable declarations,
use %ld, etc.

2. assigning non-const to a const pointer.

change max_string_size to take SANE_String_Const, and remove most of the casts.

3. unused vars and functions

4. calling 'sizeof' on a void type. if you know what type it will be, cast it.

5. trash the warning of the function pointer.

6. some functions return SANE_Int, but the caller crams the output
into SANE_Status. Convert to the latter.

7. sometimes you send the fd into do_cancel, other times the struct?


"The truth is an offense, but not a sin"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hs2p-new.log
Type: text/x-log
Size: 4867 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20071119/2b3f6eec/attachment-0001.bin 

More information about the sane-devel mailing list