[PATCH 0/5] clients: Use the x*alloc routines

Bryce W. Harrington b.harrington at samsung.com
Tue May 6 19:13:10 PDT 2014


As per our discussion last week, here's patches to convert client code
to using xmalloc, xzalloc, xcalloc, and xstrdup where appropriate.

I opted not to change nested.c, because it looked like errors were being
propagated to a higher level for handling, and bombing out on OOM might
not be desired?

Other files like glmatrix.c, screenshot.c, simple-*.c weston-info.c,
etc. did not include window.h, so I left them unchanged.  If you think
these should also be changed over, I could move the x*alloc() functions
to xalloc.[ch] to allow sharing.

Bryce Harrington (5):
  clients: Add xcalloc
  clients: Use x*alloc routines for memory allocation
  clients: Use calloc instead of malloc/memset=0
  clients: Use xzalloc instead of xcalloc when allocating single
    element
  clients:  Use xstrdup instead of strdup

 clients/calibrator.c        |    5 +----
 clients/desktop-shell.c     |    5 +----
 clients/dnd.c               |    8 ++------
 clients/editor.c            |   20 +++++++++-----------
 clients/eventdemo.c         |    5 +----
 clients/fullscreen.c        |    2 +-
 clients/gears.c             |    2 +-
 clients/image.c             |    8 +++-----
 clients/keyboard.c          |   12 ++++++------
 clients/smoke.c             |   12 ++++++------
 clients/subsurfaces.c       |   12 +++---------
 clients/terminal.c          |    2 +-
 clients/window.c            |   21 ++++++++++-----------
 clients/window.h            |    2 ++
 clients/wscreensaver-glue.c |    8 ++------
 clients/wscreensaver.c      |   14 +++-----------
 16 files changed, 52 insertions(+), 86 deletions(-)

-- 
1.7.9.5


More information about the wayland-devel mailing list