X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fxpm-ximage.c;h=ded8bbb5567d19bc7d5c210fd34026533aaae9c4;hb=278c59e14c53fd412b734e699bd4f314f766f804;hp=5913ddddac05b4474b8e34a3a3c20f10badb8ac2;hpb=2a991a811de4c7b22f812682b267b616a809fd9a;p=xscreensaver diff --git a/hacks/glx/xpm-ximage.c b/hacks/glx/xpm-ximage.c index 5913dddd..ded8bbb5 100644 --- a/hacks/glx/xpm-ximage.c +++ b/hacks/glx/xpm-ximage.c @@ -14,16 +14,17 @@ # include "config.h" #endif -#ifdef HAVE_XPM /* whole file */ - #include #include #include -#include -#include extern char *progname; +#ifdef HAVE_XPM /* whole file */ + +#include +#include + static Bool bigendian (void) { @@ -63,6 +64,8 @@ xpm_to_ximage (Display *dpy, Visual *visual, Colormap cmap, char **xpm_data) int bpl, wpl; XColor colors[255]; + memset (&xpm_image, 0, sizeof(xpm_image)); + memset (&xpm_info, 0, sizeof(xpm_info)); result = XpmCreateXpmImageFromData (xpm_data, &xpm_image, &xpm_info); if (result != XpmSuccess) { @@ -122,8 +125,10 @@ xpm_to_ximage (Display *dpy, Visual *visual, Colormap cmap, char **xpm_data) } /* I sure hope these only free the contents, and not the args. */ +#if 0 /* Apparently not? Gotta love those well-documented APIs! */ XpmFreeXpmImage (&xpm_image); XpmFreeXpmInfo (&xpm_info); +#endif return ximage; } @@ -131,7 +136,7 @@ xpm_to_ximage (Display *dpy, Visual *visual, Colormap cmap, char **xpm_data) #else /* !HAVE_XPM */ -static XImage * +XImage * xpm_to_ximage (char **xpm_data) { fprintf(stderr, "%s: not compiled with XPM support.\n", progname);