diff options
| author | Dmitry Antipov | 2012-06-28 11:50:50 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-06-28 11:50:50 +0400 |
| commit | e509cfa6065d20e0d8d2b3ce9ac544355521bc89 (patch) | |
| tree | 49bb60b82e50f987bdaa095963d07b1c66a5a109 /src | |
| parent | a54e2c050b9cf161cbccc3dd4628f8ef6b64f519 (diff) | |
| download | emacs-e509cfa6065d20e0d8d2b3ce9ac544355521bc89.tar.gz emacs-e509cfa6065d20e0d8d2b3ce9ac544355521bc89.zip | |
* configure.in: Add glyphs category to --enable-checking option.
(GLYPH_DEBUG): Define if glyphs debugging is enabled.
* src/dispextern.h (GLYPH_DEBUG): Now defined in config.h if
enabled with --enable-checking=[all,glyphs] configure option.
Fix GLYPH_DEBUG usage assuming that it may be undefined,
adjust comments accordingly.
* src/dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
undefined, adjust comments accordingly.
* src/image.c: Likewise.
* src/scroll.c: Likewise.
* src/w32fns.c: Likewise.
* src/w32term.c: Likewise.
* src/xdisp.c: Likewise.
* src/xfaces.c: Likewise.
* src/xfns.c: Likewise.
* src/xterm.c: Likewise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 17 | ||||
| -rw-r--r-- | src/dispextern.h | 31 | ||||
| -rw-r--r-- | src/dispnew.c | 38 | ||||
| -rw-r--r-- | src/fontset.c | 7 | ||||
| -rw-r--r-- | src/image.c | 6 | ||||
| -rw-r--r-- | src/scroll.c | 6 | ||||
| -rw-r--r-- | src/w32fns.c | 10 | ||||
| -rw-r--r-- | src/w32term.c | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 54 | ||||
| -rw-r--r-- | src/xfaces.c | 24 | ||||
| -rw-r--r-- | src/xfns.c | 10 | ||||
| -rw-r--r-- | src/xterm.c | 6 |
12 files changed, 111 insertions, 104 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 9a677d9f2d7..fd1f17b8cde 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,22 @@ | |||
| 1 | 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru> | 1 | 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 2 | ||
| 3 | * dispextern.h (GLYPH_DEBUG): Now defined in config.h if | ||
| 4 | enabled with --enable-checking=[all,glyphs] configure option. | ||
| 5 | Fix GLYPH_DEBUG usage assuming that it may be undefined, | ||
| 6 | adjust comments accordingly. | ||
| 7 | * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be | ||
| 8 | undefined, adjust comments accordingly. | ||
| 9 | * image.c: Likewise. | ||
| 10 | * scroll.c: Likewise. | ||
| 11 | * w32fns.c: Likewise. | ||
| 12 | * w32term.c: Likewise. | ||
| 13 | * xdisp.c: Likewise. | ||
| 14 | * xfaces.c: Likewise. | ||
| 15 | * xfns.c: Likewise. | ||
| 16 | * xterm.c: Likewise. | ||
| 17 | |||
| 18 | 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 19 | |||
| 3 | Generalize run-time debugging checks. | 20 | Generalize run-time debugging checks. |
| 4 | * dispextern.h (XASSERTS): Remove. | 21 | * dispextern.h (XASSERTS): Remove. |
| 5 | * fontset.c (xassert): Remove. | 22 | * fontset.c (xassert): Remove. |
diff --git a/src/dispextern.h b/src/dispextern.h index 78f6db63cb7..c7adc4dadec 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -121,26 +121,21 @@ enum window_part | |||
| 121 | Debugging | 121 | Debugging |
| 122 | ***********************************************************************/ | 122 | ***********************************************************************/ |
| 123 | 123 | ||
| 124 | /* If GLYPH_DEBUG is non-zero, additional checks are activated. Turn | 124 | /* If GLYPH_DEBUG is defined, additional checks are activated. */ |
| 125 | it off by defining the macro GLYPH_DEBUG to zero. */ | ||
| 126 | 125 | ||
| 127 | #ifndef GLYPH_DEBUG | 126 | /* Macros to include code only if GLYPH_DEBUG is defined. */ |
| 128 | #define GLYPH_DEBUG 0 | ||
| 129 | #endif | ||
| 130 | |||
| 131 | /* Macros to include code only if GLYPH_DEBUG != 0. */ | ||
| 132 | 127 | ||
| 133 | #if GLYPH_DEBUG | 128 | #ifdef GLYPH_DEBUG |
| 134 | #define IF_DEBUG(X) X | 129 | #define IF_DEBUG(X) X |
| 135 | #else | 130 | #else |
| 136 | #define IF_DEBUG(X) (void) 0 | 131 | #define IF_DEBUG(X) (void) 0 |
| 137 | #endif | 132 | #endif |
| 138 | 133 | ||
| 139 | /* Macro for displaying traces of redisplay. If Emacs was compiled | 134 | /* Macro for displaying traces of redisplay. If Emacs was compiled |
| 140 | with GLYPH_DEBUG != 0, the variable trace_redisplay_p can be set to | 135 | with GLYPH_DEBUG defined, the variable trace_redisplay_p can be set to |
| 141 | a non-zero value in debugging sessions to activate traces. */ | 136 | a non-zero value in debugging sessions to activate traces. */ |
| 142 | 137 | ||
| 143 | #if GLYPH_DEBUG | 138 | #ifdef GLYPH_DEBUG |
| 144 | 139 | ||
| 145 | extern int trace_redisplay_p EXTERNALLY_VISIBLE; | 140 | extern int trace_redisplay_p EXTERNALLY_VISIBLE; |
| 146 | #include <stdio.h> | 141 | #include <stdio.h> |
| @@ -151,11 +146,11 @@ extern int trace_redisplay_p EXTERNALLY_VISIBLE; | |||
| 151 | else \ | 146 | else \ |
| 152 | (void) 0 | 147 | (void) 0 |
| 153 | 148 | ||
| 154 | #else /* GLYPH_DEBUG == 0 */ | 149 | #else /* not GLYPH_DEBUG */ |
| 155 | 150 | ||
| 156 | #define TRACE(X) (void) 0 | 151 | #define TRACE(X) (void) 0 |
| 157 | 152 | ||
| 158 | #endif /* GLYPH_DEBUG == 0 */ | 153 | #endif /* GLYPH_DEBUG */ |
| 159 | 154 | ||
| 160 | 155 | ||
| 161 | 156 | ||
| @@ -653,7 +648,7 @@ struct glyph_matrix | |||
| 653 | line. */ | 648 | line. */ |
| 654 | unsigned header_line_p : 1; | 649 | unsigned header_line_p : 1; |
| 655 | 650 | ||
| 656 | #if GLYPH_DEBUG | 651 | #ifdef GLYPH_DEBUG |
| 657 | /* A string identifying the method used to display the matrix. */ | 652 | /* A string identifying the method used to display the matrix. */ |
| 658 | char method[512]; | 653 | char method[512]; |
| 659 | #endif | 654 | #endif |
| @@ -671,7 +666,7 @@ struct glyph_matrix | |||
| 671 | /* Check that glyph pointers stored in glyph rows of MATRIX are okay. | 666 | /* Check that glyph pointers stored in glyph rows of MATRIX are okay. |
| 672 | This aborts if any pointer is found twice. */ | 667 | This aborts if any pointer is found twice. */ |
| 673 | 668 | ||
| 674 | #if GLYPH_DEBUG | 669 | #ifdef GLYPH_DEBUG |
| 675 | void check_matrix_pointer_lossage (struct glyph_matrix *); | 670 | void check_matrix_pointer_lossage (struct glyph_matrix *); |
| 676 | #define CHECK_MATRIX(MATRIX) check_matrix_pointer_lossage ((MATRIX)) | 671 | #define CHECK_MATRIX(MATRIX) check_matrix_pointer_lossage ((MATRIX)) |
| 677 | #else | 672 | #else |
| @@ -950,10 +945,10 @@ struct glyph_row | |||
| 950 | 945 | ||
| 951 | 946 | ||
| 952 | /* Get a pointer to row number ROW in matrix MATRIX. If GLYPH_DEBUG | 947 | /* Get a pointer to row number ROW in matrix MATRIX. If GLYPH_DEBUG |
| 953 | is defined to a non-zero value, the function matrix_row checks that | 948 | is defined, the function matrix_row checks that we don't try to |
| 954 | we don't try to access rows that are out of bounds. */ | 949 | access rows that are out of bounds. */ |
| 955 | 950 | ||
| 956 | #if GLYPH_DEBUG | 951 | #ifdef GLYPH_DEBUG |
| 957 | struct glyph_row *matrix_row (struct glyph_matrix *, int); | 952 | struct glyph_row *matrix_row (struct glyph_matrix *, int); |
| 958 | #define MATRIX_ROW(MATRIX, ROW) matrix_row ((MATRIX), (ROW)) | 953 | #define MATRIX_ROW(MATRIX, ROW) matrix_row ((MATRIX), (ROW)) |
| 959 | #else | 954 | #else |
| @@ -3067,7 +3062,7 @@ extern void produce_stretch_glyph (struct it *); | |||
| 3067 | 3062 | ||
| 3068 | #ifdef HAVE_WINDOW_SYSTEM | 3063 | #ifdef HAVE_WINDOW_SYSTEM |
| 3069 | 3064 | ||
| 3070 | #if GLYPH_DEBUG | 3065 | #ifdef GLYPH_DEBUG |
| 3071 | extern void dump_glyph_string (struct glyph_string *) EXTERNALLY_VISIBLE; | 3066 | extern void dump_glyph_string (struct glyph_string *) EXTERNALLY_VISIBLE; |
| 3072 | #endif | 3067 | #endif |
| 3073 | 3068 | ||
diff --git a/src/dispnew.c b/src/dispnew.c index a34552fc564..767f1c8112b 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -123,7 +123,7 @@ static void fill_up_glyph_row_area_with_spaces (struct glyph_row *, int); | |||
| 123 | static int scrolling_window (struct window *, int); | 123 | static int scrolling_window (struct window *, int); |
| 124 | static int update_window_line (struct window *, int, int *); | 124 | static int update_window_line (struct window *, int, int *); |
| 125 | static void mirror_make_current (struct window *, int); | 125 | static void mirror_make_current (struct window *, int); |
| 126 | #if GLYPH_DEBUG | 126 | #ifdef GLYPH_DEBUG |
| 127 | static void check_matrix_pointers (struct glyph_matrix *, | 127 | static void check_matrix_pointers (struct glyph_matrix *, |
| 128 | struct glyph_matrix *); | 128 | struct glyph_matrix *); |
| 129 | #endif | 129 | #endif |
| @@ -211,7 +211,7 @@ int fonts_changed_p; | |||
| 211 | /* Convert vpos and hpos from frame to window and vice versa. | 211 | /* Convert vpos and hpos from frame to window and vice versa. |
| 212 | This may only be used for terminal frames. */ | 212 | This may only be used for terminal frames. */ |
| 213 | 213 | ||
| 214 | #if GLYPH_DEBUG | 214 | #ifdef GLYPH_DEBUG |
| 215 | 215 | ||
| 216 | static int window_to_frame_vpos (struct window *, int); | 216 | static int window_to_frame_vpos (struct window *, int); |
| 217 | static int window_to_frame_hpos (struct window *, int); | 217 | static int window_to_frame_hpos (struct window *, int); |
| @@ -311,12 +311,12 @@ DEFUN ("dump-redisplay-history", Fdump_redisplay_history, | |||
| 311 | } | 311 | } |
| 312 | 312 | ||
| 313 | 313 | ||
| 314 | #else /* GLYPH_DEBUG == 0 */ | 314 | #else /* not GLYPH_DEBUG */ |
| 315 | 315 | ||
| 316 | #define WINDOW_TO_FRAME_VPOS(W, VPOS) ((VPOS) + WINDOW_TOP_EDGE_LINE (W)) | 316 | #define WINDOW_TO_FRAME_VPOS(W, VPOS) ((VPOS) + WINDOW_TOP_EDGE_LINE (W)) |
| 317 | #define WINDOW_TO_FRAME_HPOS(W, HPOS) ((HPOS) + WINDOW_LEFT_EDGE_COL (W)) | 317 | #define WINDOW_TO_FRAME_HPOS(W, HPOS) ((HPOS) + WINDOW_LEFT_EDGE_COL (W)) |
| 318 | 318 | ||
| 319 | #endif /* GLYPH_DEBUG == 0 */ | 319 | #endif /* GLYPH_DEBUG */ |
| 320 | 320 | ||
| 321 | 321 | ||
| 322 | #if (defined PROFILING \ | 322 | #if (defined PROFILING \ |
| @@ -419,14 +419,14 @@ margin_glyphs_to_reserve (struct window *w, int total_glyphs, Lisp_Object margin | |||
| 419 | return n; | 419 | return n; |
| 420 | } | 420 | } |
| 421 | 421 | ||
| 422 | #ifdef ENABLE_CHECKING | 422 | /* Return non-zero if ROW's hash value is correct, zero if not. |
| 423 | /* Return non-zero if ROW's hash value is correct, zero if not. */ | 423 | Optimized away if ENABLE_CHECKING is not defined. */ |
| 424 | |||
| 424 | static int | 425 | static int |
| 425 | verify_row_hash (struct glyph_row *row) | 426 | verify_row_hash (struct glyph_row *row) |
| 426 | { | 427 | { |
| 427 | return row->hash == row_hash (row); | 428 | return row->hash == row_hash (row); |
| 428 | } | 429 | } |
| 429 | #endif | ||
| 430 | 430 | ||
| 431 | /* Adjust glyph matrix MATRIX on window W or on a frame to changed | 431 | /* Adjust glyph matrix MATRIX on window W or on a frame to changed |
| 432 | window sizes. | 432 | window sizes. |
| @@ -1136,7 +1136,7 @@ assign_row (struct glyph_row *to, struct glyph_row *from) | |||
| 1136 | is non-zero if the glyph memory of WINDOW_ROW is part of the glyph | 1136 | is non-zero if the glyph memory of WINDOW_ROW is part of the glyph |
| 1137 | memory of FRAME_ROW. */ | 1137 | memory of FRAME_ROW. */ |
| 1138 | 1138 | ||
| 1139 | #if GLYPH_DEBUG | 1139 | #ifdef GLYPH_DEBUG |
| 1140 | 1140 | ||
| 1141 | static int | 1141 | static int |
| 1142 | glyph_row_slice_p (struct glyph_row *window_row, struct glyph_row *frame_row) | 1142 | glyph_row_slice_p (struct glyph_row *window_row, struct glyph_row *frame_row) |
| @@ -1451,7 +1451,7 @@ realloc_glyph_pool (struct glyph_pool *pool, struct dim matrix_dim) | |||
| 1451 | Debug Code | 1451 | Debug Code |
| 1452 | ***********************************************************************/ | 1452 | ***********************************************************************/ |
| 1453 | 1453 | ||
| 1454 | #if GLYPH_DEBUG | 1454 | #ifdef GLYPH_DEBUG |
| 1455 | 1455 | ||
| 1456 | 1456 | ||
| 1457 | /* Flush standard output. This is sometimes useful to call from the debugger. | 1457 | /* Flush standard output. This is sometimes useful to call from the debugger. |
| @@ -1576,7 +1576,7 @@ check_matrix_invariants (struct window *w) | |||
| 1576 | 1576 | ||
| 1577 | #endif /* 0 */ | 1577 | #endif /* 0 */ |
| 1578 | 1578 | ||
| 1579 | #endif /* GLYPH_DEBUG != 0 */ | 1579 | #endif /* GLYPH_DEBUG */ |
| 1580 | 1580 | ||
| 1581 | 1581 | ||
| 1582 | 1582 | ||
| @@ -2599,7 +2599,7 @@ build_frame_matrix_from_leaf_window (struct glyph_matrix *frame_matrix, struct w | |||
| 2599 | SET_CHAR_GLYPH_FROM_GLYPH (*border, right_border_glyph); | 2599 | SET_CHAR_GLYPH_FROM_GLYPH (*border, right_border_glyph); |
| 2600 | } | 2600 | } |
| 2601 | 2601 | ||
| 2602 | #if GLYPH_DEBUG | 2602 | #ifdef GLYPH_DEBUG |
| 2603 | /* Window row window_y must be a slice of frame row | 2603 | /* Window row window_y must be a slice of frame row |
| 2604 | frame_y. */ | 2604 | frame_y. */ |
| 2605 | eassert (glyph_row_slice_p (window_row, frame_row)); | 2605 | eassert (glyph_row_slice_p (window_row, frame_row)); |
| @@ -3026,7 +3026,7 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy | |||
| 3026 | } | 3026 | } |
| 3027 | 3027 | ||
| 3028 | 3028 | ||
| 3029 | #if GLYPH_DEBUG | 3029 | #ifdef GLYPH_DEBUG |
| 3030 | 3030 | ||
| 3031 | /* Check that window and frame matrices agree about their | 3031 | /* Check that window and frame matrices agree about their |
| 3032 | understanding where glyphs of the rows are to find. For each | 3032 | understanding where glyphs of the rows are to find. For each |
| @@ -3082,7 +3082,7 @@ check_matrix_pointers (struct glyph_matrix *window_matrix, | |||
| 3082 | } | 3082 | } |
| 3083 | } | 3083 | } |
| 3084 | 3084 | ||
| 3085 | #endif /* GLYPH_DEBUG != 0 */ | 3085 | #endif /* GLYPH_DEBUG */ |
| 3086 | 3086 | ||
| 3087 | 3087 | ||
| 3088 | 3088 | ||
| @@ -3090,7 +3090,7 @@ check_matrix_pointers (struct glyph_matrix *window_matrix, | |||
| 3090 | VPOS and HPOS translations | 3090 | VPOS and HPOS translations |
| 3091 | **********************************************************************/ | 3091 | **********************************************************************/ |
| 3092 | 3092 | ||
| 3093 | #if GLYPH_DEBUG | 3093 | #ifdef GLYPH_DEBUG |
| 3094 | 3094 | ||
| 3095 | /* Translate vertical position VPOS which is relative to window W to a | 3095 | /* Translate vertical position VPOS which is relative to window W to a |
| 3096 | vertical position relative to W's frame. */ | 3096 | vertical position relative to W's frame. */ |
| @@ -3302,7 +3302,7 @@ update_frame (struct frame *f, int force_p, int inhibit_hairy_id_p) | |||
| 3302 | } | 3302 | } |
| 3303 | 3303 | ||
| 3304 | /* Check window matrices for lost pointers. */ | 3304 | /* Check window matrices for lost pointers. */ |
| 3305 | #if GLYPH_DEBUG | 3305 | #ifdef GLYPH_DEBUG |
| 3306 | check_window_matrix_pointers (root_window); | 3306 | check_window_matrix_pointers (root_window); |
| 3307 | add_frame_display_history (f, paused_p); | 3307 | add_frame_display_history (f, paused_p); |
| 3308 | #endif | 3308 | #endif |
| @@ -3529,7 +3529,7 @@ update_window (struct window *w, int force_p) | |||
| 3529 | int preempt_count = baud_rate / 2400 + 1; | 3529 | int preempt_count = baud_rate / 2400 + 1; |
| 3530 | #endif | 3530 | #endif |
| 3531 | struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); | 3531 | struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w))); |
| 3532 | #if GLYPH_DEBUG | 3532 | #ifdef GLYPH_DEBUG |
| 3533 | /* Check that W's frame doesn't have glyph matrices. */ | 3533 | /* Check that W's frame doesn't have glyph matrices. */ |
| 3534 | eassert (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w)))); | 3534 | eassert (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w)))); |
| 3535 | #endif | 3535 | #endif |
| @@ -3681,7 +3681,7 @@ update_window (struct window *w, int force_p) | |||
| 3681 | #endif | 3681 | #endif |
| 3682 | } | 3682 | } |
| 3683 | 3683 | ||
| 3684 | #if GLYPH_DEBUG | 3684 | #ifdef GLYPH_DEBUG |
| 3685 | /* Remember the redisplay method used to display the matrix. */ | 3685 | /* Remember the redisplay method used to display the matrix. */ |
| 3686 | strcpy (w->current_matrix->method, w->desired_matrix->method); | 3686 | strcpy (w->current_matrix->method, w->desired_matrix->method); |
| 3687 | #endif | 3687 | #endif |
| @@ -3699,7 +3699,7 @@ update_window (struct window *w, int force_p) | |||
| 3699 | else | 3699 | else |
| 3700 | paused_p = 1; | 3700 | paused_p = 1; |
| 3701 | 3701 | ||
| 3702 | #if GLYPH_DEBUG | 3702 | #ifdef GLYPH_DEBUG |
| 3703 | /* check_current_matrix_flags (w); */ | 3703 | /* check_current_matrix_flags (w); */ |
| 3704 | add_window_display_history (w, w->current_matrix->method, paused_p); | 3704 | add_window_display_history (w, w->current_matrix->method, paused_p); |
| 3705 | #endif | 3705 | #endif |
| @@ -6476,7 +6476,7 @@ syms_of_display (void) | |||
| 6476 | defsubr (&Sinternal_show_cursor_p); | 6476 | defsubr (&Sinternal_show_cursor_p); |
| 6477 | defsubr (&Slast_nonminibuf_frame); | 6477 | defsubr (&Slast_nonminibuf_frame); |
| 6478 | 6478 | ||
| 6479 | #if GLYPH_DEBUG | 6479 | #ifdef GLYPH_DEBUG |
| 6480 | defsubr (&Sdump_redisplay_history); | 6480 | defsubr (&Sdump_redisplay_history); |
| 6481 | #endif | 6481 | #endif |
| 6482 | 6482 | ||
diff --git a/src/fontset.c b/src/fontset.c index 98ee89070f9..da54bca2a5c 100644 --- a/src/fontset.c +++ b/src/fontset.c | |||
| @@ -197,9 +197,8 @@ static void accumulate_script_ranges (Lisp_Object, Lisp_Object, | |||
| 197 | Lisp_Object); | 197 | Lisp_Object); |
| 198 | static void set_fontset_font (Lisp_Object, Lisp_Object); | 198 | static void set_fontset_font (Lisp_Object, Lisp_Object); |
| 199 | 199 | ||
| 200 | #ifdef ENABLE_CHECKING | 200 | /* Return 1 if ID is a valid fontset id, else return 0. |
| 201 | 201 | Optimized away if ENABLE_CHECKING is not defined. */ | |
| 202 | /* Return 1 if ID is a valid fontset id, else return 0. */ | ||
| 203 | 202 | ||
| 204 | static int | 203 | static int |
| 205 | fontset_id_valid_p (int id) | 204 | fontset_id_valid_p (int id) |
| @@ -207,8 +206,6 @@ fontset_id_valid_p (int id) | |||
| 207 | return (id >= 0 && id < ASIZE (Vfontset_table) - 1); | 206 | return (id >= 0 && id < ASIZE (Vfontset_table) - 1); |
| 208 | } | 207 | } |
| 209 | 208 | ||
| 210 | #endif | ||
| 211 | |||
| 212 | 209 | ||
| 213 | 210 | ||
| 214 | /********** MACROS AND FUNCTIONS TO HANDLE FONTSET **********/ | 211 | /********** MACROS AND FUNCTIONS TO HANDLE FONTSET **********/ |
diff --git a/src/image.c b/src/image.c index 63bac9a8a79..9b1c7f1b280 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -8686,7 +8686,7 @@ x_kill_gs_process (Pixmap pixmap, struct frame *f) | |||
| 8686 | Tests | 8686 | Tests |
| 8687 | ***********************************************************************/ | 8687 | ***********************************************************************/ |
| 8688 | 8688 | ||
| 8689 | #if GLYPH_DEBUG | 8689 | #ifdef GLYPH_DEBUG |
| 8690 | 8690 | ||
| 8691 | DEFUN ("imagep", Fimagep, Simagep, 1, 1, 0, | 8691 | DEFUN ("imagep", Fimagep, Simagep, 1, 1, 0, |
| 8692 | doc: /* Value is non-nil if SPEC is a valid image specification. */) | 8692 | doc: /* Value is non-nil if SPEC is a valid image specification. */) |
| @@ -8708,7 +8708,7 @@ DEFUN ("lookup-image", Flookup_image, Slookup_image, 1, 1, 0, "") | |||
| 8708 | return make_number (id); | 8708 | return make_number (id); |
| 8709 | } | 8709 | } |
| 8710 | 8710 | ||
| 8711 | #endif /* GLYPH_DEBUG != 0 */ | 8711 | #endif /* GLYPH_DEBUG */ |
| 8712 | 8712 | ||
| 8713 | 8713 | ||
| 8714 | /*********************************************************************** | 8714 | /*********************************************************************** |
| @@ -8922,7 +8922,7 @@ non-numeric, there is no explicit limit on the size of images. */); | |||
| 8922 | defsubr (&Simage_mask_p); | 8922 | defsubr (&Simage_mask_p); |
| 8923 | defsubr (&Simage_metadata); | 8923 | defsubr (&Simage_metadata); |
| 8924 | 8924 | ||
| 8925 | #if GLYPH_DEBUG | 8925 | #ifdef GLYPH_DEBUG |
| 8926 | defsubr (&Simagep); | 8926 | defsubr (&Simagep); |
| 8927 | defsubr (&Slookup_image); | 8927 | defsubr (&Slookup_image); |
| 8928 | #endif | 8928 | #endif |
diff --git a/src/scroll.c b/src/scroll.c index 603e04575f6..86d775545b0 100644 --- a/src/scroll.c +++ b/src/scroll.c | |||
| @@ -264,7 +264,7 @@ do_scrolling (struct frame *frame, struct glyph_matrix *current_matrix, | |||
| 264 | for (k = 0; k < window_size; ++k) | 264 | for (k = 0; k < window_size; ++k) |
| 265 | copy_from[k] = -1; | 265 | copy_from[k] = -1; |
| 266 | 266 | ||
| 267 | #if GLYPH_DEBUG | 267 | #ifdef GLYPH_DEBUG |
| 268 | # define CHECK_BOUNDS \ | 268 | # define CHECK_BOUNDS \ |
| 269 | do \ | 269 | do \ |
| 270 | { \ | 270 | { \ |
| @@ -322,7 +322,7 @@ do_scrolling (struct frame *frame, struct glyph_matrix *current_matrix, | |||
| 322 | copy_from[i] = j; | 322 | copy_from[i] = j; |
| 323 | retained_p[j] = 1; | 323 | retained_p[j] = 1; |
| 324 | 324 | ||
| 325 | #if GLYPH_DEBUG | 325 | #ifdef GLYPH_DEBUG |
| 326 | CHECK_BOUNDS; | 326 | CHECK_BOUNDS; |
| 327 | #endif | 327 | #endif |
| 328 | } | 328 | } |
| @@ -374,7 +374,7 @@ do_scrolling (struct frame *frame, struct glyph_matrix *current_matrix, | |||
| 374 | mirrored_line_dance (current_matrix, unchanged_at_top, window_size, | 374 | mirrored_line_dance (current_matrix, unchanged_at_top, window_size, |
| 375 | copy_from, retained_p); | 375 | copy_from, retained_p); |
| 376 | 376 | ||
| 377 | /* Some sanity checks if GLYPH_DEBUG != 0. */ | 377 | /* Some sanity checks if GLYPH_DEBUG is defined. */ |
| 378 | CHECK_MATRIX (current_matrix); | 378 | CHECK_MATRIX (current_matrix); |
| 379 | 379 | ||
| 380 | if (terminal_window_p) | 380 | if (terminal_window_p) |
diff --git a/src/w32fns.c b/src/w32fns.c index c00ed66dcbb..acd42792b9b 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -183,7 +183,7 @@ unsigned int msh_mousewheel = 0; | |||
| 183 | #define MENU_FREE_DELAY 1000 | 183 | #define MENU_FREE_DELAY 1000 |
| 184 | static unsigned menu_free_timer = 0; | 184 | static unsigned menu_free_timer = 0; |
| 185 | 185 | ||
| 186 | #if GLYPH_DEBUG | 186 | #ifdef GLYPH_DEBUG |
| 187 | static int image_cache_refcount, dpyinfo_refcount; | 187 | static int image_cache_refcount, dpyinfo_refcount; |
| 188 | #endif | 188 | #endif |
| 189 | 189 | ||
| @@ -3996,14 +3996,14 @@ unwind_create_frame (Lisp_Object frame) | |||
| 3996 | /* If frame is ``official'', nothing to do. */ | 3996 | /* If frame is ``official'', nothing to do. */ |
| 3997 | if (NILP (Fmemq (frame, Vframe_list))) | 3997 | if (NILP (Fmemq (frame, Vframe_list))) |
| 3998 | { | 3998 | { |
| 3999 | #if GLYPH_DEBUG | 3999 | #ifdef GLYPH_DEBUG |
| 4000 | struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); | 4000 | struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f); |
| 4001 | #endif | 4001 | #endif |
| 4002 | 4002 | ||
| 4003 | x_free_frame_resources (f); | 4003 | x_free_frame_resources (f); |
| 4004 | free_glyphs (f); | 4004 | free_glyphs (f); |
| 4005 | 4005 | ||
| 4006 | #if GLYPH_DEBUG | 4006 | #ifdef GLYPH_DEBUG |
| 4007 | /* Check that reference counts are indeed correct. */ | 4007 | /* Check that reference counts are indeed correct. */ |
| 4008 | eassert (dpyinfo->reference_count == dpyinfo_refcount); | 4008 | eassert (dpyinfo->reference_count == dpyinfo_refcount); |
| 4009 | eassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount); | 4009 | eassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount); |
| @@ -4160,7 +4160,7 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 4160 | 4160 | ||
| 4161 | /* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe. */ | 4161 | /* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe. */ |
| 4162 | record_unwind_protect (unwind_create_frame, frame); | 4162 | record_unwind_protect (unwind_create_frame, frame); |
| 4163 | #if GLYPH_DEBUG | 4163 | #ifdef GLYPH_DEBUG |
| 4164 | image_cache_refcount = | 4164 | image_cache_refcount = |
| 4165 | FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; | 4165 | FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; |
| 4166 | dpyinfo_refcount = dpyinfo->reference_count; | 4166 | dpyinfo_refcount = dpyinfo->reference_count; |
| @@ -5237,7 +5237,7 @@ x_create_tip_frame (struct w32_display_info *dpyinfo, | |||
| 5237 | FRAME_FONTSET (f) = -1; | 5237 | FRAME_FONTSET (f) = -1; |
| 5238 | f->icon_name = Qnil; | 5238 | f->icon_name = Qnil; |
| 5239 | 5239 | ||
| 5240 | #if GLYPH_DEBUG | 5240 | #ifdef GLYPH_DEBUG |
| 5241 | image_cache_refcount = | 5241 | image_cache_refcount = |
| 5242 | FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; | 5242 | FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; |
| 5243 | dpyinfo_refcount = dpyinfo->reference_count; | 5243 | dpyinfo_refcount = dpyinfo->reference_count; |
diff --git a/src/w32term.c b/src/w32term.c index f879e648054..c0c137b9a9d 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -231,7 +231,7 @@ static void my_set_focus (struct frame *, HWND); | |||
| 231 | static void my_set_foreground_window (HWND); | 231 | static void my_set_foreground_window (HWND); |
| 232 | static void my_destroy_window (struct frame *, HWND); | 232 | static void my_destroy_window (struct frame *, HWND); |
| 233 | 233 | ||
| 234 | #if GLYPH_DEBUG | 234 | #ifdef GLYPH_DEBUG |
| 235 | static void x_check_font (struct frame *, struct font *); | 235 | static void x_check_font (struct frame *, struct font *); |
| 236 | #endif | 236 | #endif |
| 237 | 237 | ||
| @@ -6024,7 +6024,7 @@ x_wm_set_icon_position (struct frame *f, int icon_x, int icon_y) | |||
| 6024 | Fonts | 6024 | Fonts |
| 6025 | ***********************************************************************/ | 6025 | ***********************************************************************/ |
| 6026 | 6026 | ||
| 6027 | #if GLYPH_DEBUG | 6027 | #ifdef GLYPH_DEBUG |
| 6028 | 6028 | ||
| 6029 | /* Check that FONT is valid on frame F. It is if it can be found in F's | 6029 | /* Check that FONT is valid on frame F. It is if it can be found in F's |
| 6030 | font table. */ | 6030 | font table. */ |
| @@ -6037,7 +6037,7 @@ x_check_font (struct frame *f, struct font *font) | |||
| 6037 | eassert (font->driver->check (f, font) == 0); | 6037 | eassert (font->driver->check (f, font) == 0); |
| 6038 | } | 6038 | } |
| 6039 | 6039 | ||
| 6040 | #endif /* GLYPH_DEBUG != 0 */ | 6040 | #endif /* GLYPH_DEBUG */ |
| 6041 | 6041 | ||
| 6042 | 6042 | ||
| 6043 | 6043 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index b03c455eb50..425ccc522de 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -627,10 +627,10 @@ int current_mode_line_height, current_header_line_height; | |||
| 627 | CACHE = NULL; \ | 627 | CACHE = NULL; \ |
| 628 | } while (0) | 628 | } while (0) |
| 629 | 629 | ||
| 630 | #if GLYPH_DEBUG | 630 | #ifdef GLYPH_DEBUG |
| 631 | 631 | ||
| 632 | /* Non-zero means print traces of redisplay if compiled with | 632 | /* Non-zero means print traces of redisplay if compiled with |
| 633 | GLYPH_DEBUG != 0. */ | 633 | GLYPH_DEBUG defined. */ |
| 634 | 634 | ||
| 635 | int trace_redisplay_p; | 635 | int trace_redisplay_p; |
| 636 | 636 | ||
| @@ -2495,7 +2495,7 @@ check_it (struct it *it) | |||
| 2495 | #endif /* not 0 */ | 2495 | #endif /* not 0 */ |
| 2496 | 2496 | ||
| 2497 | 2497 | ||
| 2498 | #if GLYPH_DEBUG && defined ENABLE_CHECKING | 2498 | #if defined GLYPH_DEBUG && defined ENABLE_CHECKING |
| 2499 | 2499 | ||
| 2500 | /* Check that the window end of window W is what we expect it | 2500 | /* Check that the window end of window W is what we expect it |
| 2501 | to be---the last row in the current matrix displaying text. */ | 2501 | to be---the last row in the current matrix displaying text. */ |
| @@ -2521,7 +2521,7 @@ check_window_end (struct window *w) | |||
| 2521 | 2521 | ||
| 2522 | #define CHECK_WINDOW_END(W) (void) 0 | 2522 | #define CHECK_WINDOW_END(W) (void) 0 |
| 2523 | 2523 | ||
| 2524 | #endif | 2524 | #endif /* GLYPH_DEBUG and ENABLE_CHECKING */ |
| 2525 | 2525 | ||
| 2526 | 2526 | ||
| 2527 | 2527 | ||
| @@ -12435,7 +12435,7 @@ hscroll_windows (Lisp_Object window) | |||
| 12435 | to a non-zero value. This is sometimes handy to have in a debugger | 12435 | to a non-zero value. This is sometimes handy to have in a debugger |
| 12436 | session. */ | 12436 | session. */ |
| 12437 | 12437 | ||
| 12438 | #if GLYPH_DEBUG | 12438 | #ifdef GLYPH_DEBUG |
| 12439 | 12439 | ||
| 12440 | /* First and last unchanged row for try_window_id. */ | 12440 | /* First and last unchanged row for try_window_id. */ |
| 12441 | 12441 | ||
| @@ -13235,7 +13235,7 @@ redisplay_internal (void) | |||
| 13235 | /* Update hint: No need to try to scroll in update_window. */ | 13235 | /* Update hint: No need to try to scroll in update_window. */ |
| 13236 | w->desired_matrix->no_scrolling_p = 1; | 13236 | w->desired_matrix->no_scrolling_p = 1; |
| 13237 | 13237 | ||
| 13238 | #if GLYPH_DEBUG | 13238 | #ifdef GLYPH_DEBUG |
| 13239 | *w->desired_matrix->method = 0; | 13239 | *w->desired_matrix->method = 0; |
| 13240 | debug_method_add (w, "optimization 1"); | 13240 | debug_method_add (w, "optimization 1"); |
| 13241 | #endif | 13241 | #endif |
| @@ -13303,7 +13303,7 @@ redisplay_internal (void) | |||
| 13303 | eassert (this_line_vpos == it.vpos); | 13303 | eassert (this_line_vpos == it.vpos); |
| 13304 | eassert (this_line_y == it.current_y); | 13304 | eassert (this_line_y == it.current_y); |
| 13305 | set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0); | 13305 | set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0); |
| 13306 | #if GLYPH_DEBUG | 13306 | #ifdef GLYPH_DEBUG |
| 13307 | *w->desired_matrix->method = 0; | 13307 | *w->desired_matrix->method = 0; |
| 13308 | debug_method_add (w, "optimization 3"); | 13308 | debug_method_add (w, "optimization 3"); |
| 13309 | #endif | 13309 | #endif |
| @@ -14575,7 +14575,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p, | |||
| 14575 | /* We will never try scrolling more than this number of lines. */ | 14575 | /* We will never try scrolling more than this number of lines. */ |
| 14576 | int scroll_limit = SCROLL_LIMIT; | 14576 | int scroll_limit = SCROLL_LIMIT; |
| 14577 | 14577 | ||
| 14578 | #if GLYPH_DEBUG | 14578 | #ifdef GLYPH_DEBUG |
| 14579 | debug_method_add (w, "try_scrolling"); | 14579 | debug_method_add (w, "try_scrolling"); |
| 14580 | #endif | 14580 | #endif |
| 14581 | 14581 | ||
| @@ -14927,7 +14927,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste | |||
| 14927 | struct frame *f = XFRAME (w->frame); | 14927 | struct frame *f = XFRAME (w->frame); |
| 14928 | int rc = CURSOR_MOVEMENT_CANNOT_BE_USED; | 14928 | int rc = CURSOR_MOVEMENT_CANNOT_BE_USED; |
| 14929 | 14929 | ||
| 14930 | #if GLYPH_DEBUG | 14930 | #ifdef GLYPH_DEBUG |
| 14931 | if (inhibit_try_cursor_movement) | 14931 | if (inhibit_try_cursor_movement) |
| 14932 | return rc; | 14932 | return rc; |
| 14933 | #endif | 14933 | #endif |
| @@ -14974,7 +14974,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste | |||
| 14974 | int this_scroll_margin, top_scroll_margin; | 14974 | int this_scroll_margin, top_scroll_margin; |
| 14975 | struct glyph_row *row = NULL; | 14975 | struct glyph_row *row = NULL; |
| 14976 | 14976 | ||
| 14977 | #if GLYPH_DEBUG | 14977 | #ifdef GLYPH_DEBUG |
| 14978 | debug_method_add (w, "cursor movement"); | 14978 | debug_method_add (w, "cursor movement"); |
| 14979 | #endif | 14979 | #endif |
| 14980 | 14980 | ||
| @@ -15332,7 +15332,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 15332 | 15332 | ||
| 15333 | /* W must be a leaf window here. */ | 15333 | /* W must be a leaf window here. */ |
| 15334 | eassert (!NILP (w->buffer)); | 15334 | eassert (!NILP (w->buffer)); |
| 15335 | #if GLYPH_DEBUG | 15335 | #ifdef GLYPH_DEBUG |
| 15336 | *w->desired_matrix->method = 0; | 15336 | *w->desired_matrix->method = 0; |
| 15337 | #endif | 15337 | #endif |
| 15338 | 15338 | ||
| @@ -15624,7 +15624,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 15624 | } | 15624 | } |
| 15625 | } | 15625 | } |
| 15626 | 15626 | ||
| 15627 | #if GLYPH_DEBUG | 15627 | #ifdef GLYPH_DEBUG |
| 15628 | debug_method_add (w, "forced window start"); | 15628 | debug_method_add (w, "forced window start"); |
| 15629 | #endif | 15629 | #endif |
| 15630 | goto done; | 15630 | goto done; |
| @@ -15656,7 +15656,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 15656 | && !(CHARPOS (startp) <= BEGV | 15656 | && !(CHARPOS (startp) <= BEGV |
| 15657 | || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n')) | 15657 | || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n')) |
| 15658 | { | 15658 | { |
| 15659 | #if GLYPH_DEBUG | 15659 | #ifdef GLYPH_DEBUG |
| 15660 | debug_method_add (w, "recenter 1"); | 15660 | debug_method_add (w, "recenter 1"); |
| 15661 | #endif | 15661 | #endif |
| 15662 | goto recenter; | 15662 | goto recenter; |
| @@ -15667,7 +15667,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 15667 | not work. It is 0 if unsuccessful for some other reason. */ | 15667 | not work. It is 0 if unsuccessful for some other reason. */ |
| 15668 | else if ((tem = try_window_id (w)) != 0) | 15668 | else if ((tem = try_window_id (w)) != 0) |
| 15669 | { | 15669 | { |
| 15670 | #if GLYPH_DEBUG | 15670 | #ifdef GLYPH_DEBUG |
| 15671 | debug_method_add (w, "try_window_id %d", tem); | 15671 | debug_method_add (w, "try_window_id %d", tem); |
| 15672 | #endif | 15672 | #endif |
| 15673 | 15673 | ||
| @@ -15724,7 +15724,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 15724 | goto force_start; | 15724 | goto force_start; |
| 15725 | } | 15725 | } |
| 15726 | 15726 | ||
| 15727 | #if GLYPH_DEBUG | 15727 | #ifdef GLYPH_DEBUG |
| 15728 | debug_method_add (w, "same window start"); | 15728 | debug_method_add (w, "same window start"); |
| 15729 | #endif | 15729 | #endif |
| 15730 | 15730 | ||
| @@ -15819,7 +15819,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 15819 | 15819 | ||
| 15820 | recenter: | 15820 | recenter: |
| 15821 | 15821 | ||
| 15822 | #if GLYPH_DEBUG | 15822 | #ifdef GLYPH_DEBUG |
| 15823 | debug_method_add (w, "recenter"); | 15823 | debug_method_add (w, "recenter"); |
| 15824 | #endif | 15824 | #endif |
| 15825 | 15825 | ||
| @@ -16307,7 +16307,7 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 16307 | struct glyph_row *start_row; | 16307 | struct glyph_row *start_row; |
| 16308 | int start_vpos, min_y, max_y; | 16308 | int start_vpos, min_y, max_y; |
| 16309 | 16309 | ||
| 16310 | #if GLYPH_DEBUG | 16310 | #ifdef GLYPH_DEBUG |
| 16311 | if (inhibit_try_window_reusing) | 16311 | if (inhibit_try_window_reusing) |
| 16312 | return 0; | 16312 | return 0; |
| 16313 | #endif | 16313 | #endif |
| @@ -16529,7 +16529,7 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 16529 | /* Update hint: don't try scrolling again in update_window. */ | 16529 | /* Update hint: don't try scrolling again in update_window. */ |
| 16530 | w->desired_matrix->no_scrolling_p = 1; | 16530 | w->desired_matrix->no_scrolling_p = 1; |
| 16531 | 16531 | ||
| 16532 | #if GLYPH_DEBUG | 16532 | #ifdef GLYPH_DEBUG |
| 16533 | debug_method_add (w, "try_window_reusing_current_matrix 1"); | 16533 | debug_method_add (w, "try_window_reusing_current_matrix 1"); |
| 16534 | #endif | 16534 | #endif |
| 16535 | return 1; | 16535 | return 1; |
| @@ -16719,7 +16719,7 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 16719 | w->window_end_valid = Qnil; | 16719 | w->window_end_valid = Qnil; |
| 16720 | w->desired_matrix->no_scrolling_p = 1; | 16720 | w->desired_matrix->no_scrolling_p = 1; |
| 16721 | 16721 | ||
| 16722 | #if GLYPH_DEBUG | 16722 | #ifdef GLYPH_DEBUG |
| 16723 | debug_method_add (w, "try_window_reusing_current_matrix 2"); | 16723 | debug_method_add (w, "try_window_reusing_current_matrix 2"); |
| 16724 | #endif | 16724 | #endif |
| 16725 | return 1; | 16725 | return 1; |
| @@ -17087,7 +17087,7 @@ try_window_id (struct window *w) | |||
| 17087 | struct text_pos start; | 17087 | struct text_pos start; |
| 17088 | ptrdiff_t first_changed_charpos, last_changed_charpos; | 17088 | ptrdiff_t first_changed_charpos, last_changed_charpos; |
| 17089 | 17089 | ||
| 17090 | #if GLYPH_DEBUG | 17090 | #ifdef GLYPH_DEBUG |
| 17091 | if (inhibit_try_window_id) | 17091 | if (inhibit_try_window_id) |
| 17092 | return 0; | 17092 | return 0; |
| 17093 | #endif | 17093 | #endif |
| @@ -17421,7 +17421,7 @@ try_window_id (struct window *w) | |||
| 17421 | GIVE_UP (19); | 17421 | GIVE_UP (19); |
| 17422 | 17422 | ||
| 17423 | 17423 | ||
| 17424 | #if GLYPH_DEBUG | 17424 | #ifdef GLYPH_DEBUG |
| 17425 | 17425 | ||
| 17426 | /* Either there is no unchanged row at the end, or the one we have | 17426 | /* Either there is no unchanged row at the end, or the one we have |
| 17427 | now displays text. This is a necessary condition for the window | 17427 | now displays text. This is a necessary condition for the window |
| @@ -17435,7 +17435,7 @@ try_window_id (struct window *w) | |||
| 17435 | : -1); | 17435 | : -1); |
| 17436 | debug_first_unchanged_at_end_vpos = first_unchanged_at_end_vpos; | 17436 | debug_first_unchanged_at_end_vpos = first_unchanged_at_end_vpos; |
| 17437 | 17437 | ||
| 17438 | #endif /* GLYPH_DEBUG != 0 */ | 17438 | #endif /* GLYPH_DEBUG */ |
| 17439 | 17439 | ||
| 17440 | 17440 | ||
| 17441 | /* Display new lines. Set last_text_row to the last new line | 17441 | /* Display new lines. Set last_text_row to the last new line |
| @@ -17805,7 +17805,7 @@ try_window_id (struct window *w) | |||
| 17805 | More debugging support | 17805 | More debugging support |
| 17806 | ***********************************************************************/ | 17806 | ***********************************************************************/ |
| 17807 | 17807 | ||
| 17808 | #if GLYPH_DEBUG | 17808 | #ifdef GLYPH_DEBUG |
| 17809 | 17809 | ||
| 17810 | void dump_glyph_row (struct glyph_row *, int, int) EXTERNALLY_VISIBLE; | 17810 | void dump_glyph_row (struct glyph_row *, int, int) EXTERNALLY_VISIBLE; |
| 17811 | void dump_glyph_matrix (struct glyph_matrix *, int) EXTERNALLY_VISIBLE; | 17811 | void dump_glyph_matrix (struct glyph_matrix *, int) EXTERNALLY_VISIBLE; |
| @@ -22223,7 +22223,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, | |||
| 22223 | 22223 | ||
| 22224 | #ifdef HAVE_WINDOW_SYSTEM | 22224 | #ifdef HAVE_WINDOW_SYSTEM |
| 22225 | 22225 | ||
| 22226 | #if GLYPH_DEBUG | 22226 | #ifdef GLYPH_DEBUG |
| 22227 | 22227 | ||
| 22228 | void | 22228 | void |
| 22229 | dump_glyph_string (struct glyph_string *s) | 22229 | dump_glyph_string (struct glyph_string *s) |
| @@ -28408,7 +28408,7 @@ syms_of_xdisp (void) | |||
| 28408 | message_dolog_marker3 = Fmake_marker (); | 28408 | message_dolog_marker3 = Fmake_marker (); |
| 28409 | staticpro (&message_dolog_marker3); | 28409 | staticpro (&message_dolog_marker3); |
| 28410 | 28410 | ||
| 28411 | #if GLYPH_DEBUG | 28411 | #ifdef GLYPH_DEBUG |
| 28412 | defsubr (&Sdump_frame_glyph_matrix); | 28412 | defsubr (&Sdump_frame_glyph_matrix); |
| 28413 | defsubr (&Sdump_glyph_matrix); | 28413 | defsubr (&Sdump_glyph_matrix); |
| 28414 | defsubr (&Sdump_glyph_row); | 28414 | defsubr (&Sdump_glyph_row); |
| @@ -28620,7 +28620,7 @@ of the top or bottom of the window. */); | |||
| 28620 | Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI). */); | 28620 | Value is a number or a cons (WIDTH-DPI . HEIGHT-DPI). */); |
| 28621 | Vdisplay_pixels_per_inch = make_float (72.0); | 28621 | Vdisplay_pixels_per_inch = make_float (72.0); |
| 28622 | 28622 | ||
| 28623 | #if GLYPH_DEBUG | 28623 | #ifdef GLYPH_DEBUG |
| 28624 | DEFVAR_INT ("debug-end-pos", debug_end_pos, doc: /* Don't ask. */); | 28624 | DEFVAR_INT ("debug-end-pos", debug_end_pos, doc: /* Don't ask. */); |
| 28625 | #endif | 28625 | #endif |
| 28626 | 28626 | ||
| @@ -28937,7 +28937,7 @@ To add a prefix to continuation lines, use `wrap-prefix'. */); | |||
| 28937 | doc: /* Non-nil means don't free realized faces. Internal use only. */); | 28937 | doc: /* Non-nil means don't free realized faces. Internal use only. */); |
| 28938 | inhibit_free_realized_faces = 0; | 28938 | inhibit_free_realized_faces = 0; |
| 28939 | 28939 | ||
| 28940 | #if GLYPH_DEBUG | 28940 | #ifdef GLYPH_DEBUG |
| 28941 | DEFVAR_BOOL ("inhibit-try-window-id", inhibit_try_window_id, | 28941 | DEFVAR_BOOL ("inhibit-try-window-id", inhibit_try_window_id, |
| 28942 | doc: /* Inhibit try_window_id display optimization. */); | 28942 | doc: /* Inhibit try_window_id display optimization. */); |
| 28943 | inhibit_try_window_id = 0; | 28943 | inhibit_try_window_id = 0; |
diff --git a/src/xfaces.c b/src/xfaces.c index a319c542b07..021d40559e5 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -441,7 +441,7 @@ static Lisp_Object Vparam_value_alist; | |||
| 441 | 441 | ||
| 442 | /* The total number of colors currently allocated. */ | 442 | /* The total number of colors currently allocated. */ |
| 443 | 443 | ||
| 444 | #if GLYPH_DEBUG | 444 | #ifdef GLYPH_DEBUG |
| 445 | static int ncolors_allocated; | 445 | static int ncolors_allocated; |
| 446 | static int npixmaps_allocated; | 446 | static int npixmaps_allocated; |
| 447 | static int ngcs; | 447 | static int ngcs; |
| @@ -1010,7 +1010,7 @@ load_pixmap (FRAME_PTR f, Lisp_Object name, unsigned int *w_ptr, | |||
| 1010 | } | 1010 | } |
| 1011 | else | 1011 | else |
| 1012 | { | 1012 | { |
| 1013 | #if GLYPH_DEBUG | 1013 | #ifdef GLYPH_DEBUG |
| 1014 | ++npixmaps_allocated; | 1014 | ++npixmaps_allocated; |
| 1015 | #endif | 1015 | #endif |
| 1016 | if (w_ptr) | 1016 | if (w_ptr) |
| @@ -1375,7 +1375,7 @@ load_color (struct frame *f, struct face *face, Lisp_Object name, | |||
| 1375 | abort (); | 1375 | abort (); |
| 1376 | } | 1376 | } |
| 1377 | } | 1377 | } |
| 1378 | #if GLYPH_DEBUG | 1378 | #ifdef GLYPH_DEBUG |
| 1379 | else | 1379 | else |
| 1380 | ++ncolors_allocated; | 1380 | ++ncolors_allocated; |
| 1381 | #endif | 1381 | #endif |
| @@ -1855,7 +1855,6 @@ the WIDTH times as wide as FACE on FRAME. */) | |||
| 1855 | #define LFACE_INHERIT(LFACE) AREF ((LFACE), LFACE_INHERIT_INDEX) | 1855 | #define LFACE_INHERIT(LFACE) AREF ((LFACE), LFACE_INHERIT_INDEX) |
| 1856 | #define LFACE_FONTSET(LFACE) AREF ((LFACE), LFACE_FONTSET_INDEX) | 1856 | #define LFACE_FONTSET(LFACE) AREF ((LFACE), LFACE_FONTSET_INDEX) |
| 1857 | 1857 | ||
| 1858 | #ifdef ENABLE_CHECKING | ||
| 1859 | /* Non-zero if LFACE is a Lisp face. A Lisp face is a vector of size | 1858 | /* Non-zero if LFACE is a Lisp face. A Lisp face is a vector of size |
| 1860 | LFACE_VECTOR_SIZE which has the symbol `face' in slot 0. */ | 1859 | LFACE_VECTOR_SIZE which has the symbol `face' in slot 0. */ |
| 1861 | 1860 | ||
| @@ -1863,10 +1862,9 @@ the WIDTH times as wide as FACE on FRAME. */) | |||
| 1863 | (VECTORP (LFACE) \ | 1862 | (VECTORP (LFACE) \ |
| 1864 | && ASIZE (LFACE) == LFACE_VECTOR_SIZE \ | 1863 | && ASIZE (LFACE) == LFACE_VECTOR_SIZE \ |
| 1865 | && EQ (AREF (LFACE, 0), Qface)) | 1864 | && EQ (AREF (LFACE, 0), Qface)) |
| 1866 | #endif | ||
| 1867 | 1865 | ||
| 1868 | 1866 | ||
| 1869 | #if GLYPH_DEBUG | 1867 | #ifdef GLYPH_DEBUG |
| 1870 | 1868 | ||
| 1871 | /* Check consistency of Lisp face attribute vector ATTRS. */ | 1869 | /* Check consistency of Lisp face attribute vector ATTRS. */ |
| 1872 | 1870 | ||
| @@ -1953,12 +1951,12 @@ check_lface (Lisp_Object lface) | |||
| 1953 | } | 1951 | } |
| 1954 | } | 1952 | } |
| 1955 | 1953 | ||
| 1956 | #else /* GLYPH_DEBUG == 0 */ | 1954 | #else /* not GLYPH_DEBUG */ |
| 1957 | 1955 | ||
| 1958 | #define check_lface_attrs(attrs) (void) 0 | 1956 | #define check_lface_attrs(attrs) (void) 0 |
| 1959 | #define check_lface(lface) (void) 0 | 1957 | #define check_lface(lface) (void) 0 |
| 1960 | 1958 | ||
| 1961 | #endif /* GLYPH_DEBUG == 0 */ | 1959 | #endif /* GLYPH_DEBUG */ |
| 1962 | 1960 | ||
| 1963 | 1961 | ||
| 1964 | 1962 | ||
| @@ -4461,7 +4459,7 @@ cache_face (struct face_cache *c, struct face *face, unsigned int hash) | |||
| 4461 | break; | 4459 | break; |
| 4462 | face->id = i; | 4460 | face->id = i; |
| 4463 | 4461 | ||
| 4464 | #if GLYPH_DEBUG | 4462 | #ifdef GLYPH_DEBUG |
| 4465 | /* Check that FACE got a unique id. */ | 4463 | /* Check that FACE got a unique id. */ |
| 4466 | { | 4464 | { |
| 4467 | int j, n; | 4465 | int j, n; |
| @@ -4547,7 +4545,7 @@ lookup_face (struct frame *f, Lisp_Object *attr) | |||
| 4547 | if (face == NULL) | 4545 | if (face == NULL) |
| 4548 | face = realize_face (cache, attr, -1); | 4546 | face = realize_face (cache, attr, -1); |
| 4549 | 4547 | ||
| 4550 | #if GLYPH_DEBUG | 4548 | #ifdef GLYPH_DEBUG |
| 4551 | eassert (face == FACE_FROM_ID (f, face->id)); | 4549 | eassert (face == FACE_FROM_ID (f, face->id)); |
| 4552 | #endif /* GLYPH_DEBUG */ | 4550 | #endif /* GLYPH_DEBUG */ |
| 4553 | 4551 | ||
| @@ -6450,7 +6448,7 @@ where R,G,B are numbers between 0 and 255 and name is an arbitrary string. */) | |||
| 6450 | Tests | 6448 | Tests |
| 6451 | ***********************************************************************/ | 6449 | ***********************************************************************/ |
| 6452 | 6450 | ||
| 6453 | #if GLYPH_DEBUG | 6451 | #ifdef GLYPH_DEBUG |
| 6454 | 6452 | ||
| 6455 | /* Print the contents of the realized face FACE to stderr. */ | 6453 | /* Print the contents of the realized face FACE to stderr. */ |
| 6456 | 6454 | ||
| @@ -6525,7 +6523,7 @@ DEFUN ("show-face-resources", Fshow_face_resources, Sshow_face_resources, | |||
| 6525 | return Qnil; | 6523 | return Qnil; |
| 6526 | } | 6524 | } |
| 6527 | 6525 | ||
| 6528 | #endif /* GLYPH_DEBUG != 0 */ | 6526 | #endif /* GLYPH_DEBUG */ |
| 6529 | 6527 | ||
| 6530 | 6528 | ||
| 6531 | 6529 | ||
| @@ -6649,7 +6647,7 @@ syms_of_xfaces (void) | |||
| 6649 | defsubr (&Sinternal_set_alternative_font_family_alist); | 6647 | defsubr (&Sinternal_set_alternative_font_family_alist); |
| 6650 | defsubr (&Sinternal_set_alternative_font_registry_alist); | 6648 | defsubr (&Sinternal_set_alternative_font_registry_alist); |
| 6651 | defsubr (&Sface_attributes_as_vector); | 6649 | defsubr (&Sface_attributes_as_vector); |
| 6652 | #if GLYPH_DEBUG | 6650 | #ifdef GLYPH_DEBUG |
| 6653 | defsubr (&Sdump_face); | 6651 | defsubr (&Sdump_face); |
| 6654 | defsubr (&Sshow_face_resources); | 6652 | defsubr (&Sshow_face_resources); |
| 6655 | #endif /* GLYPH_DEBUG */ | 6653 | #endif /* GLYPH_DEBUG */ |
diff --git a/src/xfns.c b/src/xfns.c index 00cf9f8e081..13c7070e229 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -136,7 +136,7 @@ static Lisp_Object Qundefined_color; | |||
| 136 | static Lisp_Object Qcompound_text, Qcancel_timer; | 136 | static Lisp_Object Qcompound_text, Qcancel_timer; |
| 137 | Lisp_Object Qfont_param; | 137 | Lisp_Object Qfont_param; |
| 138 | 138 | ||
| 139 | #if GLYPH_DEBUG | 139 | #ifdef GLYPH_DEBUG |
| 140 | static ptrdiff_t image_cache_refcount; | 140 | static ptrdiff_t image_cache_refcount; |
| 141 | static int dpyinfo_refcount; | 141 | static int dpyinfo_refcount; |
| 142 | #endif | 142 | #endif |
| @@ -2914,14 +2914,14 @@ unwind_create_frame (Lisp_Object frame) | |||
| 2914 | /* If frame is ``official'', nothing to do. */ | 2914 | /* If frame is ``official'', nothing to do. */ |
| 2915 | if (NILP (Fmemq (frame, Vframe_list))) | 2915 | if (NILP (Fmemq (frame, Vframe_list))) |
| 2916 | { | 2916 | { |
| 2917 | #if GLYPH_DEBUG && defined ENABLE_CHECKING | 2917 | #if defined GLYPH_DEBUG && defined ENABLE_CHECKING |
| 2918 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | 2918 | struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); |
| 2919 | #endif | 2919 | #endif |
| 2920 | 2920 | ||
| 2921 | x_free_frame_resources (f); | 2921 | x_free_frame_resources (f); |
| 2922 | free_glyphs (f); | 2922 | free_glyphs (f); |
| 2923 | 2923 | ||
| 2924 | #if GLYPH_DEBUG | 2924 | #if defined GLYPH_DEBUG && defined ENABLE_CHECKING |
| 2925 | /* Check that reference counts are indeed correct. */ | 2925 | /* Check that reference counts are indeed correct. */ |
| 2926 | eassert (dpyinfo->reference_count == dpyinfo_refcount); | 2926 | eassert (dpyinfo->reference_count == dpyinfo_refcount); |
| 2927 | eassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount); | 2927 | eassert (dpyinfo->terminal->image_cache->refcount == image_cache_refcount); |
| @@ -3296,7 +3296,7 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3296 | "scrollBarBackground", | 3296 | "scrollBarBackground", |
| 3297 | "ScrollBarBackground", 0); | 3297 | "ScrollBarBackground", 0); |
| 3298 | 3298 | ||
| 3299 | #if GLYPH_DEBUG | 3299 | #ifdef GLYPH_DEBUG |
| 3300 | image_cache_refcount = | 3300 | image_cache_refcount = |
| 3301 | FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; | 3301 | FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; |
| 3302 | dpyinfo_refcount = dpyinfo->reference_count; | 3302 | dpyinfo_refcount = dpyinfo->reference_count; |
| @@ -4730,7 +4730,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo, | |||
| 4730 | x_default_parameter (f, parms, Qborder_color, build_string ("black"), | 4730 | x_default_parameter (f, parms, Qborder_color, build_string ("black"), |
| 4731 | "borderColor", "BorderColor", RES_TYPE_STRING); | 4731 | "borderColor", "BorderColor", RES_TYPE_STRING); |
| 4732 | 4732 | ||
| 4733 | #if GLYPH_DEBUG | 4733 | #ifdef GLYPH_DEBUG |
| 4734 | image_cache_refcount = | 4734 | image_cache_refcount = |
| 4735 | FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; | 4735 | FRAME_IMAGE_CACHE (f) ? FRAME_IMAGE_CACHE (f)->refcount : 0; |
| 4736 | dpyinfo_refcount = dpyinfo->reference_count; | 4736 | dpyinfo_refcount = dpyinfo->reference_count; |
diff --git a/src/xterm.c b/src/xterm.c index 8e978edf7d9..846aedc0f5b 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -931,7 +931,7 @@ static void x_draw_box_rect (struct glyph_string *, int, int, int, int, | |||
| 931 | int, int, int, XRectangle *); | 931 | int, int, int, XRectangle *); |
| 932 | static void x_scroll_bar_clear (struct frame *); | 932 | static void x_scroll_bar_clear (struct frame *); |
| 933 | 933 | ||
| 934 | #if GLYPH_DEBUG | 934 | #ifdef GLYPH_DEBUG |
| 935 | static void x_check_font (struct frame *, struct font *); | 935 | static void x_check_font (struct frame *, struct font *); |
| 936 | #endif | 936 | #endif |
| 937 | 937 | ||
| @@ -9801,7 +9801,7 @@ x_wm_set_icon_position (struct frame *f, int icon_x, int icon_y) | |||
| 9801 | Fonts | 9801 | Fonts |
| 9802 | ***********************************************************************/ | 9802 | ***********************************************************************/ |
| 9803 | 9803 | ||
| 9804 | #if GLYPH_DEBUG | 9804 | #ifdef GLYPH_DEBUG |
| 9805 | 9805 | ||
| 9806 | /* Check that FONT is valid on frame F. It is if it can be found in F's | 9806 | /* Check that FONT is valid on frame F. It is if it can be found in F's |
| 9807 | font table. */ | 9807 | font table. */ |
| @@ -9814,7 +9814,7 @@ x_check_font (struct frame *f, struct font *font) | |||
| 9814 | eassert (font->driver->check (f, font) == 0); | 9814 | eassert (font->driver->check (f, font) == 0); |
| 9815 | } | 9815 | } |
| 9816 | 9816 | ||
| 9817 | #endif /* GLYPH_DEBUG != 0 */ | 9817 | #endif /* GLYPH_DEBUG */ |
| 9818 | 9818 | ||
| 9819 | 9819 | ||
| 9820 | /*********************************************************************** | 9820 | /*********************************************************************** |