comparison src/term.c @ 25727:46fe79182b54

(OUTPUT_IF, OUTPUT1_IF): Use do-while. (encode_terminal_code): Remove unused variables. (turn_off_face): Ditto. (toplevel): Include termcap.h if HAVE_TERMCAP_H.
author Gerd Moellmann <gerd@gnu.org>
date Wed, 15 Sep 1999 12:58:40 +0000
parents 992d0d097e54
children 08c26156186a
comparison
equal deleted inserted replaced
25726:9bfb1496cdd8 25727:46fe79182b54
36 #include "termhooks.h" 36 #include "termhooks.h"
37 #include "keyboard.h" 37 #include "keyboard.h"
38 #include "dispextern.h" 38 #include "dispextern.h"
39 #include "window.h" 39 #include "window.h"
40 40
41 #ifdef HAVE_TERMCAP_H
42 #include <termcap.h>
43 #endif
44
41 #include "cm.h" 45 #include "cm.h"
42 #ifdef HAVE_X_WINDOWS 46 #ifdef HAVE_X_WINDOWS
43 #include "xterm.h" 47 #include "xterm.h"
44 #endif 48 #endif
45 49
54 #define OUTPUT(a) \ 58 #define OUTPUT(a) \
55 tputs (a, (int) (FRAME_HEIGHT (XFRAME (selected_frame)) - curY), cmputc) 59 tputs (a, (int) (FRAME_HEIGHT (XFRAME (selected_frame)) - curY), cmputc)
56 #define OUTPUT1(a) tputs (a, 1, cmputc) 60 #define OUTPUT1(a) tputs (a, 1, cmputc)
57 #define OUTPUTL(a, lines) tputs (a, lines, cmputc) 61 #define OUTPUTL(a, lines) tputs (a, lines, cmputc)
58 62
59 #define OUTPUT_IF(a) \ 63 #define OUTPUT_IF(a) \
60 if (a) \ 64 do { \
61 tputs (a, (int) (FRAME_HEIGHT (XFRAME (selected_frame)) \ 65 if (a) \
62 - curY), cmputc); \ 66 tputs (a, (int) (FRAME_HEIGHT (XFRAME (selected_frame)) \
63 else \ 67 - curY), cmputc); \
64 (void) 0 68 } while (0)
65 69
66 #define OUTPUT1_IF(a) if (a) tputs (a, 1, cmputc); else (void) 0 70 #define OUTPUT1_IF(a) do { if (a) tputs (a, 1, cmputc); } while (0)
67 71
68 /* Function to use to ring the bell. */ 72 /* Function to use to ring the bell. */
69 73
70 Lisp_Object Vring_bell_function; 74 Lisp_Object Vring_bell_function;
71 75
938 g = GLYPH_FROM_CHAR_GLYPH (*src); 942 g = GLYPH_FROM_CHAR_GLYPH (*src);
939 943
940 /* We must skip glyphs to be padded for a wide character. */ 944 /* We must skip glyphs to be padded for a wide character. */
941 if (! CHAR_GLYPH_PADDING_P (*src)) 945 if (! CHAR_GLYPH_PADDING_P (*src))
942 { 946 {
943 struct frame *sf = XFRAME (selected_frame);
944
945 c = src->u.ch.code; 947 c = src->u.ch.code;
946 if (! GLYPH_CHAR_VALID_P (c)) 948 if (! GLYPH_CHAR_VALID_P (c))
947 { 949 {
948 c = ' '; 950 c = ' ';
949 g = MAKE_GLYPH (sf, c, GLYPH_FACE (sf, g)); 951 g = MAKE_GLYPH (sf, c, GLYPH_FACE (sf, g));
1993 turn_off_face (f, face_id) 1995 turn_off_face (f, face_id)
1994 struct frame *f; 1996 struct frame *f;
1995 int face_id; 1997 int face_id;
1996 { 1998 {
1997 struct face *face = FACE_FROM_ID (f, face_id); 1999 struct face *face = FACE_FROM_ID (f, face_id);
1998 Lisp_Object entry;
1999 2000
2000 xassert (face != NULL); 2001 xassert (face != NULL);
2001 2002
2002 if (TS_exit_attribute_mode) 2003 if (TS_exit_attribute_mode)
2003 { 2004 {