From: Dmitry Antipov Date: Fri, 9 Nov 2012 14:45:15 +0000 (+0400) Subject: Fix recently introduced crash on MS-Windows (Bug#12839). X-Git-Tag: emacs-24.3.90~173^2~18^2~148 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=535cc8e9fbeafed4c3e3ef6d8bbffd489fb1d1b9;p=emacs.git Fix recently introduced crash on MS-Windows (Bug#12839). * w32term.h (struct scroll_bar): Use convenient header. (SCROLL_BAR_VEC_SIZE): Remove. * w32term.c (x_scroll_bar_create): Use VECSIZE. --- diff --git a/src/ChangeLog b/src/ChangeLog index 752dd4313f8..dfc2e730f8b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-11-09 Dmitry Antipov + + Fix recently introduced crash on MS-Windows (Bug#12839). + * w32term.h (struct scroll_bar): Use convenient header. + (SCROLL_BAR_VEC_SIZE): Remove. + * w32term.c (x_scroll_bar_create): Use VECSIZE. + 2012-11-09 Dmitry Antipov Tweak last vectorlike_header change. diff --git a/src/w32term.c b/src/w32term.c index 4cc0b860947..b14a46bc01a 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -3626,7 +3626,7 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height) HWND hwnd; SCROLLINFO si; struct scroll_bar *bar - = XSCROLL_BAR (Fmake_vector (make_number (SCROLL_BAR_VEC_SIZE), Qnil)); + = XSCROLL_BAR (Fmake_vector (make_number (VECSIZE (struct scroll_bar)), Qnil)); Lisp_Object barobj; block_input (); diff --git a/src/w32term.h b/src/w32term.h index af5b37a1171..72fb8a76e35 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -415,9 +415,8 @@ extern struct w32_output w32term_display; struct scroll_bar { - /* These fields are shared by all vectors. */ - EMACS_INT size_from_Lisp_Vector_struct; - struct Lisp_Vector *next_from_Lisp_Vector_struct; + /* This field is shared by all vectors. */ + struct vectorlike_header header; /* The window we're a scroll bar for. */ Lisp_Object window; @@ -460,12 +459,6 @@ struct scroll_bar { Lisp_Object fringe_extended_p; }; -/* The number of elements a vector holding a struct scroll_bar needs. */ -#define SCROLL_BAR_VEC_SIZE \ - ((sizeof (struct scroll_bar) \ - - sizeof (EMACS_INT) - sizeof (struct Lisp_Vector *)) \ - / word_size) - /* Turning a lisp vector value into a pointer to a struct scroll_bar. */ #define XSCROLL_BAR(vec) ((struct scroll_bar *) XVECTOR (vec))