[sane-devel] Current TODO list

Henning Meier-Geinitz henning@meier-geinitz.de
Mon, 28 Jul 2003 17:05:26 +0200


Hi,

On Mon, Jul 28, 2003 at 09:27:31AM +0200, Thomas Soumarmon wrote:
> Just a few questions : 

> * may the backend be called after a sane_exit() ?

Yes, but only sane_init () again. After that, normal operation can
start again.

> * is this needed for "const" global variables ?

I don't think so. If they are not changed, there is no problem.

> * could you explain me what the problem is with global initialization ?

e.g.

int * some_buffer = 0;

sane_init ()
{
  attach ();
}

attach ()
{
  if (!some_buffer)
    some_buffer = malloc (...);  
}

sane_exit ()
{
  if (some_buffer)
    free (some_buffer);
}

This works once but the second time malloc won't be called. --> crash.
Freeing already freed buffers also can happen if you don't explicitely
set them to 0 in sane_init or sane_exit.

Another example:

SANE_Bool first_scan = SANE_TRUE;

sane_start ()
{
  if (first_scan)
    {
      first_scan = SANE_FALSE;
      turn_lamp_on();
      wait_for_30_seconds_for_lamp_warmup ();
    }    
}

sane_exit ()
{
  turn_lamp_off ();
}

-> after the first sane_exit/sane_init the lamp is not warmed up.

> >   * desc files:
> >     - Change all description files to use the new status keyword:
> >       avision, canon, canon630u, coolscan2, fujitsu,
> >       hp, hp5400, hpsj5s, microtek, microtek2,
> >       plustek, sharp, st400, umax1220u.
> 
> 
> done for hp5400.

There are still some ":status :alpha" lines in your .desc file :-)
Run "make" ind doc/ and grep the warnings for "hp5400".

Bye,
  Henning