comparison src/glyphs.c @ 5438:8d29f1c4bb98

Merge with 21.5 trunk.
author Mats Lidell <matsl@xemacs.org>
date Fri, 26 Nov 2010 06:43:36 +0100
parents 308d34e9f07d c096d8051f89
children 56144c8593a8
comparison
equal deleted inserted replaced
5437:002cb5224e4f 5438:8d29f1c4bb98
2626 If not, signal an error. */ 2626 If not, signal an error. */
2627 2627
2628 static void 2628 static void
2629 check_valid_xbm_inline (Lisp_Object data) 2629 check_valid_xbm_inline (Lisp_Object data)
2630 { 2630 {
2631 Lisp_Object width, height, bits; 2631 Lisp_Object width, height, bits, args[2];
2632 2632
2633 if (!CONSP (data) || 2633 if (!CONSP (data) ||
2634 !CONSP (XCDR (data)) || 2634 !CONSP (XCDR (data)) ||
2635 !CONSP (XCDR (XCDR (data))) || 2635 !CONSP (XCDR (XCDR (data))) ||
2636 !NILP (XCDR (XCDR (XCDR (data))))) 2636 !NILP (XCDR (XCDR (XCDR (data)))))
2646 invalid_argument ("Width must be a natural number", width); 2646 invalid_argument ("Width must be a natural number", width);
2647 2647
2648 if (!NATNUMP (height)) 2648 if (!NATNUMP (height))
2649 invalid_argument ("Height must be a natural number", height); 2649 invalid_argument ("Height must be a natural number", height);
2650 2650
2651 if (((XINT (width) * XINT (height)) / 8) > string_char_length (bits)) 2651 args[0] = width;
2652 args[1] = height;
2653
2654 args[0] = Ftimes (countof (args), args);
2655 args[1] = make_integer (8);
2656
2657 args[0] = Fquo (countof (args), args);
2658 args[1] = make_integer (string_char_length (bits));
2659
2660 if (!NILP (Fgtr (countof (args), args)))
2652 invalid_argument ("data is too short for width and height", 2661 invalid_argument ("data is too short for width and height",
2653 vector3 (width, height, bits)); 2662 vector3 (width, height, bits));
2654 } 2663 }
2655 2664
2656 /* Validate method for XBM's. */ 2665 /* Validate method for XBM's. */