[sane-devel] uninitialized variables in sane-backends
Stéphane VOLTZ
stefdev at modulonet.fr
Thu Jan 5 20:42:11 UTC 2006
Le Jeudi 5 Janvier 2006 13:57, Johannes Meixner a écrit :
> Hello,
>
> in sane-backends 1.0.17 our compiler recognized the following
> uninitialized variables which I simply initialized with 0:
> ===================================================================
> --- backend/umax_pp_low.c.orig 2004-10-08 12:01:29.000000000 +0200
> +++ backend/umax_pp_low.c 2005-05-17 15:01:59.000000000 +0200
> @@ -6136,7 +6136,7 @@
> int
> sanei_umax_pp_initScanner (int recover)
> {
> - int i, j;
> + int i, j = 0;
> int status;
> int readcmd[64];
> /* in umax1220u, this buffer is opc[16] */
> --- backend/genesys.c.orig 2006-01-03 11:57:23.000000000 +0100
> +++ backend/genesys.c 2006-01-03 12:04:25.000000000 +0100
> @@ -2686,7 +2686,7 @@
> u_int8_t channels;
> int x, j, o;
> unsigned int i;
> - unsigned int coeff, target_code, val, avgpixels, dk, words_per_color;
> + unsigned int coeff, target_code, val, avgpixels, dk, words_per_color =
> 0;
>
> DBG (DBG_proc, "genesys_send_shading_coefficient\n");
>
> ===================================================================
>
> In umax_pp_low.c in it seems j is incremented but never used
> so that it might be better to remove j at all.
I removed this now unused variable. It is in CVS by now.
>
>
> Kind Regards
> Johannes Meixner
> --
> SUSE LINUX Products GmbH, Maxfeldstrasse 5 Mail: jsmeix at suse.de
> 90409 Nuernberg, Germany WWW: http://www.suse.de/
Regards,
Stef
More information about the sane-devel
mailing list