Mercurial > emacs
diff src/xdisp.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 | a568b23317fe |
children | 918f12c5c8e3 |
line wrap: on
line diff
--- a/src/xdisp.c Sat Apr 01 12:39:03 2000 +0000 +++ b/src/xdisp.c Sat Apr 01 12:59:53 2000 +0000 @@ -1021,8 +1021,8 @@ xassert (CHARPOS (*newpos) >= CHARPOS (pos)); if (STRING_MULTIBYTE (string)) - *newpos = string_pos_nchars_ahead (pos, CHARPOS (*newpos) - CHARPOS (pos), - string); + *newpos = string_pos_nchars_ahead (pos, string, + CHARPOS (*newpos) - CHARPOS (pos)); else BYTEPOS (*newpos) = CHARPOS (*newpos); } @@ -1786,7 +1786,7 @@ /* Run the hook functions. */ args[0] = Qfontification_functions; args[1] = pos; - Frun_hook_with_args (make_number (2), args); + Frun_hook_with_args (2, args); /* Return HANDLED_RECOMPUTE_PROPS only if function fontified something. This avoids an endless loop if they failed to @@ -3033,7 +3033,8 @@ { Lisp_Object prop; - prop = Fget_char_property (IT_CHARPOS (*it), Qinvisible, it->window); + prop = Fget_char_property (make_number (IT_CHARPOS (*it)), + Qinvisible, it->window); if (TEXT_PROP_MEANS_INVISIBLE (prop)) visible_p = 0; } @@ -4669,7 +4670,7 @@ args[0] = fmt = build_string (format); args[1] = arg1; args[2] = arg2; - msg = Fformat (make_number (3), args); + msg = Fformat (3, args); len = STRING_BYTES (XSTRING (msg)) + 1; buffer = (char *) alloca (len); @@ -6463,7 +6464,8 @@ /* Reuse f->desired_tool_bar_string, if possible. */ if (size < size_needed) - f->desired_tool_bar_string = Fmake_string (make_number (size_needed), ' '); + f->desired_tool_bar_string = Fmake_string (make_number (size_needed), + make_number (' ')); else { props = list4 (Qdisplay, Qnil, Qmenu_item, Qnil); @@ -7115,9 +7117,9 @@ pt = marker_position (w->pointm); if ((w->current_matrix->buffer != XBUFFER (w->buffer) - || pt != w->last_point) + || pt != XINT (w->last_point)) && check_point_in_composition (w->current_matrix->buffer, - w->last_point, + XINT (w->last_point), XBUFFER (w->buffer), pt)) b->clip_changed = 1; } @@ -7893,9 +7895,9 @@ w->last_cursor = w->cursor; w->last_cursor_off_p = w->cursor_off_p; if (w == XWINDOW (selected_window)) - w->last_point = BUF_PT (b); + w->last_point = make_number (BUF_PT (b)); else - w->last_point = XMARKER (w->pointm)->charpos; + w->last_point = make_number (XMARKER (w->pointm)->charpos); } } @@ -8014,7 +8016,7 @@ frames. */ if (row->displays_text_p) while (glyph < end - && !glyph->object + && INTEGERP (glyph->object) && glyph->charpos < 0) { x += glyph->pixel_width; @@ -8022,7 +8024,7 @@ } while (glyph < end - && glyph->object + && !INTEGERP (glyph->object) && (!BUFFERP (glyph->object) || glyph->charpos < pt_old)) { @@ -10033,7 +10035,7 @@ w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); w->window_end_bytepos - = make_number (Z_BYTE - MATRIX_ROW_END_BYTEPOS (row)); + = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); return 1; } @@ -10047,7 +10049,7 @@ w->window_end_pos = make_number (Z - MATRIX_ROW_END_CHARPOS (row)); w->window_end_bytepos - = make_number (Z_BYTE - MATRIX_ROW_END_BYTEPOS (row)); + = Z_BYTE - MATRIX_ROW_END_BYTEPOS (row); return 1; } @@ -10778,7 +10780,7 @@ truncate_it.glyph_row = &scratch_glyph_row; truncate_it.glyph_row->used[TEXT_AREA] = 0; CHARPOS (truncate_it.position) = BYTEPOS (truncate_it.position) = -1; - truncate_it.object = 0; + truncate_it.object = make_number (0); produce_special_glyphs (&truncate_it, IT_TRUNCATION); /* Overwrite glyphs from IT with truncation glyphs. */ @@ -10936,7 +10938,7 @@ it->what = IT_CHARACTER; bzero (&it->position, sizeof it->position); - it->object = 0; + it->object = make_number (0); it->c = ' '; it->len = 1; @@ -11023,7 +11025,7 @@ it->what = IT_CHARACTER; bzero (&it->position, sizeof it->position); - it->object = 0; + it->object = make_number (0); it->c = ' '; it->len = 1; @@ -11084,7 +11086,7 @@ cursor at the end of a line. */ if (glyph->type == CHAR_GLYPH && glyph->u.ch == ' ' - && glyph->object == 0) + && INTEGERP (glyph->object)) --glyph; /* If last glyph is a space or stretch, and it's trailing