diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-07-05 11:35:48 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-07-05 11:35:48 -0700 |
commit | 38182d901d030c7d65f4aa7a49b583afb30eb9b7 (patch) | |
tree | a69e1a571495d6ca1c034359d7c995639774ab9b /src/callint.c | |
parent | 6dd5a677dbf794eedaa8325c46d57ac041373361 (diff) | |
download | emacs-38182d901d030c7d65f4aa7a49b583afb30eb9b7.tar.gz emacs-38182d901d030c7d65f4aa7a49b583afb30eb9b7.tar.bz2 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/callint.c')
-rw-r--r-- | src/callint.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/callint.c b/src/callint.c index e5ff99714c0..1a99ca2731c 100644 --- a/src/callint.c +++ b/src/callint.c @@ -331,7 +331,7 @@ invoke it. If KEYS is omitted or nil, the return value of { /* Make a copy of string so that if a GC relocates specs, `string' will still be valid. */ - string = (char *) alloca (SBYTES (specs) + 1); + string = alloca (SBYTES (specs) + 1); memcpy (string, SSDATA (specs), SBYTES (specs) + 1); } else @@ -469,9 +469,9 @@ invoke it. If KEYS is omitted or nil, the return value of < nargs) memory_full (SIZE_MAX); - args = (Lisp_Object *) alloca (nargs * sizeof (Lisp_Object)); - visargs = (Lisp_Object *) alloca (nargs * sizeof (Lisp_Object)); - varies = (signed char *) alloca (nargs); + args = alloca (nargs * sizeof *args); + visargs = alloca (nargs * sizeof *visargs); + varies = alloca (nargs * sizeof *varies); for (i = 0; i < nargs; i++) { |