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/fringe.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/fringe.c')
| -rw-r--r-- | src/fringe.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/fringe.c b/src/fringe.c index cd3b87b43d4..4ab9c770326 100644 --- a/src/fringe.c +++ b/src/fringe.c | |||
| @@ -1616,12 +1616,10 @@ If BITMAP already exists, the existing definition is replaced. */) | |||
| 1616 | error ("No free fringe bitmap slots"); | 1616 | error ("No free fringe bitmap slots"); |
| 1617 | 1617 | ||
| 1618 | i = max_fringe_bitmaps; | 1618 | i = max_fringe_bitmaps; |
| 1619 | fringe_bitmaps | 1619 | fringe_bitmaps = xrealloc (fringe_bitmaps, |
| 1620 | = ((struct fringe_bitmap **) | 1620 | bitmaps * sizeof *fringe_bitmaps); |
| 1621 | xrealloc (fringe_bitmaps, bitmaps * sizeof *fringe_bitmaps)); | 1621 | fringe_faces = xrealloc (fringe_faces, |
| 1622 | fringe_faces | 1622 | bitmaps * sizeof *fringe_faces); |
| 1623 | = (Lisp_Object *) xrealloc (fringe_faces, | ||
| 1624 | bitmaps * sizeof *fringe_faces); | ||
| 1625 | 1623 | ||
| 1626 | for (i = max_fringe_bitmaps; i < bitmaps; i++) | 1624 | for (i = max_fringe_bitmaps; i < bitmaps; i++) |
| 1627 | { | 1625 | { |
| @@ -1803,9 +1801,8 @@ init_fringe (void) | |||
| 1803 | 1801 | ||
| 1804 | max_fringe_bitmaps = MAX_STANDARD_FRINGE_BITMAPS + 20; | 1802 | max_fringe_bitmaps = MAX_STANDARD_FRINGE_BITMAPS + 20; |
| 1805 | 1803 | ||
| 1806 | fringe_bitmaps | 1804 | fringe_bitmaps = xzalloc (max_fringe_bitmaps * sizeof *fringe_bitmaps); |
| 1807 | = xzalloc (max_fringe_bitmaps * sizeof (struct fringe_bitmap *)); | 1805 | fringe_faces = xmalloc (max_fringe_bitmaps * sizeof *fringe_faces); |
| 1808 | fringe_faces = xmalloc (max_fringe_bitmaps * sizeof (Lisp_Object)); | ||
| 1809 | 1806 | ||
| 1810 | for (i = 0; i < max_fringe_bitmaps; i++) | 1807 | for (i = 0; i < max_fringe_bitmaps; i++) |
| 1811 | fringe_faces[i] = Qnil; | 1808 | fringe_faces[i] = Qnil; |