[sane-devel] DLL backend doesn't work on 680x0 machines

Henning Meier-Geinitz henning at meier-geinitz.de
Sun Apr 13 14:25:53 BST 2003


Hi,

On Sat, Apr 12, 2003 at 08:09:22PM -0500, Dave Huang wrote:
> On Sat, Apr 12, 2003 at 01:51:11PM +0200, Henning Meier-Geinitz wrote:
> > But this is with "./configure --enable-warnings", the default setting
> > in the CVS version of SANE.
> 
> Ah, okay... I used --enable-warnings and see the warnings now :)
> It's complaining about the casts not having a full prototype for the
> function arguments. Changing
>   status = (*(SANE_Status(*)())be->op[OP_INIT]) (&version, auth_callback);
> to
>   status = (*(SANE_Status(*)(SANE_Int *, SANE_Auth_Callback))be->op[OP_INIT]) (&version, auth_callback);
> 
> fixes the warning. However, it's messy and hard to read :) David 
> Stevenson's suggestion to use typedefs is a good one... so what about 
> the following patch?

I think that one is ok. Thanks. I'll do some more testing on different
platforms but I don't expect problems.

> Also, a question about sane_open()... its second argument is declared as
> SANE_Handle * in the backends, but the dll backend is passing &handle,
> which is a SANE_Handle **.

You are right. You've found a very old bug. It hasn't caused trouble
because a pointer to a pointer is still a pointer but anyway, the fix
is simple:

Use
  SANE_Handle handle;
instead of
  SANE_Handle *handle;

in sane_open().

I have fixed some more warnings that happen with static linking.

Could you please try on your 68k system if compiling with ./configure
--disable-shared also works? I'll attach the complete dll backend
because there have been some other (minor) changes.

I've applied the code to CVS now.

Bye,
  Henning
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dll.c.gz
Type: application/octet-stream
Size: 7932 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/sane-devel/attachments/20030413/d42969dc/attachment.obj>


More information about the sane-devel mailing list