weston/clients
Bryce Harrington da9d8fa3e4 clients: Simplify memory allocation with xzalloc()
It is redundant to check x*alloc's return value for null pointers, since
they are guaranteed to either return non-NULL or terminate the program.

In cases where we memset the malloc'd memory to 0, we can more
efficiently use the xzalloc() routine.  zalloc looks for opportunities
to return memory chunks that have already been zero'd out, so it can
provide better performance.

This patch addresses this warning, reported by Denis Denisov:

  [clients/window.c:1164] -> [clients/window.c:1166]: (warning) Possible
  null pointer dereference: surface - otherwise it is redundant to check
  it against null.

  [clients/window.c:4513] -> [clients/window.c:4514]: (warning) Possible
  null pointer dereference: surface - otherwise it is redundant to check
  it against null.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
2015-07-10 00:15:42 -07:00
..
calibrator.c Moved helper macro to a discrete include file. 2015-06-15 17:11:45 -07:00
clickdot.c Unified multiple definitions of container_of() macro. 2015-06-15 17:11:58 -07:00
cliptest.c clients: Update boilerplate from MIT X11 license to MIT Expat licenses 2015-06-15 13:04:18 -07:00
desktop-shell.c Unified multiple definitions of container_of() macro. 2015-06-15 17:11:58 -07:00
dnd.c Moved helper macro to a discrete include file. 2015-06-15 17:11:45 -07:00
editor.c Moved helper macro to a discrete include file. 2015-06-15 17:11:45 -07:00
eventdemo.c Moved helper macro to a discrete include file. 2015-06-15 17:11:45 -07:00
flower.c clients: Update boilerplate from MIT X11 license to MIT Expat licenses 2015-06-15 13:04:18 -07:00
fullscreen.c clients: Update boilerplate from MIT X11 license to MIT Expat licenses 2015-06-15 13:04:18 -07:00
gears.c clients: Update boilerplate from MIT X11 license to MIT Expat licenses 2015-06-15 13:04:18 -07:00
image.c Remove redundant #include path component. 2015-06-15 17:11:09 -07:00
ivi-shell-user-interface.c Moved helper macro to a discrete include file. 2015-06-15 17:11:45 -07:00
keyboard.c clients: Update boilerplate from MIT X11 license to MIT Expat licenses 2015-06-15 13:04:18 -07:00
multi-resource.c Remove redundant #include path component. 2015-06-15 17:11:09 -07:00
nested-client.c clients: Update boilerplate from MIT X11 license to MIT Expat licenses 2015-06-15 13:04:18 -07:00
nested.c Moved the MIN() macro to the helper include. 2015-06-15 17:11:52 -07:00
presentation-shm.c Moved helper macro to a discrete include file. 2015-06-15 17:11:45 -07:00
resizor.c clients: Update boilerplate from MIT X11 license to MIT Expat licenses 2015-06-15 13:04:18 -07:00
scaler.c clients: Update boilerplate from MIT X11 license to MIT Expat licenses 2015-06-15 13:04:18 -07:00
screenshot.c Remove redundant #include path component. 2015-06-15 17:11:09 -07:00
simple-damage.c Remove redundant #include path component. 2015-06-15 17:11:09 -07:00
simple-egl.c Remove redundant #include path component. 2015-06-15 17:11:09 -07:00
simple-shm.c Remove redundant #include path component. 2015-06-15 17:11:09 -07:00
simple-touch.c Moved helper macro to a discrete include file. 2015-06-15 17:11:45 -07:00
smoke.c clients: Update boilerplate from MIT X11 license to MIT Expat licenses 2015-06-15 13:04:18 -07:00
stacking.c Moved helper macro to a discrete include file. 2015-06-15 17:11:45 -07:00
subsurfaces.c Moved helper macro to a discrete include file. 2015-06-15 17:11:45 -07:00
terminal.c Moved helper macro to a discrete include file. 2015-06-15 17:11:45 -07:00
transformed.c clients: Update boilerplate from MIT X11 license to MIT Expat licenses 2015-06-15 13:04:18 -07:00
weston-info.c Moved the MIN() macro to the helper include. 2015-06-15 17:11:52 -07:00
weston-simple-im.c clients: Update boilerplate from MIT X11 license to MIT Expat licenses 2015-06-15 13:04:18 -07:00
window.c clients: Simplify memory allocation with xzalloc() 2015-07-10 00:15:42 -07:00
window.h Unified multiple definitions of container_of() macro. 2015-06-15 17:11:58 -07:00