diff options
| author | Juanma Barranquero | 2011-04-03 01:53:55 +0200 |
|---|---|---|
| committer | Juanma Barranquero | 2011-04-03 01:53:55 +0200 |
| commit | 376a70065683b59834044b6a8431be1232c26fe1 (patch) | |
| tree | 00626d74fb2feebc0d6144a66fb6a61e6c2d6094 /src | |
| parent | da91b5f294f8ec77f48f1bbe27707a0d33d981e9 (diff) | |
| download | emacs-376a70065683b59834044b6a8431be1232c26fe1.tar.gz emacs-376a70065683b59834044b6a8431be1232c26fe1.zip | |
src/xdisp.c: Remove some unused parameters.
* xdisp.c (display_count_lines): Remove parameter `start',
unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
(get_char_face_and_encoding): Remove parameter `multibyte_p',
unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
(fill_stretch_glyph_string): Remove parameters `row' and `area',
unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
and thereabouts. All callers changed.
(get_per_char_metric): Remove parameter `f', unused since
2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 12 | ||||
| -rw-r--r-- | src/xdisp.c | 46 |
2 files changed, 33 insertions, 25 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e96968cd008..a4c28b783b5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2011-04-02 Juanma Barranquero <lekktu@gmail.com> | ||
| 2 | |||
| 3 | * xdisp.c (display_count_lines): Remove parameter `start', | ||
| 4 | unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed. | ||
| 5 | (get_char_face_and_encoding): Remove parameter `multibyte_p', | ||
| 6 | unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed. | ||
| 7 | (fill_stretch_glyph_string): Remove parameters `row' and `area', | ||
| 8 | unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk | ||
| 9 | and thereabouts. All callers changed. | ||
| 10 | (get_per_char_metric): Remove parameter `f', unused since | ||
| 11 | 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed. | ||
| 12 | |||
| 1 | 2011-04-02 Jim Meyering <meyering@redhat.com> | 13 | 2011-04-02 Jim Meyering <meyering@redhat.com> |
| 2 | 14 | ||
| 3 | do not dereference NULL upon failed strdup | 15 | do not dereference NULL upon failed strdup |
diff --git a/src/xdisp.c b/src/xdisp.c index 3c9d38536bb..e6a7f4254ef 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -824,8 +824,7 @@ static int display_mode_element (struct it *, int, int, int, Lisp_Object, Lisp_O | |||
| 824 | static int store_mode_line_string (const char *, Lisp_Object, int, int, int, Lisp_Object); | 824 | static int store_mode_line_string (const char *, Lisp_Object, int, int, int, Lisp_Object); |
| 825 | static const char *decode_mode_spec (struct window *, int, int, Lisp_Object *); | 825 | static const char *decode_mode_spec (struct window *, int, int, Lisp_Object *); |
| 826 | static void display_menu_bar (struct window *); | 826 | static void display_menu_bar (struct window *); |
| 827 | static int display_count_lines (EMACS_INT, EMACS_INT, EMACS_INT, int, | 827 | static int display_count_lines (EMACS_INT, EMACS_INT, int, EMACS_INT *); |
| 828 | EMACS_INT *); | ||
| 829 | static int display_string (const char *, Lisp_Object, Lisp_Object, | 828 | static int display_string (const char *, Lisp_Object, Lisp_Object, |
| 830 | EMACS_INT, EMACS_INT, struct it *, int, int, int, int); | 829 | EMACS_INT, EMACS_INT, struct it *, int, int, int, int); |
| 831 | static void compute_line_metrics (struct it *); | 830 | static void compute_line_metrics (struct it *); |
| @@ -19481,7 +19480,7 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 19481 | } | 19480 | } |
| 19482 | 19481 | ||
| 19483 | /* Count lines from base line to window start position. */ | 19482 | /* Count lines from base line to window start position. */ |
| 19484 | nlines = display_count_lines (linepos, linepos_byte, | 19483 | nlines = display_count_lines (linepos_byte, |
| 19485 | startpos_byte, | 19484 | startpos_byte, |
| 19486 | startpos, &junk); | 19485 | startpos, &junk); |
| 19487 | 19486 | ||
| @@ -19510,7 +19509,7 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 19510 | limit_byte = CHAR_TO_BYTE (limit); | 19509 | limit_byte = CHAR_TO_BYTE (limit); |
| 19511 | } | 19510 | } |
| 19512 | 19511 | ||
| 19513 | nlines = display_count_lines (startpos, startpos_byte, | 19512 | nlines = display_count_lines (startpos_byte, |
| 19514 | limit_byte, | 19513 | limit_byte, |
| 19515 | - (height * 2 + 30), | 19514 | - (height * 2 + 30), |
| 19516 | &position); | 19515 | &position); |
| @@ -19529,7 +19528,7 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 19529 | } | 19528 | } |
| 19530 | 19529 | ||
| 19531 | /* Now count lines from the start pos to point. */ | 19530 | /* Now count lines from the start pos to point. */ |
| 19532 | nlines = display_count_lines (startpos, startpos_byte, | 19531 | nlines = display_count_lines (startpos_byte, |
| 19533 | PT_BYTE, PT, &junk); | 19532 | PT_BYTE, PT, &junk); |
| 19534 | 19533 | ||
| 19535 | /* Record that we did display the line number. */ | 19534 | /* Record that we did display the line number. */ |
| @@ -19699,14 +19698,14 @@ decode_mode_spec (struct window *w, register int c, int field_width, | |||
| 19699 | } | 19698 | } |
| 19700 | 19699 | ||
| 19701 | 19700 | ||
| 19702 | /* Count up to COUNT lines starting from START / START_BYTE. | 19701 | /* Count up to COUNT lines starting from START_BYTE. |
| 19703 | But don't go beyond LIMIT_BYTE. | 19702 | But don't go beyond LIMIT_BYTE. |
| 19704 | Return the number of lines thus found (always nonnegative). | 19703 | Return the number of lines thus found (always nonnegative). |
| 19705 | 19704 | ||
| 19706 | Set *BYTE_POS_PTR to 1 if we found COUNT lines, 0 if we hit LIMIT. */ | 19705 | Set *BYTE_POS_PTR to 1 if we found COUNT lines, 0 if we hit LIMIT. */ |
| 19707 | 19706 | ||
| 19708 | static int | 19707 | static int |
| 19709 | display_count_lines (EMACS_INT start, EMACS_INT start_byte, | 19708 | display_count_lines (EMACS_INT start_byte, |
| 19710 | EMACS_INT limit_byte, int count, | 19709 | EMACS_INT limit_byte, int count, |
| 19711 | EMACS_INT *byte_pos_ptr) | 19710 | EMACS_INT *byte_pos_ptr) |
| 19712 | { | 19711 | { |
| @@ -20470,16 +20469,15 @@ append_glyph_string (struct glyph_string **head, struct glyph_string **tail, | |||
| 20470 | } | 20469 | } |
| 20471 | 20470 | ||
| 20472 | 20471 | ||
| 20473 | /* Get face and two-byte form of character C in face FACE_ID on frame | 20472 | /* Get face and two-byte form of character C in face FACE_ID on frame F. |
| 20474 | F. The encoding of C is returned in *CHAR2B. MULTIBYTE_P non-zero | 20473 | The encoding of C is returned in *CHAR2B. DISPLAY_P non-zero means |
| 20475 | means we want to display multibyte text. DISPLAY_P non-zero means | ||
| 20476 | make sure that X resources for the face returned are allocated. | 20474 | make sure that X resources for the face returned are allocated. |
| 20477 | Value is a pointer to a realized face that is ready for display if | 20475 | Value is a pointer to a realized face that is ready for display if |
| 20478 | DISPLAY_P is non-zero. */ | 20476 | DISPLAY_P is non-zero. */ |
| 20479 | 20477 | ||
| 20480 | static INLINE struct face * | 20478 | static INLINE struct face * |
| 20481 | get_char_face_and_encoding (struct frame *f, int c, int face_id, | 20479 | get_char_face_and_encoding (struct frame *f, int c, int face_id, |
| 20482 | XChar2b *char2b, int multibyte_p, int display_p) | 20480 | XChar2b *char2b, int display_p) |
| 20483 | { | 20481 | { |
| 20484 | struct face *face = FACE_FROM_ID (f, face_id); | 20482 | struct face *face = FACE_FROM_ID (f, face_id); |
| 20485 | 20483 | ||
| @@ -20599,7 +20597,7 @@ fill_composite_glyph_string (struct glyph_string *s, struct face *base_face, | |||
| 20599 | -1, Qnil); | 20597 | -1, Qnil); |
| 20600 | 20598 | ||
| 20601 | face = get_char_face_and_encoding (s->f, c, face_id, | 20599 | face = get_char_face_and_encoding (s->f, c, face_id, |
| 20602 | s->char2b + i, 1, 1); | 20600 | s->char2b + i, 1); |
| 20603 | if (face) | 20601 | if (face) |
| 20604 | { | 20602 | { |
| 20605 | if (! s->face) | 20603 | if (! s->face) |
| @@ -20798,15 +20796,13 @@ fill_image_glyph_string (struct glyph_string *s) | |||
| 20798 | 20796 | ||
| 20799 | /* Fill glyph string S from a sequence of stretch glyphs. | 20797 | /* Fill glyph string S from a sequence of stretch glyphs. |
| 20800 | 20798 | ||
| 20801 | ROW is the glyph row in which the glyphs are found, AREA is the | 20799 | START is the index of the first glyph to consider, |
| 20802 | area within the row. START is the index of the first glyph to | 20800 | END is the index of the last + 1. |
| 20803 | consider, END is the index of the last + 1. | ||
| 20804 | 20801 | ||
| 20805 | Value is the index of the first glyph not in S. */ | 20802 | Value is the index of the first glyph not in S. */ |
| 20806 | 20803 | ||
| 20807 | static int | 20804 | static int |
| 20808 | fill_stretch_glyph_string (struct glyph_string *s, struct glyph_row *row, | 20805 | fill_stretch_glyph_string (struct glyph_string *s, int start, int end) |
| 20809 | enum glyph_row_area area, int start, int end) | ||
| 20810 | { | 20806 | { |
| 20811 | struct glyph *glyph, *last; | 20807 | struct glyph *glyph, *last; |
| 20812 | int voffset, face_id; | 20808 | int voffset, face_id; |
| @@ -20840,7 +20836,7 @@ fill_stretch_glyph_string (struct glyph_string *s, struct glyph_row *row, | |||
| 20840 | } | 20836 | } |
| 20841 | 20837 | ||
| 20842 | static struct font_metrics * | 20838 | static struct font_metrics * |
| 20843 | get_per_char_metric (struct frame *f, struct font *font, XChar2b *char2b) | 20839 | get_per_char_metric (struct font *font, XChar2b *char2b) |
| 20844 | { | 20840 | { |
| 20845 | static struct font_metrics metrics; | 20841 | static struct font_metrics metrics; |
| 20846 | unsigned code = (XCHAR2B_BYTE1 (char2b) << 8) | XCHAR2B_BYTE2 (char2b); | 20842 | unsigned code = (XCHAR2B_BYTE1 (char2b) << 8) | XCHAR2B_BYTE2 (char2b); |
| @@ -20868,7 +20864,7 @@ x_get_glyph_overhangs (struct glyph *glyph, struct frame *f, int *left, int *rig | |||
| 20868 | struct font_metrics *pcm; | 20864 | struct font_metrics *pcm; |
| 20869 | 20865 | ||
| 20870 | face = get_glyph_face_and_encoding (f, glyph, &char2b, NULL); | 20866 | face = get_glyph_face_and_encoding (f, glyph, &char2b, NULL); |
| 20871 | if (face->font && (pcm = get_per_char_metric (f, face->font, &char2b))) | 20867 | if (face->font && (pcm = get_per_char_metric (face->font, &char2b))) |
| 20872 | { | 20868 | { |
| 20873 | if (pcm->rbearing > pcm->width) | 20869 | if (pcm->rbearing > pcm->width) |
| 20874 | *right = pcm->rbearing - pcm->width; | 20870 | *right = pcm->rbearing - pcm->width; |
| @@ -21102,7 +21098,7 @@ compute_overhangs_and_x (struct glyph_string *s, int x, int backward_p) | |||
| 21102 | { \ | 21098 | { \ |
| 21103 | s = (struct glyph_string *) alloca (sizeof *s); \ | 21099 | s = (struct glyph_string *) alloca (sizeof *s); \ |
| 21104 | INIT_GLYPH_STRING (s, NULL, w, row, area, START, HL); \ | 21100 | INIT_GLYPH_STRING (s, NULL, w, row, area, START, HL); \ |
| 21105 | START = fill_stretch_glyph_string (s, row, area, START, END); \ | 21101 | START = fill_stretch_glyph_string (s, START, END); \ |
| 21106 | append_glyph_string (&HEAD, &TAIL, s); \ | 21102 | append_glyph_string (&HEAD, &TAIL, s); \ |
| 21107 | s->x = (X); \ | 21103 | s->x = (X); \ |
| 21108 | } \ | 21104 | } \ |
| @@ -22475,7 +22471,7 @@ x_produce_glyphs (struct it *it) | |||
| 22475 | 22471 | ||
| 22476 | if (get_char_glyph_code (it->char_to_display, font, &char2b)) | 22472 | if (get_char_glyph_code (it->char_to_display, font, &char2b)) |
| 22477 | { | 22473 | { |
| 22478 | pcm = get_per_char_metric (it->f, font, &char2b); | 22474 | pcm = get_per_char_metric (font, &char2b); |
| 22479 | if (pcm->width == 0 | 22475 | if (pcm->width == 0 |
| 22480 | && pcm->rbearing == 0 && pcm->lbearing == 0) | 22476 | && pcm->rbearing == 0 && pcm->lbearing == 0) |
| 22481 | pcm = NULL; | 22477 | pcm = NULL; |
| @@ -22777,8 +22773,8 @@ x_produce_glyphs (struct it *it) | |||
| 22777 | if (! font_not_found_p) | 22773 | if (! font_not_found_p) |
| 22778 | { | 22774 | { |
| 22779 | get_char_face_and_encoding (it->f, c, it->face_id, | 22775 | get_char_face_and_encoding (it->f, c, it->face_id, |
| 22780 | &char2b, it->multibyte_p, 0); | 22776 | &char2b, 0); |
| 22781 | pcm = get_per_char_metric (it->f, font, &char2b); | 22777 | pcm = get_per_char_metric (font, &char2b); |
| 22782 | } | 22778 | } |
| 22783 | 22779 | ||
| 22784 | /* Initialize the bounding box. */ | 22780 | /* Initialize the bounding box. */ |
| @@ -22838,8 +22834,8 @@ x_produce_glyphs (struct it *it) | |||
| 22838 | else | 22834 | else |
| 22839 | { | 22835 | { |
| 22840 | get_char_face_and_encoding (it->f, ch, face_id, | 22836 | get_char_face_and_encoding (it->f, ch, face_id, |
| 22841 | &char2b, it->multibyte_p, 0); | 22837 | &char2b, 0); |
| 22842 | pcm = get_per_char_metric (it->f, font, &char2b); | 22838 | pcm = get_per_char_metric (font, &char2b); |
| 22843 | } | 22839 | } |
| 22844 | if (! pcm) | 22840 | if (! pcm) |
| 22845 | cmp->offsets[i * 2] = cmp->offsets[i * 2 + 1] = 0; | 22841 | cmp->offsets[i * 2] = cmp->offsets[i * 2 + 1] = 0; |