diff options
| author | Dmitry Antipov | 2012-07-31 16:36:19 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-07-31 16:36:19 +0400 |
| commit | e34f7f79833a23586d32fe522b547a0d9a696c13 (patch) | |
| tree | 4a2d3927202cb91b474bc9648ca9dee2bffaa54a /src/xmenu.c | |
| parent | c09bfb2f140b2885af17185634451e2abfd6e91c (diff) | |
| download | emacs-e34f7f79833a23586d32fe522b547a0d9a696c13.tar.gz emacs-e34f7f79833a23586d32fe522b547a0d9a696c13.zip | |
Generalize INTERNAL_FIELD between buffers, keyboards and frames.
* src/lisp.h (INTERNAL_FIELD): New macro.
* src/buffer.h (BUFFER_INTERNAL_FIELD): Removed.
(BVAR): Change to use INTERNAL_FIELD.
* src/keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
(KVAR): Change to use INTERNAL_FIELD.
* src/frame.h (FVAR): New macro.
(struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
* src/alloc.c, src/buffer.c, src/data.c, src/dispnew.c, src/dosfns.c
* src/eval.c, src/frame.c, src/fringe.c, src/gtkutil.c, src/minibuf.c
* src/nsfns.m, src/nsterm.m, src/print.c, src/term.c, src/w32fns.c
* src/w32menu.c, src/w32term.c, src/window.c, src/window.h, src/xdisp.c
* src/xfaces.c, src/xfns.c, src/xmenu.c, src/xterm.c: Users changed.
* admin/coccinelle/frame.cocci: Semantic patch to replace direct
access to Lisp_Object members of struct frame to FVAR.
Diffstat (limited to 'src/xmenu.c')
| -rw-r--r-- | src/xmenu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index c7ec3dc3171..d1b3198cc80 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -835,7 +835,7 @@ menubar_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data) | |||
| 835 | if (!f) | 835 | if (!f) |
| 836 | return; | 836 | return; |
| 837 | find_and_call_menu_selection (f, f->menu_bar_items_used, | 837 | find_and_call_menu_selection (f, f->menu_bar_items_used, |
| 838 | f->menu_bar_vector, client_data); | 838 | FVAR (f, menu_bar_vector), client_data); |
| 839 | } | 839 | } |
| 840 | #endif /* not USE_GTK */ | 840 | #endif /* not USE_GTK */ |
| 841 | 841 | ||
| @@ -1014,14 +1014,14 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p) | |||
| 1014 | 1014 | ||
| 1015 | /* Save the frame's previous menu bar contents data. */ | 1015 | /* Save the frame's previous menu bar contents data. */ |
| 1016 | if (previous_menu_items_used) | 1016 | if (previous_menu_items_used) |
| 1017 | memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents, | 1017 | memcpy (previous_items, XVECTOR (FVAR (f, menu_bar_vector))->contents, |
| 1018 | previous_menu_items_used * sizeof (Lisp_Object)); | 1018 | previous_menu_items_used * sizeof (Lisp_Object)); |
| 1019 | 1019 | ||
| 1020 | /* Fill in menu_items with the current menu bar contents. | 1020 | /* Fill in menu_items with the current menu bar contents. |
| 1021 | This can evaluate Lisp code. */ | 1021 | This can evaluate Lisp code. */ |
| 1022 | save_menu_items (); | 1022 | save_menu_items (); |
| 1023 | 1023 | ||
| 1024 | menu_items = f->menu_bar_vector; | 1024 | menu_items = FVAR (f, menu_bar_vector); |
| 1025 | menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0; | 1025 | menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0; |
| 1026 | subitems = ASIZE (items) / 4; | 1026 | subitems = ASIZE (items) / 4; |
| 1027 | submenu_start = alloca ((subitems + 1) * sizeof *submenu_start); | 1027 | submenu_start = alloca ((subitems + 1) * sizeof *submenu_start); |
| @@ -1100,7 +1100,7 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p) | |||
| 1100 | } | 1100 | } |
| 1101 | 1101 | ||
| 1102 | /* The menu items are different, so store them in the frame. */ | 1102 | /* The menu items are different, so store them in the frame. */ |
| 1103 | f->menu_bar_vector = menu_items; | 1103 | FVAR (f, menu_bar_vector) = menu_items; |
| 1104 | f->menu_bar_items_used = menu_items_used; | 1104 | f->menu_bar_items_used = menu_items_used; |
| 1105 | 1105 | ||
| 1106 | /* This undoes save_menu_items. */ | 1106 | /* This undoes save_menu_items. */ |