From http://www.jwz.org/xscreensaver/xscreensaver-5.27.tar.gz
[xscreensaver] / hacks / glx / xpm-ximage.c
index cf600bc7312ed9b618d8f079c01eaef761dba26d..4091c704a68754395f1a18da3f3d9eb8d48828a3 100644 (file)
@@ -334,7 +334,8 @@ xpm_to_ximage_1 (Display *dpy, Visual *visual, Colormap cmap,
 /* Given a bitmask, returns the position and width of the field.
  */
 static void
-decode_mask (unsigned int mask, unsigned int *pos_ret, unsigned int *size_ret)
+decode_mask (unsigned long mask, unsigned long *pos_ret,
+             unsigned long *size_ret)
 {
   int i;
   for (i = 0; i < 32; i++)
@@ -368,9 +369,9 @@ xpm_to_ximage_1 (Display *dpy, Visual *visual, Colormap cmap,
   int npixels = 0;
   int bpl;
 
-  unsigned int rpos=0, gpos=0, bpos=0, apos=0;
-  unsigned int rmsk=0, gmsk=0, bmsk=0, amsk=0;
-  unsigned int rsiz=0, gsiz=0, bsiz=0, asiz=0;
+  unsigned long rpos=0, gpos=0, bpos=0, apos=0;
+  unsigned long rmsk=0, gmsk=0, bmsk=0, amsk=0;
+  unsigned long rsiz=0, gsiz=0, bsiz=0, asiz=0;
 
   if (filename)
     {
@@ -414,7 +415,7 @@ xpm_to_ximage_1 (Display *dpy, Visual *visual, Colormap cmap,
     
       for (x = 0; x < ximage->width; x++)
         {
-          unsigned long pixel = iline[x];
+          unsigned int pixel = iline[x];
           unsigned char r = (pixel & rmsk) >> rpos;
           unsigned char g = (pixel & gmsk) >> gpos;
           unsigned char b = (pixel & bmsk) >> bpos;