aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2014-05-31 03:22:04 +0100
committerChad Versace <chad.versace@linux.intel.com>2014-07-15 07:16:25 -0700
commite424ebcc87c319e9fba6882f655b2228c12a0796 (patch)
tree8777a41abaf3a403f397d3b19fb5dec9a63bc686
parente284bd7f1c235fee66b9ace28b4618501a24777f (diff)
downloadwaffle-e424ebcc87c319e9fba6882f655b2228c12a0796.tar.gz
cgl: use wcore_calloc helper
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r--src/waffle/cgl/cgl_config.m6
-rw-r--r--src/waffle/cgl/cgl_context.m6
-rw-r--r--src/waffle/cgl/cgl_display.m6
-rw-r--r--src/waffle/cgl/cgl_platform.m6
-rw-r--r--src/waffle/cgl/cgl_window.m6
5 files changed, 10 insertions, 20 deletions
diff --git a/src/waffle/cgl/cgl_config.m b/src/waffle/cgl/cgl_config.m
index b4a78a6..04688f4 100644
--- a/src/waffle/cgl/cgl_config.m
+++ b/src/waffle/cgl/cgl_config.m
@@ -236,11 +236,9 @@ cgl_config_choose(struct wcore_platform *wc_plat,
if (!cgl_config_check_attrs(plat, attrs))
return NULL;
- self = calloc(1, sizeof(*self));
- if (!self) {
- wcore_error(WAFFLE_ERROR_BAD_ALLOC);
+ self = wcore_calloc(sizeof(*self));
+ if (!self)
return NULL;
- }
ok = wcore_config_init(&self->wcore, wc_dpy, attrs);
if (!ok)
diff --git a/src/waffle/cgl/cgl_context.m b/src/waffle/cgl/cgl_context.m
index 37c5148..7786113 100644
--- a/src/waffle/cgl/cgl_context.m
+++ b/src/waffle/cgl/cgl_context.m
@@ -61,11 +61,9 @@ cgl_context_create(struct wcore_platform *wc_plat,
int error = 0;
- self = calloc(1, sizeof(*self));
- if (!self) {
- wcore_error(WAFFLE_ERROR_BAD_ALLOC);
+ self = wcore_calloc(sizeof(*self));
+ if (!self)
return NULL;
- }
error = !wcore_context_init(&self->wcore, wc_config);
if (error)
diff --git a/src/waffle/cgl/cgl_display.m b/src/waffle/cgl/cgl_display.m
index bafbb28..015ca32 100644
--- a/src/waffle/cgl/cgl_display.m
+++ b/src/waffle/cgl/cgl_display.m
@@ -52,11 +52,9 @@ cgl_display_connect(struct wcore_platform *wc_plat,
struct cgl_display *self;
bool ok = true;
- self = calloc(1, sizeof(*self));
- if (!self) {
- wcore_error(WAFFLE_ERROR_BAD_ALLOC);
+ self = wcore_calloc(sizeof(*self));
+ if (!self)
return NULL;
- }
ok = wcore_display_init(&self->wcore, wc_plat);
if (!ok)
diff --git a/src/waffle/cgl/cgl_platform.m b/src/waffle/cgl/cgl_platform.m
index fa82041..2da0b40 100644
--- a/src/waffle/cgl/cgl_platform.m
+++ b/src/waffle/cgl/cgl_platform.m
@@ -96,11 +96,9 @@ cgl_platform_create(void)
struct cgl_platform *self;
bool ok = true;
- self= calloc(1, sizeof(*self));
- if (!self) {
- wcore_error(WAFFLE_ERROR_BAD_ALLOC);
+ self = wcore_calloc(sizeof(*self));
+ if (!self)
return NULL;
- }
ok = wcore_platform_init(&self->wcore);
if (!ok)
diff --git a/src/waffle/cgl/cgl_window.m b/src/waffle/cgl/cgl_window.m
index 1c97590..e4711e1 100644
--- a/src/waffle/cgl/cgl_window.m
+++ b/src/waffle/cgl/cgl_window.m
@@ -100,11 +100,9 @@ cgl_window_create(struct wcore_platform *wc_plat,
struct cgl_window *self;
bool ok = true;
- self = calloc(1, sizeof(*self));
- if (!self) {
- wcore_error(WAFFLE_ERROR_BAD_ALLOC);
+ self = wcore_calloc(sizeof(*self));
+ if (!self)
return NULL;
- }
ok = wcore_window_init(&self->wcore, wc_config);
if (!ok)