diff options
| author | Paul Eggert | 2012-07-05 11:35:48 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-07-05 11:35:48 -0700 |
| commit | 38182d901d030c7d65f4aa7a49b583afb30eb9b7 (patch) | |
| tree | a69e1a571495d6ca1c034359d7c995639774ab9b /src/menu.c | |
| parent | 6dd5a677dbf794eedaa8325c46d57ac041373361 (diff) | |
| download | emacs-38182d901d030c7d65f4aa7a49b583afb30eb9b7.tar.gz emacs-38182d901d030c7d65f4aa7a49b583afb30eb9b7.zip | |
More xmalloc and related cleanup.
* alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
* callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
* doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
* font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
* gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
* nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
* regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
* sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
* xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
* xterm.c:
Omit needless casts involving void * pointers and allocation.
Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
as the former is more robust if P's type is changed.
Prefer xzalloc to xmalloc + memset 0.
Simplify malloc-or-realloc to realloc.
Don't worry about xmalloc returning a null pointer.
Prefer xstrdup to xmalloc + strcpy.
* editfns.c (Fmessage_box): Grow message_text by at least 80 when
growing it.
* keyboard.c (apply_modifiers_uncached): Prefer local array to
alloca of a constant.
Diffstat (limited to 'src/menu.c')
| -rw-r--r-- | src/menu.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/menu.c b/src/menu.c index 598385c38c0..3b8ebb65d2c 100644 --- a/src/menu.c +++ b/src/menu.c | |||
| @@ -632,8 +632,7 @@ digest_single_submenu (int start, int end, int top_level_items) | |||
| 632 | widget_value **submenu_stack; | 632 | widget_value **submenu_stack; |
| 633 | int panes_seen = 0; | 633 | int panes_seen = 0; |
| 634 | 634 | ||
| 635 | submenu_stack | 635 | submenu_stack = alloca (menu_items_used * sizeof *submenu_stack); |
| 636 | = (widget_value **) alloca (menu_items_used * sizeof (widget_value *)); | ||
| 637 | wv = xmalloc_widget_value (); | 636 | wv = xmalloc_widget_value (); |
| 638 | wv->name = "menu"; | 637 | wv->name = "menu"; |
| 639 | wv->value = 0; | 638 | wv->value = 0; |
| @@ -893,7 +892,7 @@ find_and_call_menu_selection (FRAME_PTR f, int menu_bar_items_used, Lisp_Object | |||
| 893 | int i; | 892 | int i; |
| 894 | 893 | ||
| 895 | entry = Qnil; | 894 | entry = Qnil; |
| 896 | subprefix_stack = (Lisp_Object *) alloca (menu_bar_items_used * sizeof (Lisp_Object)); | 895 | subprefix_stack = alloca (menu_bar_items_used * sizeof *subprefix_stack); |
| 897 | prefix = Qnil; | 896 | prefix = Qnil; |
| 898 | i = 0; | 897 | i = 0; |
| 899 | 898 | ||