Hi,

I just found some compiler warnings:

libggi/display/aa/

/bin/sh ../../libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../..
-I../../include     -g -O2 -D_REENTRANT -D_THREAD_SAFE -g -Wall -c mode.c
gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../include -g -O2 -D_REENTRANT
-D_THREAD_SAFE -g -Wall -Wp,-MD,.deps/mode.pp -c  -fPIC -DPIC mode.c -o
mode.lo
mode.c: In function `GGI_aa_setmode':
mode.c:137: warning: implicit declaration of function `memset'
gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../include -g -O2 -D_REENTRANT
-D_THREAD_SAFE -g -Wall -Wp,-MD,.deps/visual.pp -c  -fPIC -DPIC visual.c
-o visual.lo
visual.c: In function `GGIopen':
visual.c:98: warning: implicit declaration of function `GGIdlcleanup'

libggi/display/terminfo/

gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../include -g -O2 -D_REENTRANT
-D_THREAD_SAFE -g -Wall -Wp,-MD,.deps/mode.pp -c  -fPIC -DPIC mode.c -o
mode.lo
mode.c: In function `GGI_terminfo_checkmode':
mode.c:227: warning: `err' might be used uninitialized in this function


I have attached a patch, which fixes that. Anyone here to commit it?


Christoph Egger
E-Mail: [EMAIL PROTECTED]
--- display/aa/mode.c.old       Sat Apr 29 20:04:05 2000
+++ display/aa/mode.c   Sat Apr 29 20:03:21 2000
@@ -28,6 +28,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 #include <ggi/internal/ggi-dl.h>
 #include <ggi/display/aa.h>
--- display/aa/visual.c.old     Sat Apr 29 20:04:12 2000
+++ display/aa/visual.c Sat Apr 29 20:11:43 2000
@@ -41,6 +41,30 @@
        }
 }
 
+static int GGIclose(ggi_visual *vis, struct ggi_dlhandle *dlh)
+{
+       struct AAhooks *priv;
+
+       _GGI_aa_freedbs(vis);
+
+       /* FIXME !!!
+          How? //Marcus */
+       if ((priv = LIBGGI_PRIVATE(vis)) != NULL) {
+               if (priv->context) {
+                       aa_uninitmouse(priv->context);
+                       aa_uninitkbd(priv->context);
+                       aa_close(priv->context);
+               }
+               free(priv->opmansync);          
+               ggLockDestroy(priv->aalock);
+               free(LIBGGI_PRIVATE(vis));
+       }
+
+       free(LIBGGI_GC(vis));
+
+       return 0;
+}
+
 static int GGIopen(ggi_visual *vis, struct ggi_dlhandle *dlh,
                   const char *args, void *argptr, uint32 *dlret)
 {
@@ -95,7 +119,7 @@
                inp = _giiInputAlloc();
                if (inp == NULL) {
                        GGIDPRINT_MISC("display-aa: _giiInputAlloc failed\n");
-                       GGIdlcleanup(vis);
+                       GGIclose(vis, dlh);
                        return GGI_ENOMEM;
                }
                GGIDPRINT_MISC("display-aa: gii inp=%p\n",inp);
@@ -140,31 +164,6 @@
 
        return 0;
 }
-
-static int GGIclose(ggi_visual *vis, struct ggi_dlhandle *dlh)
-{
-       struct AAhooks *priv;
-
-       _GGI_aa_freedbs(vis);
-
-       /* FIXME !!!
-          How? //Marcus */
-       if ((priv = LIBGGI_PRIVATE(vis)) != NULL) {
-               if (priv->context) {
-                       aa_uninitmouse(priv->context);
-                       aa_uninitkbd(priv->context);
-                       aa_close(priv->context);
-               }
-               free(priv->opmansync);          
-               ggLockDestroy(priv->aalock);
-               free(LIBGGI_PRIVATE(vis));
-       }
-
-       free(LIBGGI_GC(vis));
-
-       return 0;
-}
-
 
 int GGIdl_aa(int func, void **funcptr)
 {
--- display/terminfo/mode.c.old Sat Apr 29 20:15:04 2000
+++ display/terminfo/mode.c     Sat Apr 29 20:16:01 2000
@@ -224,7 +224,7 @@
 int GGI_terminfo_checkmode(ggi_visual *vis, ggi_mode *tm)
 {
        struct TIhooks *priv = LIBGGI_PRIVATE(vis);
-       int err;
+       int err = 0;
 
        _terminfo_select_screen(priv->scr);
        if (tm->dpp.x == GGI_AUTO) tm->dpp.x = 8;

Reply via email to