On 30 Apr 2000, Marcus Sundberg wrote:

> [EMAIL PROTECTED] (Christoph Egger) writes:
> 
> > I have tested your changes, Marcus.
> 
> Thanks.
> 
> > libgii and libggi compiles very well, except some warnings in one
> > libggi-demo:
> > 
> > gcc -DHAVE_CONFIG_H -I. -I. -I../../.. -I../../../include 
> > -g -O2 -D_REENTRANT -D_THREAD_SAFE -g -Wall -c monitest.c
> > monitest.c: In function `changeresmenu':
> > monitest.c:331: warning: `nextresindex' might be used uninitialized in this 
>function
> > monitest.c:331: warning: `prevresindex' might be used uninitialized in this 
>function
> > monitest.c:332: warning: `nextgtindex' might be used uninitialized in this function
> > monitest.c:332: warning: `prevgtindex' might be used uninitialized in this function
> 
> What compiler is that?

bash:# gcc --version
2.7.2.3
bash:#

> Those variable might not be used uninitialized, and that should be
> obvious to the compiler.
> 
> > I've looked also over the code you changed. I think I found one bug:
> > 
> > diff -uNr degas-old/lib/libggi/display/svgalib/visual.c 
>degas/lib/libggi/display/svgalib/visual.c
> > --- degas-old/lib/libggi/display/svgalib/visual.c       Mon Dec 13 01:10:47 1999
> > +++ degas/lib/libggi/display/svgalib/visual.c   Tue Apr 25 01:07:14 2000
> > 
> > ...
> > 
> > +static int do_cleanup(ggi_visual *vis)
> > +{
> > +       svga_priv *priv = LIBGGI_PRIVATE(vis);
> > +
> > +       /* Restore to text mode */
> > +       _ggi_svgalib_setmode(TEXT);
> > +
> > +       _GGI_svga_freedbs(vis);
> > +
> > +       if (vis->input != NULL) {
> > +               giiClose(vis->input);
> > +               vis->input = NULL;
> > +       }
> > +       if (priv->savepalette) free(priv->savepalette);
> > +
> > +       if (priv) {
> > +               if (priv->availmodes != NULL) {
> > +                       free(priv->availmodes);
> > +               }
> > +               free(priv);
> > +       }
> > +       free(LIBGGI_GC(vis));
> > +
> > +       ggUnregisterCleanup((ggcleanup_func *)do_cleanup, vis);
> > +
> > +       usagecounter--;
> > +
> > +       return 0;
> > +}
> > 
> > This seems to me to be an endless loop, because "usagecounter" is _not_
> > tested, when zero is reached...
> 
> To me it doesn't seem to contain any loop at all, and neither is it
> called from any loop, so I'm not sure what you think the problem is?

I think, the problem is (if I am right), that ggUnregisterCleanup calls
do_cleanup recursively...

Christoph Egger
E-Mail: [EMAIL PROTECTED]

Reply via email to