Contents in 1999-06-04-13 of release-21-2.
[chise/xemacs-chise.git.1] / src / glyphs-x.c
index aed51bf..bbe3cf1 100644 (file)
@@ -124,7 +124,7 @@ convert_EImage_to_XImage (Lisp_Object device, int width, int height,
   Colormap cmap;
   Visual *vis;
   XImage *outimg;
-  int depth, bitmap_pad, byte_cnt, i, j;
+  int depth, bitmap_pad, bits_per_pixel, byte_cnt, i, j;
   int rd,gr,bl,q;
   unsigned char *data, *ip, *dp;
   quant_table *qtable = 0;
@@ -149,13 +149,15 @@ convert_EImage_to_XImage (Lisp_Object device, int width, int height,
   bitmap_pad = ((depth > 16) ? 32 :
                (depth >  8) ? 16 :
                8);
-  byte_cnt = bitmap_pad >> 3;
 
   outimg = XCreateImage (dpy, vis,
                         depth, ZPixmap, 0, 0, width, height,
                         bitmap_pad, 0);
   if (!outimg) return NULL;
 
+  bits_per_pixel = outimg->bits_per_pixel;
+  byte_cnt = bits_per_pixel >> 3;
+
   data = (unsigned char *) xmalloc (outimg->bytes_per_line * height);
   if (!data)
     {
@@ -511,13 +513,13 @@ x_locate_pixmap_file (Lisp_Object name)
 
   {
     Lisp_Object found;
-    if (locate_file (Vx_bitmap_file_path, name, "", &found, R_OK) < 0)
+    if (locate_file (Vx_bitmap_file_path, name, Qnil, &found, R_OK) < 0)
       {
        Lisp_Object temp = list1 (Vdata_directory);
        struct gcpro gcpro1;
 
        GCPRO1 (temp);
-       locate_file (temp, name, "", &found, R_OK);
+       locate_file (temp, name, Qnil, &found, R_OK);
        UNGCPRO;
       }