]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fdefine_fringe_bitmap): Always set 'h'. Simplify.
authorKim F. Storm <storm@cua.dk>
Tue, 16 Nov 2004 15:41:54 +0000 (15:41 +0000)
committerKim F. Storm <storm@cua.dk>
Tue, 16 Nov 2004 15:41:54 +0000 (15:41 +0000)
src/fringe.c

index 3f1b74a78e8a5339d4c356fdb4aac2b266caf3b0..6ebbb334bbb52c3eb6a9dfd8ea2628762420129e 100644 (file)
@@ -1204,7 +1204,6 @@ If BITMAP already exists, the existing definition is replaced.  */)
   (bitmap, bits, height, width, align)
      Lisp_Object bitmap, bits, height, width, align;
 {
-  Lisp_Object len;
   int n, h, i, j;
   unsigned short *b;
   struct fringe_bitmap fb, *xfb;
@@ -1212,20 +1211,21 @@ If BITMAP already exists, the existing definition is replaced.  */)
 
   CHECK_SYMBOL (bitmap);
 
-  if (!STRINGP (bits) && !VECTORP (bits))
-    bits = wrong_type_argument (Qstringp, bits);
-
-  len = Flength (bits);
+  if (STRINGP (bits))
+    h = SCHARS (bits);
+  else if (VECTORP (bits))
+    h = XVECTOR (bits)->size;
+  else
+    bits = wrong_type_argument (Qsequencep, bits);
 
   if (NILP (height))
-    h = fb.height = XINT (len);
+    fb.height = h;
   else
     {
       CHECK_NUMBER (height);
       fb.height = min (XINT (height), 255);
-      if (fb.height > XINT (len))
+      if (fb.height > h)
        {
-         h = XINT (len);
          fill1 = (fb.height - h) / 2;
          fill2 = fb.height - h - fill1;
        }