#include "shared/cairo-util.h"
#include "shared/config-parser.h"
#include "shared/helpers.h"
+#include "shared/zalloc.h"
#include "weston-desktop-shell-client-protocol.h"
{
struct output *output;
- output = calloc(1, sizeof *output);
+ output = zalloc(sizeof *output);
if (!output)
return;
#include <wayland-client.h>
#include "window.h"
#include "fullscreen-shell-unstable-v1-client-protocol.h"
+#include "shared/zalloc.h"
struct fs_output {
struct wl_list link;
if (fsout->output == output)
return;
- fsout = calloc(1, sizeof *fsout);
+ fsout = zalloc(sizeof *fsout);
+ if (fsout == NULL) {
+ fprintf(stderr, "out of memory in output_handler\n");
+ return;
+ }
fsout->output = output;
wl_list_insert(&fullscreen->output_list, &fsout->link);
}
#include "shared/config-parser.h"
#include "shared/helpers.h"
#include "shared/os-compatibility.h"
+#include "shared/zalloc.h"
#include "ivi-application-client-protocol.h"
#include "ivi-hmi-controller-client-protocol.h"
static void *
mem_alloc(size_t size, char *file, int32_t line)
{
- return fail_on_null(calloc(1, size), size, file, line);
+ return fail_on_null(zalloc(size), size, file, line);
}
#define MEM_ALLOC(s) mem_alloc((s),__FILE__,__LINE__)
#include <wayland-client.h>
#include "shared/os-compatibility.h"
+#include "shared/zalloc.h"
struct device {
enum { KEYBOARD, POINTER } type;
{
void *p;
- p = calloc(1, s);
+ p = zalloc(s);
if (p == NULL) {
fprintf(stderr, "%s: out of memory\n", program_invocation_short_name);
exit(EXIT_FAILURE);
#include <wayland-client.h>
#include "shared/helpers.h"
+#include "shared/zalloc.h"
#include "shared/os-compatibility.h"
#include "presentation-time-client-protocol.h"
"presentation-shm: %s [Delay %i msecs]", run_mode_name[mode],
commit_delay_msecs);
- window = calloc(1, sizeof *window);
+ window = zalloc(sizeof *window);
if (!window)
return NULL;
if (!pres)
return;
- feedback = calloc(1, sizeof *feedback);
+ feedback = zalloc(sizeof *feedback);
if (!feedback)
return;
{
struct output *o;
- o = calloc(1, sizeof(*o));
+ o = zalloc(sizeof(*o));
assert(o);
o->output = wl_registry_bind(d->registry, name,
#include <wayland-client.h>
#include "shared/os-compatibility.h"
+#include "shared/zalloc.h"
#include "xdg-shell-unstable-v5-client-protocol.h"
#include "fullscreen-shell-unstable-v1-client-protocol.h"
#include "scaler-client-protocol.h"
exit(1);
}
- window = calloc(1, sizeof *window);
+ window = zalloc(sizeof *window);
if (!window)
return NULL;
#include <drm_fourcc.h>
#include <wayland-client.h>
+#include "shared/zalloc.h"
#include "xdg-shell-unstable-v5-client-protocol.h"
#include "fullscreen-shell-unstable-v1-client-protocol.h"
#include "linux-dmabuf-unstable-v1-client-protocol.h"
int i;
int ret;
- window = calloc(1, sizeof *window);
+ window = zalloc(sizeof *window);
if (!window)
return NULL;
#include <linux/input.h>
#include <wayland-client.h>
+#include "shared/zalloc.h"
#include "xdg-shell-unstable-v5-client-protocol.h"
#include "fullscreen-shell-unstable-v1-client-protocol.h"
#include "linux-dmabuf-unstable-v1-client-protocol.h"
{
struct window *window;
- window = calloc(1, sizeof *window);
+ window = zalloc(sizeof *window);
if (!window)
return NULL;
#include <wayland-client.h>
#include "shared/os-compatibility.h"
+#include "shared/zalloc.h"
#include "xdg-shell-unstable-v5-client-protocol.h"
#include "fullscreen-shell-unstable-v1-client-protocol.h"
{
struct window *window;
- window = calloc(1, sizeof *window);
+ window = zalloc(sizeof *window);
if (!window)
return NULL;
#include <EGL/eglext.h>
#include "shared/helpers.h"
+#include "shared/zalloc.h"
#include "window.h"
#if 0
EGLint major, minor, n;
EGLBoolean ret;
- egl = calloc(1, sizeof *egl);
+ egl = zalloc(sizeof *egl);
assert(egl);
egl->dpy =
#include "shared/helpers.h"
#include "shared/os-compatibility.h"
+#include "shared/zalloc.h"
#include "presentation-time-client-protocol.h"
typedef void (*print_info_t)(void *info);
static void *
xzalloc(size_t s)
{
- return fail_on_null(calloc(1, s));
+ return fail_on_null(zalloc(s));
}
static char *
#include <wayland-client.h>
#include "shared/cairo-util.h"
#include "shared/helpers.h"
+#include "shared/zalloc.h"
#include "xdg-shell-unstable-v5-client-protocol.h"
#include "text-cursor-position-client-protocol.h"
#include "shared/os-compatibility.h"
if (display->dpy == EGL_NO_DISPLAY)
return NULL;
- surface = calloc(1, sizeof *surface);
+ surface = zalloc(sizeof *surface);
if (!surface)
return NULL;