diff options
author | Leandro Ribeiro <leandro.ribeiro@collabora.com> | 2023-10-20 14:13:07 -0300 |
---|---|---|
committer | Pekka Paalanen <pq@iki.fi> | 2023-10-30 11:47:35 +0000 |
commit | 33ed93561ece5b505a9121586da3f5a75729292a (patch) | |
tree | 9f8f2a07c4a86aa942a395a39606f09fad73f040 | |
parent | 39de0bd9887ecb0df9c3565af8b09ada73ab00c1 (diff) |
color-noop: make use of xalloc helpers
Use xzalloc instead of zalloc, etc.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
-rw-r--r-- | libweston/color-noop.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libweston/color-noop.c b/libweston/color-noop.c index 4bd1e762..50145769 100644 --- a/libweston/color-noop.c +++ b/libweston/color-noop.c @@ -29,7 +29,7 @@ #include "color.h" #include "shared/helpers.h" -#include "shared/string-helpers.h" +#include "shared/xalloc.h" struct weston_color_manager_noop { struct weston_color_manager base; @@ -67,7 +67,7 @@ cmnoop_get_color_profile_from_icc(struct weston_color_manager *cm, struct weston_color_profile **cprof_out, char **errmsg) { - str_printf(errmsg, "ICC profiles are unsupported."); + *errmsg = xstrdup("ICC profiles are unsupported."); return false; } @@ -107,9 +107,7 @@ cmnoop_create_output_color_outcome(struct weston_color_manager *cm_base, if (!check_output_eotf_mode(output)) return NULL; - co = zalloc(sizeof *co); - if (!co) - return NULL; + co = xzalloc(sizeof *co); /* Identity transform on everything */ co->from_blend_to_output = NULL; @@ -142,9 +140,7 @@ weston_color_manager_noop_create(struct weston_compositor *compositor) { struct weston_color_manager_noop *cm; - cm = zalloc(sizeof *cm); - if (!cm) - return NULL; + cm = xzalloc(sizeof *cm); cm->base.name = "no-op"; cm->base.compositor = compositor; |