[XForms] JPEG/EXIF support?

Angus Leeming angus.leeming at btopenworld.com
Thu Nov 27 07:00:59 EST 2003


On Thursday 27 November 2003 11:32 am, Jean-Marc Lasgouttes wrote:
> Angus> Then I shall commit it. Many thanks to you both, Angus
>
> tru64 cc does not think that this code is OK:
>
> cc -std1 -DHAVE_CONFIG_H -I. -I../../xforms/image -I../lib -DMAKING_FORMS
> -I../lib -I../../xforms/lib -I/afs/rocq/home/preval/common/include
> -I/usr/local/include -g -c -MD ../../xforms/image/image_gif.c  -DPIC -o
> .libs/image_gif.lo cc: Warning: ../../xforms/image/image_gif.c, line 672:
> The scalar variable "incode" is fetched but not initialized. (uninit1)
> flush_buffer(im, incode);
> -------------------------^
>
> Indeed, if I read process_lzw_code correctly, the variable incode is
> not always initialized. Since I do not understand what it stands for,
> I cannot propose a fix, but obviously this needs to be fixed in some
> way.

Reading the code again

static void flush_buffer(FL_IMAGE * im, int incode)
{
    int i;
    incode = lbuf - lhead;
    ...

Ie, the first thing that is done in flush_buffer is set incode. So, we have 
two options:
* do not pass incode to the routine and have a local variable instead
* pass a pointer to incode.

Since the variable incode in process_lzw_code is not static and flush_buffer 
is the last thing called before returning from process_lzw_code, I think that 
the first option is sufficient. See attached patch.

Angus


-------------- next part --------------
A non-text attachment was scrubbed...
Name: image_giff.diff
Type: text/x-diff
Size: 1028 bytes
Desc: not available
Url : attachments/20031127/99303652/attachment-0010.bin 


More information about the Xforms mailing list