diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2012-07-05 10:32:41 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2012-07-05 10:32:41 +0400 |
commit | 23f86fce48e1cc8118f0ea5cce49d1acfd4364c4 (patch) | |
tree | 837ae05f1ad4ad92936f804d580d95751779befe /src/fringe.c | |
parent | 0497dc44b44f148425ff76c4cb7ef0d2ead9750b (diff) | |
download | emacs-23f86fce48e1cc8118f0ea5cce49d1acfd4364c4.tar.gz |
Cleanup xmalloc.
* admin/coccinelle/xzalloc.cocci: Semantic patch to convert
calls to xmalloc with following memset to xzalloc.
* src/lisp.h (xzalloc): New prototype. Omit needless casts.
* src/alloc.c (xzalloc): New function. Omit needless casts.
* src/charset.c: Omit needless casts. Convert all calls to
malloc with following memset to xzalloc.
* src/dispnew.c: Likewise.
* src/fringe.c: Likewise.
* src/image.c: Likewise.
* src/sound.c: Likewise.
* src/term.c: Likewise.
* src/w32fns.c: Likewise.
* src/w32font.c: Likewise.
* src/w32term.c: Likewise.
* src/xfaces.c: Likewise.
* src/xfns.c: Likewise.
* src/xterm.c: Likewise.
* src/atimer.c: Omit needless casts.
* src/buffer.c: Likewise.
* src/callproc.c: Likewise.
* src/ccl.c: Likewise.
* src/coding.c: Likewise.
* src/composite.c: Likewise.
* src/doc.c: Likewise.
* src/doprnt.c: Likewise.
* src/editfns.c: Likewise.
* src/emacs.c: Likewise.
* src/eval.c: Likewise.
* src/filelock.c: Likewise.
* src/fns.c: Likewise.
* src/gtkutil.c: Likewise.
* src/keyboard.c: Likewise.
* src/lisp.h: Likewise.
* src/lread.c: Likewise.
* src/minibuf.c: Likewise.
* src/msdos.c: Likewise.
* src/print.c: Likewise.
* src/process.c: Likewise.
* src/region-cache.c: Likewise.
* src/search.c: Likewise.
* src/sysdep.c: Likewise.
* src/termcap.c: Likewise.
* src/terminal.c: Likewise.
* src/tparam.c: Likewise.
* src/w16select.c: Likewise.
* src/w32.c: Likewise.
* src/w32reg.c: Likewise.
* src/w32select.c: Likewise.
* src/w32uniscribe.c: Likewise.
* src/widget.c: Likewise.
* src/xdisp.c: Likewise.
* src/xmenu.c: Likewise.
* src/xrdb.c: Likewise.
* src/xselect.c: Likewise.
Diffstat (limited to 'src/fringe.c')
-rw-r--r-- | src/fringe.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/fringe.c b/src/fringe.c index 72090dd01ca..cd3b87b43d4 100644 --- a/src/fringe.c +++ b/src/fringe.c @@ -1639,8 +1639,7 @@ If BITMAP already exists, the existing definition is replaced. */) fb.dynamic = 1; - xfb = (struct fringe_bitmap *) xmalloc (sizeof fb - + fb.height * BYTES_PER_BITMAP_ROW); + xfb = xmalloc (sizeof fb + fb.height * BYTES_PER_BITMAP_ROW); fb.bits = b = (unsigned short *) (xfb + 1); memset (b, 0, fb.height); @@ -1805,15 +1804,11 @@ init_fringe (void) max_fringe_bitmaps = MAX_STANDARD_FRINGE_BITMAPS + 20; fringe_bitmaps - = (struct fringe_bitmap **) xmalloc (max_fringe_bitmaps * sizeof (struct fringe_bitmap *)); - fringe_faces - = (Lisp_Object *) xmalloc (max_fringe_bitmaps * sizeof (Lisp_Object)); + = xzalloc (max_fringe_bitmaps * sizeof (struct fringe_bitmap *)); + fringe_faces = xmalloc (max_fringe_bitmaps * sizeof (Lisp_Object)); for (i = 0; i < max_fringe_bitmaps; i++) - { - fringe_bitmaps[i] = NULL; - fringe_faces[i] = Qnil; - } + fringe_faces[i] = Qnil; } #ifdef HAVE_NTGUI |