diff src/xfaces.c @ 28464:cad4cc0508a0

Fix Lisp_Object/int type confusion revealed by making Lisp_Object a union type: * xdisp.c (compute_string_pos): Fix order of arguments to string_pos_nchars_ahead. (handle_fontified_prop, add_to_log): Pass int, not Lisp_Object, as count arg to variable-arg routines like Frun_hook_with_args and Fformat. (back_to_previous_visible_line_start, build_desired_tool_bar_string): Pass Lisp_Object, not int, to fixed-arg routines like Fget_char_property and Fmake_string. (reconsider_clip_changes): Use XINT when comparing integer lisp objects, or passing them as int arguments. (mark_window_display_accurate, insert_left_trunc_glyphs, append_space, extend_face_to_end_of_line): Use make_number when storing or passing integer values as lisp objects. (set_cursor_from_row, highlight_trailing_whitespace): Use INTEGERP, not implicit test against zero, for glyph object. (try_window_id): Don't use make_number when we want an int value. * xfaces.c (xlfd_symbolic_value): Make last argument a Lisp_Object, to be consistent with callers. (Fbitmap_spec_p): Use XINT to get numeric value of height. (lface_hash): Apply XFASTINT to lisp values before folding in. * xfns.c (Fx_show_tip): Use make_number to get lisp objects to fill in window width and height. Pass an int, not a lisp object, as first arg to Finsert.
author Ken Raeburn <raeburn@raeburn.org>
date Sat, 01 Apr 2000 12:59:53 +0000
parents b6b552188c57
children b8ac36c58391
line wrap: on
line diff
--- a/src/xfaces.c	Sat Apr 01 12:39:03 2000 +0000
+++ b/src/xfaces.c	Sat Apr 01 12:59:53 2000 +0000
@@ -499,7 +499,8 @@
 static int xlfd_numeric_value P_ ((struct table_entry *, int, struct font_name *,
 				   int, int));
 static Lisp_Object xlfd_symbolic_value P_ ((struct table_entry *, int,
-					    struct font_name *, int, int));
+					    struct font_name *, int,
+					    Lisp_Object));
 static struct table_entry *xlfd_lookup_field_contents P_ ((struct table_entry *, int,
 							   struct font_name *, int));
 
@@ -1008,7 +1009,7 @@
 	{
 	  int bytes_per_row = ((XFASTINT (width) + BITS_PER_CHAR - 1)
 			       / BITS_PER_CHAR);
-	  if (STRING_BYTES (XSTRING (data)) >= bytes_per_row * height)
+	  if (STRING_BYTES (XSTRING (data)) >= bytes_per_row * XINT (height))
 	    pixmap_p = 1;
 	}
     }
@@ -1824,7 +1825,7 @@
      int dim;
      struct font_name *font;
      int field_index;
-     int dflt;
+     Lisp_Object dflt;
 {
   struct table_entry *p;
   p = xlfd_lookup_field_contents (table, dim, font, field_index);
@@ -4455,9 +4456,9 @@
   return (hash_string_case_insensitive (v[LFACE_FAMILY_INDEX])
 	  ^ hash_string_case_insensitive (v[LFACE_FOREGROUND_INDEX])
 	  ^ hash_string_case_insensitive (v[LFACE_BACKGROUND_INDEX])
-	  ^ (unsigned) v[LFACE_WEIGHT_INDEX]
-	  ^ (unsigned) v[LFACE_SLANT_INDEX]
-	  ^ (unsigned) v[LFACE_SWIDTH_INDEX]
+	  ^ XFASTINT (v[LFACE_WEIGHT_INDEX])
+	  ^ XFASTINT (v[LFACE_SLANT_INDEX])
+	  ^ XFASTINT (v[LFACE_SWIDTH_INDEX])
 	  ^ XFASTINT (v[LFACE_HEIGHT_INDEX]));
 }