aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorPaul Eggert2012-07-05 11:35:48 -0700
committerPaul Eggert2012-07-05 11:35:48 -0700
commit38182d901d030c7d65f4aa7a49b583afb30eb9b7 (patch)
treea69e1a571495d6ca1c034359d7c995639774ab9b /src/syntax.c
parent6dd5a677dbf794eedaa8325c46d57ac041373361 (diff)
downloademacs-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/syntax.c')
-rw-r--r--src/syntax.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/syntax.c b/src/syntax.c
index e7e68e23744..de1ab2a7516 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1581,7 +1581,7 @@ skip_chars (int forwardp, Lisp_Object string, Lisp_Object lim, int handle_iso_cl
1581 fastmap[CHAR_LEADING_CODE (c)] = 1; 1581 fastmap[CHAR_LEADING_CODE (c)] = 1;
1582 range_start_byte = i; 1582 range_start_byte = i;
1583 range_start_char = c; 1583 range_start_char = c;
1584 char_ranges = (int *) alloca (sizeof (int) * 128 * 2); 1584 char_ranges = alloca (sizeof *char_ranges * 128 * 2);
1585 for (i = 129; i < 0400; i++) 1585 for (i = 129; i < 0400; i++)
1586 { 1586 {
1587 c = BYTE8_TO_CHAR (i); 1587 c = BYTE8_TO_CHAR (i);
@@ -1602,7 +1602,7 @@ skip_chars (int forwardp, Lisp_Object string, Lisp_Object lim, int handle_iso_cl
1602 } 1602 }
1603 else /* STRING is multibyte */ 1603 else /* STRING is multibyte */
1604 { 1604 {
1605 char_ranges = (int *) alloca (sizeof (int) * SCHARS (string) * 2); 1605 char_ranges = alloca (sizeof *char_ranges * SCHARS (string) * 2);
1606 1606
1607 while (i_byte < size_byte) 1607 while (i_byte < size_byte)
1608 { 1608 {