http://www.ibiblio.org/pub/historic-linux/ftp-archives/sunsite.unc.edu/Sep-29-1996...
[xscreensaver] / hacks / imsmap.c
index 8c36bccbe5351f29736b99698c0640e8ce84db52..7a619b94e14817f8c5046588fb06a8fe777b64b2 100644 (file)
@@ -49,8 +49,8 @@ initwin (dsp, win)
   enum mode_t this_mode;
   static Bool rv_p;
   static int ncolors = 0;
-  int shift;
-  double dshift;
+  int shift = 0;
+  double dshift = 0;
     
   XGCValues gcv;
 
@@ -139,12 +139,10 @@ initwin (dsp, win)
        }
       else
        {
+         XQueryColor (dsp, cmap, &fg_color);
+         XQueryColor (dsp, cmap, &bg_color);
          fg_color.pixel = fg_pixel;
-         if (! XQueryColor (dsp, cmap, &fg_color))
-           abort ();
          bg_color.pixel = bg_pixel;
-         if (! XQueryColor (dsp, cmap, &bg_color))
-           abort ();
        }
       fg_color.flags = DoRed|DoGreen|DoBlue;
       bg_color.flags = DoRed|DoGreen|DoBlue;
@@ -369,7 +367,7 @@ static void
 cycle (dpy)
      Display *dpy;
 {
-  XColor *colors = malloc (npixels * sizeof (XColor));
+  XColor *colors = (XColor *) malloc (npixels * sizeof (XColor));
   time_t stop;
   int i;
   for (i = 0; i < npixels; i++)
@@ -394,8 +392,8 @@ cycle (dpy)
 char *progclass = "Imsmap";
 
 char *defaults [] = {
-  "*background:        black",
-  "*foreground:        black",
+  "Imsmap.background:  black",         /* to placate SGI */
+  "Imsmap.foreground:  black",
   "*mode:      random",
   "*ncolors:   50",
   "*iterations:        7",