diff options
| author | Dmitry Antipov | 2012-07-11 08:31:53 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-07-11 08:31:53 +0400 |
| commit | 984e7f300ef0bfec7be97c9bbaff5a6295a43aa2 (patch) | |
| tree | 579e8e59109167073410ec78ea8c0ce5479c901f /src/font.h | |
| parent | 9d596af370080cba1e67978018d72a836dba008a (diff) | |
| download | emacs-984e7f300ef0bfec7be97c9bbaff5a6295a43aa2.tar.gz emacs-984e7f300ef0bfec7be97c9bbaff5a6295a43aa2.zip | |
Avoid calls to strlen in font processing functions.
* font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
(font_open_by_name): Changed to use length argument. Adjust
users accordingly.
* font.h (font_open_by_name, font_parse_xlfd): Adjust prototypes.
* xfont.c (xfont_decode_coding_xlfd): Changed to return ptrdiff_t.
(xfont_list_pattern, xfont_match): Use length returned by
xfont_decode_coding_xlfd.
* xfns.c (x_default_font_parameter): Omit useless xstrdup.
Diffstat (limited to 'src/font.h')
| -rw-r--r-- | src/font.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/font.h b/src/font.h index adb2566327c..11329daa6e7 100644 --- a/src/font.h +++ b/src/font.h | |||
| @@ -771,7 +771,7 @@ extern void font_prepare_for_face (FRAME_PTR f, struct face *face); | |||
| 771 | extern void font_done_for_face (FRAME_PTR f, struct face *face); | 771 | extern void font_done_for_face (FRAME_PTR f, struct face *face); |
| 772 | 772 | ||
| 773 | extern Lisp_Object font_open_by_spec (FRAME_PTR f, Lisp_Object spec); | 773 | extern Lisp_Object font_open_by_spec (FRAME_PTR f, Lisp_Object spec); |
| 774 | extern Lisp_Object font_open_by_name (FRAME_PTR f, const char *name); | 774 | extern Lisp_Object font_open_by_name (FRAME_PTR f, const char *name, ptrdiff_t len); |
| 775 | 775 | ||
| 776 | extern Lisp_Object font_intern_prop (const char *str, ptrdiff_t len, | 776 | extern Lisp_Object font_intern_prop (const char *str, ptrdiff_t len, |
| 777 | int force_symbol); | 777 | int force_symbol); |
| @@ -781,7 +781,7 @@ extern void font_parse_family_registry (Lisp_Object family, | |||
| 781 | Lisp_Object registry, | 781 | Lisp_Object registry, |
| 782 | Lisp_Object spec); | 782 | Lisp_Object spec); |
| 783 | 783 | ||
| 784 | extern int font_parse_xlfd (char *name, Lisp_Object font); | 784 | extern int font_parse_xlfd (char *name, ptrdiff_t len, Lisp_Object font); |
| 785 | extern int font_unparse_xlfd (Lisp_Object font, int pixel_size, | 785 | extern int font_unparse_xlfd (Lisp_Object font, int pixel_size, |
| 786 | char *name, int bytes); | 786 | char *name, int bytes); |
| 787 | extern int font_unparse_fcname (Lisp_Object font, int pixel_size, | 787 | extern int font_unparse_fcname (Lisp_Object font, int pixel_size, |