From ac27180cca90fa1919ba0331e01794602901e7bc Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 3 Feb 2015 18:53:15 -0800 Subject: [PATCH] Remove no-longer-used two_byte_p calculations * dispextern.h (struct glyph_string): Remove member two_byte_p. All uses removed. * xdisp.c (get_glyph_face_and_encoding): Remove arg two_byte_p. All callers changed. --- src/ChangeLog | 8 ++++++++ src/dispextern.h | 3 --- src/xdisp.c | 33 ++++++++++++--------------------- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a1d4c7dbd08..6b56abbafd1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2015-02-04 Paul Eggert + + Remove no-longer-used two_byte_p calculations + * dispextern.h (struct glyph_string): Remove member two_byte_p. + All uses removed. + * xdisp.c (get_glyph_face_and_encoding): Remove arg two_byte_p. + All callers changed. + 2015-02-03 Paul Eggert Omit unnecessary var if GTK or NS diff --git a/src/dispextern.h b/src/dispextern.h index 413947991ec..b0f2944da86 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1306,9 +1306,6 @@ struct glyph_string /* True means the background of this string has been drawn. */ bool_bf background_filled_p : 1; - /* True means glyph string must be drawn with 16-bit functions. */ - bool_bf two_byte_p : 1; - /* True means that the original font determined for drawing this glyph string could not be loaded. The member `font' has been set to the frame's default font in this case. */ diff --git a/src/xdisp.c b/src/xdisp.c index 8f6695ae2b0..3c928f7897a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -24241,7 +24241,7 @@ get_char_face_and_encoding (struct frame *f, int c, int face_id, static struct face * get_glyph_face_and_encoding (struct frame *f, struct glyph *glyph, - XChar2b *char2b, int *two_byte_p) + XChar2b *char2b) { struct face *face; unsigned code = 0; @@ -24253,9 +24253,6 @@ get_glyph_face_and_encoding (struct frame *f, struct glyph *glyph, eassert (face != NULL); prepare_face_for_display (f, face); - if (two_byte_p) - *two_byte_p = 0; - if (face->font) { if (CHAR_BYTE8_P (glyph->u.ch)) @@ -24368,9 +24365,6 @@ fill_composite_glyph_string (struct glyph_string *s, struct face *base_face, /* Adjust base line for subscript/superscript text. */ s->ybase += s->first_glyph->voffset; - /* This glyph string must always be drawn with 16-bit functions. */ - s->two_byte_p = 1; - return s->cmp_to; } @@ -24481,12 +24475,8 @@ fill_glyph_string (struct glyph_string *s, int face_id, && glyph->face_id == face_id && glyph->glyph_not_available_p == glyph_not_available_p) { - int two_byte_p; - s->face = get_glyph_face_and_encoding (s->f, glyph, - s->char2b + s->nchars, - &two_byte_p); - s->two_byte_p = two_byte_p; + s->char2b + s->nchars); ++s->nchars; eassert (s->nchars <= end - start); s->width += glyph->pixel_width; @@ -24600,17 +24590,18 @@ x_get_glyph_overhangs (struct glyph *glyph, struct frame *f, int *left, int *rig if (glyph->type == CHAR_GLYPH) { - struct face *face; XChar2b char2b; - struct font_metrics *pcm; - - face = get_glyph_face_and_encoding (f, glyph, &char2b, NULL); - if (face->font && (pcm = get_per_char_metric (face->font, &char2b))) + struct face *face = get_glyph_face_and_encoding (f, glyph, &char2b); + if (face->font) { - if (pcm->rbearing > pcm->width) - *right = pcm->rbearing - pcm->width; - if (pcm->lbearing < 0) - *left = -pcm->lbearing; + struct font_metrics *pcm = get_per_char_metric (face->font, &char2b); + if (pcm) + { + if (pcm->rbearing > pcm->width) + *right = pcm->rbearing - pcm->width; + if (pcm->lbearing < 0) + *left = -pcm->lbearing; + } } } else if (glyph->type == COMPOSITE_GLYPH) -- 2.39.5