[sane-devel] coolscan2 in 1.0.8

Henning Meier-Geinitz henning@meier-geinitz.de
Sun, 14 Apr 2002 17:53:57 +0200


Hi,

On Sun, Apr 14, 2002 at 04:35:01PM +0100, Major A wrote:
> > * From the code:
> >     sanei_usb_attach_matching_devices ("usb Nikon *", cs2_attach);
> >     sanei_usb_attach_matching_devices ("usb 0x04b0 *", cs2_attach);
> >   
> >   This won't work. The sanei function isn't that intelligent yet. You
> >   can only give vendor and product ids, no "*" and no names. See
> >   http://sanei.meier-geinitz.de/sanei__usb_8h.html#a8 for documentation.
> 
> I have no way of testing this, but from the feedback I got from an
> LS-40 user I thought that this worked (not the first version, but the
> second).

There is no code for ignoring vendor or product ids and it doesn't
work with Mustek scanners. But You are free to add this code in
sanei_usb :-) On the other hand the vendor and product ids are the
only way to detect the type of scanner because there is no inquiry
like with SCSI scanners. So I'm not sure if a "*" makes sense.

> As there is only one USB scanner in question, I've added the
> explicit PID now.

Ok.

> > * There are some compilation warnings. At least those look more serious:
> >     coolscan2.c:1597: warning: unknown conversion type character z' in format
> >     coolscan2.c:1597: warning: unknown conversion type character z' in format
> >     coolscan2.c:1597: warning: too many arguments for format 
> >     coolscan2.c: In function cs2_xmalloc':
> >     coolscan2.c:2264: warning: unknown conversion type character z' in format
> >     coolscan2.c:2264: warning: too many arguments for format
> >     coolscan2.c: In function cs2_xrealloc':
> >     coolscan2.c:2280: warning: unknown conversion type character z' in format
> >     coolscan2.c:2280: warning: too many arguments for format
> 
> These come from the "z" type modifier in the output format string. Is
> there any clean way of printing a size_t without using this modifier,
> which is not supported in ISO C89?

doc/backend-writing.txt says:

* Please do not assume that size_t' is unsigned int'.  On some
  systems, it's unsigned long' and the size of this type may be bigger
  than that of an int (this is true for practially any of the 64-bit
  systems).  To print a variable of type size_t portably, cast the
  variable to u_long and print it with the %lu specifier. E.g.:

     size_t len;
     DBG(3, "len=%lu\n", (u_long) len);

Bye,
  Henning