aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2004-04-18 01:08:46 +0000
committerKaroly Lorentey2004-04-18 01:08:46 +0000
commit6839f1e289a61989536a4f45922cc60083a3ca19 (patch)
tree9089500d25c00e6e86702021b3d7cb39bf773ec5 /src
parent2a0c7b06f718bdbe837f5e0cd05ba1f164b03420 (diff)
downloademacs-6839f1e289a61989536a4f45922cc60083a3ca19.tar.gz
emacs-6839f1e289a61989536a4f45922cc60083a3ca19.zip
Fix segfault in term.c (reported by lukhas@free.fr).
src/term.c: Convert redisplay functions to use ANSI prototypes. (tty_ins_del_lines): Add frame parameter to raw_cursor_to (reported by lukhas@free.fr). git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-142
Diffstat (limited to 'src')
-rw-r--r--src/term.c67
1 files changed, 20 insertions, 47 deletions
diff --git a/src/term.c b/src/term.c
index 13c8e036ea4..c378b5078fa 100644
--- a/src/term.c
+++ b/src/term.c
@@ -272,16 +272,14 @@ tty_reset_terminal_modes (struct display *display)
272} 272}
273 273
274void 274void
275update_begin (f) 275update_begin (struct frame *f)
276 struct frame *f;
277{ 276{
278 if (FRAME_DISPLAY (f)->update_begin_hook) 277 if (FRAME_DISPLAY (f)->update_begin_hook)
279 (*FRAME_DISPLAY (f)->update_begin_hook) (f); 278 (*FRAME_DISPLAY (f)->update_begin_hook) (f);
280} 279}
281 280
282void 281void
283update_end (f) 282update_end (struct frame *f)
284 struct frame *f;
285{ 283{
286 if (FRAME_DISPLAY (f)->update_end_hook) 284 if (FRAME_DISPLAY (f)->update_end_hook)
287 (*FRAME_DISPLAY (f)->update_end_hook) (f); 285 (*FRAME_DISPLAY (f)->update_end_hook) (f);
@@ -306,9 +304,7 @@ tty_update_end (struct frame *f)
306 that is bounded by calls to update_begin and update_end. */ 304 that is bounded by calls to update_begin and update_end. */
307 305
308void 306void
309set_terminal_window (f, size) 307set_terminal_window (struct frame *f, int size)
310 struct frame *f;
311 int size;
312{ 308{
313 if (FRAME_DISPLAY (f)->set_terminal_window_hook) 309 if (FRAME_DISPLAY (f)->set_terminal_window_hook)
314 (*FRAME_DISPLAY (f)->set_terminal_window_hook) (f, size); 310 (*FRAME_DISPLAY (f)->set_terminal_window_hook) (f, size);
@@ -327,9 +323,7 @@ tty_set_terminal_window (struct frame *f, int size)
327} 323}
328 324
329void 325void
330set_scroll_region (f, start, stop) 326set_scroll_region (struct frame *f, int start, int stop)
331 struct frame *f;
332 int start, stop;
333{ 327{
334 char *buf; 328 char *buf;
335 struct tty_display_info *tty = FRAME_TTY (f); 329 struct tty_display_info *tty = FRAME_TTY (f);
@@ -450,9 +444,7 @@ highlight_if_desired (struct tty_display_info *tty)
450 frame-relative coordinates. */ 444 frame-relative coordinates. */
451 445
452void 446void
453cursor_to (f, vpos, hpos) 447cursor_to (struct frame *f, int vpos, int hpos)
454 struct frame *f;
455 int vpos, hpos;
456{ 448{
457 if (FRAME_DISPLAY (f)->cursor_to_hook) 449 if (FRAME_DISPLAY (f)->cursor_to_hook)
458 (*FRAME_DISPLAY (f)->cursor_to_hook) (f, vpos, hpos); 450 (*FRAME_DISPLAY (f)->cursor_to_hook) (f, vpos, hpos);
@@ -481,9 +473,7 @@ tty_cursor_to (struct frame *f, int vpos, int hpos)
481/* Similar but don't take any account of the wasted characters. */ 473/* Similar but don't take any account of the wasted characters. */
482 474
483void 475void
484raw_cursor_to (f, row, col) 476raw_cursor_to (struct frame *f, int row, int col)
485 struct frame *f;
486 int row, col;
487{ 477{
488 if (FRAME_DISPLAY (f)->raw_cursor_to_hook) 478 if (FRAME_DISPLAY (f)->raw_cursor_to_hook)
489 (*FRAME_DISPLAY (f)->raw_cursor_to_hook) (f, row, col); 479 (*FRAME_DISPLAY (f)->raw_cursor_to_hook) (f, row, col);
@@ -572,9 +562,7 @@ tty_clear_frame (struct frame *f)
572 Note that the cursor may be moved, on terminals lacking a `ce' string. */ 562 Note that the cursor may be moved, on terminals lacking a `ce' string. */
573 563
574void 564void
575clear_end_of_line (f, first_unused_hpos) 565clear_end_of_line (struct frame *f, int first_unused_hpos)
576 struct frame *f;
577 int first_unused_hpos;
578{ 566{
579 if (FRAME_DISPLAY (f)->clear_end_of_line_hook) 567 if (FRAME_DISPLAY (f)->clear_end_of_line_hook)
580 (*FRAME_DISPLAY (f)->clear_end_of_line_hook) (f, first_unused_hpos); 568 (*FRAME_DISPLAY (f)->clear_end_of_line_hook) (f, first_unused_hpos);
@@ -735,10 +723,7 @@ encode_terminal_code (src, dst, src_len, dst_len, consumed)
735 Advance the nominal cursor over the text. */ 723 Advance the nominal cursor over the text. */
736 724
737void 725void
738write_glyphs (f, string, len) 726write_glyphs (struct frame *f, struct glyph *string, int len)
739 struct frame *f;
740 register struct glyph *string;
741 register int len;
742{ 727{
743 if (FRAME_DISPLAY (f)->write_glyphs_hook) 728 if (FRAME_DISPLAY (f)->write_glyphs_hook)
744 (*FRAME_DISPLAY (f)->write_glyphs_hook) (f, string, len); 729 (*FRAME_DISPLAY (f)->write_glyphs_hook) (f, string, len);
@@ -842,10 +827,7 @@ tty_write_glyphs (struct frame *f, struct glyph *string, int len)
842 If start is zero, insert blanks instead of a string at start */ 827 If start is zero, insert blanks instead of a string at start */
843 828
844void 829void
845insert_glyphs (f, start, len) 830insert_glyphs (struct frame *f, struct glyph *start, int len)
846 struct frame *f;
847 register struct glyph *start;
848 register int len;
849{ 831{
850 if (len <= 0) 832 if (len <= 0)
851 return; 833 return;
@@ -939,9 +921,7 @@ tty_insert_glyphs (struct frame *f, struct glyph *start, int len)
939/* Delete N glyphs at the nominal cursor position. */ 921/* Delete N glyphs at the nominal cursor position. */
940 922
941void 923void
942delete_glyphs (f, n) 924delete_glyphs (struct frame *f, int n)
943 struct frame *f;
944 register int n;
945{ 925{
946 if (FRAME_DISPLAY (f)->delete_glyphs_hook) 926 if (FRAME_DISPLAY (f)->delete_glyphs_hook)
947 (*FRAME_DISPLAY (f)->delete_glyphs_hook) (f, n); 927 (*FRAME_DISPLAY (f)->delete_glyphs_hook) (f, n);
@@ -983,9 +963,7 @@ tty_delete_glyphs (struct frame *f, int n)
983/* Insert N lines at vpos VPOS. If N is negative, delete -N lines. */ 963/* Insert N lines at vpos VPOS. If N is negative, delete -N lines. */
984 964
985void 965void
986ins_del_lines (f, vpos, n) 966ins_del_lines (struct frame *f, int vpos, int n)
987 struct frame *f;
988 int vpos, n;
989{ 967{
990 if (FRAME_DISPLAY (f)->ins_del_lines_hook) 968 if (FRAME_DISPLAY (f)->ins_del_lines_hook)
991 (*FRAME_DISPLAY (f)->ins_del_lines_hook) (f, vpos, n); 969 (*FRAME_DISPLAY (f)->ins_del_lines_hook) (f, vpos, n);
@@ -1020,7 +998,7 @@ tty_ins_del_lines (struct frame *f, int vpos, int n)
1020 998
1021 if (multi) 999 if (multi)
1022 { 1000 {
1023 raw_cursor_to (vpos, 0); 1001 raw_cursor_to (f, vpos, 0);
1024 background_highlight (tty); 1002 background_highlight (tty);
1025 buf = tparam (multi, 0, 0, i); 1003 buf = tparam (multi, 0, 0, i);
1026 OUTPUT (tty, buf); 1004 OUTPUT (tty, buf);
@@ -1028,7 +1006,7 @@ tty_ins_del_lines (struct frame *f, int vpos, int n)
1028 } 1006 }
1029 else if (single) 1007 else if (single)
1030 { 1008 {
1031 raw_cursor_to (vpos, 0); 1009 raw_cursor_to (f, vpos, 0);
1032 background_highlight (tty); 1010 background_highlight (tty);
1033 while (--i >= 0) 1011 while (--i >= 0)
1034 OUTPUT (tty, single); 1012 OUTPUT (tty, single);
@@ -1039,9 +1017,9 @@ tty_ins_del_lines (struct frame *f, int vpos, int n)
1039 { 1017 {
1040 set_scroll_region (f, vpos, tty->specified_window); 1018 set_scroll_region (f, vpos, tty->specified_window);
1041 if (n < 0) 1019 if (n < 0)
1042 raw_cursor_to (tty->specified_window - 1, 0); 1020 raw_cursor_to (f, tty->specified_window - 1, 0);
1043 else 1021 else
1044 raw_cursor_to (vpos, 0); 1022 raw_cursor_to (f, vpos, 0);
1045 background_highlight (tty); 1023 background_highlight (tty);
1046 while (--i >= 0) 1024 while (--i >= 0)
1047 OUTPUTL (tty, scroll, tty->specified_window - vpos); 1025 OUTPUTL (tty, scroll, tty->specified_window - vpos);
@@ -1061,8 +1039,7 @@ tty_ins_del_lines (struct frame *f, int vpos, int n)
1061 not counting any line-dependent padding. */ 1039 not counting any line-dependent padding. */
1062 1040
1063int 1041int
1064string_cost (str) 1042string_cost (char *str)
1065 char *str;
1066{ 1043{
1067 cost = 0; 1044 cost = 0;
1068 if (str) 1045 if (str)
@@ -1074,8 +1051,7 @@ string_cost (str)
1074 counting any line-dependent padding at one line. */ 1051 counting any line-dependent padding at one line. */
1075 1052
1076static int 1053static int
1077string_cost_one_line (str) 1054string_cost_one_line (char *str)
1078 char *str;
1079{ 1055{
1080 cost = 0; 1056 cost = 0;
1081 if (str) 1057 if (str)
@@ -1087,8 +1063,7 @@ string_cost_one_line (str)
1087 in tenths of characters. */ 1063 in tenths of characters. */
1088 1064
1089int 1065int
1090per_line_cost (str) 1066per_line_cost (char *str)
1091 register char *str;
1092{ 1067{
1093 cost = 0; 1068 cost = 0;
1094 if (str) 1069 if (str)
@@ -1111,8 +1086,7 @@ int *char_ins_del_vector;
1111 1086
1112/* ARGSUSED */ 1087/* ARGSUSED */
1113static void 1088static void
1114calculate_ins_del_char_costs (f) 1089calculate_ins_del_char_costs (struct frame *f)
1115 FRAME_PTR f;
1116{ 1090{
1117 struct tty_display_info *tty = FRAME_TTY (f); 1091 struct tty_display_info *tty = FRAME_TTY (f);
1118 int ins_startup_cost, del_startup_cost; 1092 int ins_startup_cost, del_startup_cost;
@@ -1173,8 +1147,7 @@ calculate_ins_del_char_costs (f)
1173} 1147}
1174 1148
1175void 1149void
1176calculate_costs (frame) 1150calculate_costs (struct frame *frame)
1177 FRAME_PTR frame;
1178{ 1151{
1179 FRAME_COST_BAUD_RATE (frame) = baud_rate; 1152 FRAME_COST_BAUD_RATE (frame) = baud_rate;
1180 1153