From: Chong Yidong Date: Sat, 18 Jun 2011 19:15:06 +0000 (-0400) Subject: Fixes for GLYPH_DEBUG. X-Git-Tag: emacs-pretest-24.0.90~104^2~521 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7d7d00451f78eafdad6d9c06e51de544137e64fb;p=emacs.git Fixes for GLYPH_DEBUG. * dispnew.c (add_window_display_history): Use BVAR. * xdisp.c (debug_method_add): Use BVAR. (check_window_end, dump_glyph_matrix, dump_glyph) (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C. * xfaces.c (check_lface_attrs, check_lface, dump_realized_face): Likewise. * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache check till after the cache is created in init_frame_faces. --- diff --git a/src/ChangeLog b/src/ChangeLog index f8e791285b1..a38f79eaa12 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,17 @@ +2011-06-18 Chong Yidong + + * dispnew.c (add_window_display_history): Use BVAR. + + * xdisp.c (debug_method_add): Use BVAR. + (check_window_end, dump_glyph_matrix, dump_glyph) + (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C. + + * xfaces.c (check_lface_attrs, check_lface, dump_realized_face): + Likewise. + + * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache + check till after the cache is created in init_frame_faces. + 2011-06-17 Stefan Monnier * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup. @@ -1349,7 +1363,7 @@ 2011-05-18 Christoph Scholtes * menu.c: Include limits.h (fixes the MS-Windows build broken by - revision 104625). + 2011-06-18T18:49:19Z!cyd@stupidchicken.com). 2011-05-18 Paul Eggert diff --git a/src/dispnew.c b/src/dispnew.c index 2dffc0dce25..dbf052dd099 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -310,8 +310,8 @@ add_window_display_history (struct window *w, const char *msg, int paused_p) history_tick++, w, ((BUFFERP (w->buffer) - && STRINGP (XBUFFER (w->buffer)->name)) - ? SSDATA (XBUFFER (w->buffer)->name) + && STRINGP (BVAR (XBUFFER (w->buffer), name))) + ? SSDATA (BVAR (XBUFFER (w->buffer), name)) : "???"), paused_p ? " ***paused***" : ""); strcat (buf, msg); diff --git a/src/xdisp.c b/src/xdisp.c index 5a0b0060fa3..3b34005d389 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2248,8 +2248,7 @@ check_it (it) to be---the last row in the current matrix displaying text. */ static void -check_window_end (w) - struct window *w; +check_window_end (struct window *w) { if (!MINI_WINDOW_P (w) && !NILP (w->window_end_valid)) @@ -11147,8 +11146,8 @@ debug_method_add (w, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9) fprintf (stderr, "%p (%s): %s\n", w, ((BUFFERP (w->buffer) - && STRINGP (XBUFFER (w->buffer)->name)) - ? SSDATA (XBUFFER (w->buffer)->name) + && STRINGP (BVAR (XBUFFER (w->buffer), name))) + ? SSDATA (BVAR (XBUFFER (w->buffer), name)) : "no buffer"), buffer); } @@ -16277,9 +16276,7 @@ void dump_glyph (struct glyph_row *, struct glyph *, int); GLYPHS > 1 means show glyphs in long form. */ void -dump_glyph_matrix (matrix, glyphs) - struct glyph_matrix *matrix; - int glyphs; +dump_glyph_matrix (struct glyph_matrix *matrix, int glyphs) { int i; for (i = 0; i < matrix->nrows; ++i) @@ -16291,10 +16288,7 @@ dump_glyph_matrix (matrix, glyphs) the glyph row and area where the glyph comes from. */ void -dump_glyph (row, glyph, area) - struct glyph_row *row; - struct glyph *glyph; - int area; +dump_glyph (struct glyph_row *row, struct glyph *glyph, int area) { if (glyph->type == CHAR_GLYPH) { @@ -16387,9 +16381,7 @@ dump_glyph (row, glyph, area) GLYPHS > 1 means show glyphs in long form. */ void -dump_glyph_row (row, vpos, glyphs) - struct glyph_row *row; - int vpos, glyphs; +dump_glyph_row (struct glyph_row *row, int vpos, int glyphs) { if (glyphs != 1) { @@ -20470,8 +20462,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, #if GLYPH_DEBUG void -dump_glyph_string (s) - struct glyph_string *s; +dump_glyph_string (struct glyph_string *s) { fprintf (stderr, "glyph string\n"); fprintf (stderr, " x, y, w, h = %d, %d, %d, %d\n", diff --git a/src/xfaces.c b/src/xfaces.c index a56e54c90cd..78ea913526e 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -1858,8 +1858,7 @@ the WIDTH times as wide as FACE on FRAME. */) /* Check consistency of Lisp face attribute vector ATTRS. */ static void -check_lface_attrs (attrs) - Lisp_Object *attrs; +check_lface_attrs (Lisp_Object *attrs) { xassert (UNSPECIFIEDP (attrs[LFACE_FAMILY_INDEX]) || IGNORE_DEFFACE_P (attrs[LFACE_FAMILY_INDEX]) @@ -1930,8 +1929,7 @@ check_lface_attrs (attrs) /* Check consistency of attributes of Lisp face LFACE (a Lisp vector). */ static void -check_lface (lface) - Lisp_Object lface; +check_lface (Lisp_Object lface) { if (!NILP (lface)) { @@ -2008,24 +2006,6 @@ push_named_merge_point (struct named_merge_point *new_named_merge_point, } - -#if 0 /* Seems to be unused. */ -static Lisp_Object -internal_resolve_face_name (nargs, args) - int nargs; - Lisp_Object *args; -{ - return Fget (args[0], args[1]); -} - -static Lisp_Object -resolve_face_name_error (ignore) - Lisp_Object ignore; -{ - return Qnil; -} -#endif - /* Resolve face name FACE_NAME. If FACE_NAME is a string, intern it to make it a symbol. If FACE_NAME is an alias for another face, return that face's name. @@ -6331,8 +6311,7 @@ where R,G,B are numbers between 0 and 255 and name is an arbitrary string. */) /* Print the contents of the realized face FACE to stderr. */ static void -dump_realized_face (face) - struct face *face; +dump_realized_face (struct face *face) { fprintf (stderr, "ID: %d\n", face->id); #ifdef HAVE_X_WINDOWS diff --git a/src/xfns.c b/src/xfns.c index abc273c2bdf..20bfa1df3f0 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3156,10 +3156,6 @@ This function is an internal primitive--use `make-frame' instead. */) /* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe. */ record_unwind_protect (unwind_create_frame, frame); -#if GLYPH_DEBUG - image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount; - dpyinfo_refcount = dpyinfo->reference_count; -#endif /* GLYPH_DEBUG */ /* These colors will be set anyway later, but it's important to get the color reference counts right, so initialize them! */ @@ -3314,6 +3310,11 @@ This function is an internal primitive--use `make-frame' instead. */) happen. */ init_frame_faces (f); +#if GLYPH_DEBUG + image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount; + dpyinfo_refcount = dpyinfo->reference_count; +#endif /* GLYPH_DEBUG */ + /* The X resources controlling the menu-bar and tool-bar are processed specially at startup, and reflected in the mode variables; ignore them here. */ @@ -4606,10 +4607,6 @@ x_create_tip_frame (struct x_display_info *dpyinfo, #endif /* USE_TOOLKIT_SCROLL_BARS */ f->icon_name = Qnil; FRAME_X_DISPLAY_INFO (f) = dpyinfo; -#if GLYPH_DEBUG - image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount; - dpyinfo_refcount = dpyinfo->reference_count; -#endif /* GLYPH_DEBUG */ f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; f->output_data.x->explicit_parent = 0; @@ -4721,6 +4718,11 @@ x_create_tip_frame (struct x_display_info *dpyinfo, happen. */ init_frame_faces (f); +#if GLYPH_DEBUG + image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount; + dpyinfo_refcount = dpyinfo->reference_count; +#endif /* GLYPH_DEBUG */ + f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window; x_figure_window_size (f, parms, 0);