diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2014-08-25 11:00:42 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2014-08-25 11:00:42 +0400 |
commit | 8661ebaa6c0ef3f9517c5288855657b274c723d6 (patch) | |
tree | 98c72571f410d28d3228cb30ea68dadf49f36860 /src/nsfont.m | |
parent | 90c5c87753fb69dafd664615558fa3fdce3ba5b1 (diff) | |
download | emacs-8661ebaa6c0ef3f9517c5288855657b274c723d6.tar.gz |
One more minor cleanup of font subsystem.
* font.h (struct font_driver): Convert text_extents to
return void because returned value is never actually used.
* macfont.c (macfont_text_extents):
* w32font.c (w32font_text_extents):
* xftfont.c (xftfont_text_extents): Adjust to return void
and assume that 'metrics' argument is always non-NULL.
* ftfont.c (ftfont_text_extents):
* xfont.c (xfont_text_extents): Likewise. Avoid redundant memset.
Diffstat (limited to 'src/nsfont.m')
-rw-r--r-- | src/nsfont.m | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/nsfont.m b/src/nsfont.m index 98c25fcdedd..202ebe10c97 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -627,8 +627,8 @@ static Lisp_Object nsfont_open (struct frame *f, Lisp_Object font_entity, static void nsfont_close (struct font *font); static int nsfont_has_char (Lisp_Object entity, int c); static unsigned int nsfont_encode_char (struct font *font, int c); -static int nsfont_text_extents (struct font *font, unsigned int *code, - int nglyphs, struct font_metrics *metrics); +static void nsfont_text_extents (struct font *font, unsigned int *code, + int nglyphs, struct font_metrics *metrics); static int nsfont_draw (struct glyph_string *s, int from, int to, int x, int y, bool with_background); @@ -988,9 +988,9 @@ nsfont_encode_char (struct font *font, int c) /* Perform the size computation of glyphs of FONT and fill in members of METRICS. The glyphs are specified by their glyph codes in CODE (length NGLYPHS). */ -static int -nsfont_text_extents (struct font *font, unsigned int *code, int nglyphs, - struct font_metrics *metrics) +static void +nsfont_text_extents (struct font *font, unsigned int *code, + int nglyphs, struct font_metrics *metrics) { struct nsfont_info *font_info = (struct nsfont_info *)font; struct font_metrics *pcm; @@ -1000,7 +1000,7 @@ nsfont_text_extents (struct font *font, unsigned int *code, int nglyphs, memset (metrics, 0, sizeof (struct font_metrics)); - for (i =0; i<nglyphs; i++) + for (i = 0; i < nglyphs; i++) { /* get metrics for this glyph, filling cache if need be */ /* TODO: get metrics for whole string from an NSLayoutManager @@ -1024,8 +1024,6 @@ nsfont_text_extents (struct font *font, unsigned int *code, int nglyphs, } metrics->width = totalWidth; - - return totalWidth; /* not specified in doc, but xfont.c does it */ } |