libweston: make use of some of the new weston assert

We didn't have many Weston assert macros in place, but now we do.

Make use of a few of the newer macros where they make sense. No big
difference, but just to exercise using the correct ones now that they
exist.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This commit is contained in:
Leandro Ribeiro 2025-07-28 23:10:30 -03:00
parent 6d8a15839d
commit 39108501b3
4 changed files with 14 additions and 14 deletions

View file

@ -1314,9 +1314,9 @@ init_icc_to_icc_chain(struct cmlcms_color_transform *xform)
struct lcmsProfilePtr chain[5];
unsigned chain_len = 0;
weston_assert_u32_eq(cm->base.compositor, out_prof->type, CMLCMS_PROFILE_TYPE_ICC);
weston_assert_enum(cm->base.compositor, out_prof->type, CMLCMS_PROFILE_TYPE_ICC);
if (in_prof) {
weston_assert_u32_eq(cm->base.compositor, in_prof->type,
weston_assert_enum(cm->base.compositor, in_prof->type,
CMLCMS_PROFILE_TYPE_ICC);
}
@ -1393,7 +1393,7 @@ init_blend_to_parametric(struct cmlcms_color_transform *xform)
{
struct weston_color_profile_params *out = xform->search_key.output_profile->params;
weston_assert_u32_eq(xform->base.cm->compositor,
weston_assert_enum(xform->base.cm->compositor,
xform->search_key.output_profile->type,
CMLCMS_PROFILE_TYPE_PARAMS);
@ -1560,9 +1560,9 @@ init_parametric_to_parametric(struct cmlcms_color_transform *xform)
struct weston_mat4f mat;
char *errmsg = NULL;
weston_assert_u32_eq(cm->base.compositor, recipe->input_profile->type,
weston_assert_enum(cm->base.compositor, recipe->input_profile->type,
CMLCMS_PROFILE_TYPE_PARAMS);
weston_assert_u32_eq(cm->base.compositor, recipe->output_profile->type,
weston_assert_enum(cm->base.compositor, recipe->output_profile->type,
CMLCMS_PROFILE_TYPE_PARAMS);
/*

View file

@ -245,7 +245,7 @@ cmnoop_destroy(struct weston_color_manager *cm_base)
* Currently we have a bug in which we leak surfaces when shutting down
* Weston with client surfaces alive, and these surfaces may have a
* reference to the stock sRGB profile. */
weston_assert_u32_ge(cm_base->compositor,
weston_assert_s32_ge(cm_base->compositor,
cmnoop->stock_cprof->base.ref_count, 1);
unref_cprof(cmnoop->stock_cprof);

View file

@ -311,7 +311,7 @@ weston_color_profile_param_builder_set_tf_named(struct weston_color_profile_para
return false;
builder->params.tf_info = weston_color_tf_info_from(compositor, tf);
weston_assert_u32_eq(builder->compositor,
weston_assert_uint_eq(builder->compositor,
builder->params.tf_info->count_parameters, 0);
builder->group_mask |= WESTON_COLOR_PROFILE_PARAMS_TF;

View file

@ -260,7 +260,7 @@ weston_color_curve_enum_get_parametric(struct weston_compositor *compositor,
}
/* No other TF's have params. */
weston_assert_u32_eq(compositor, curve->tf->count_parameters, 0);
weston_assert_uint_eq(compositor, curve->tf->count_parameters, 0);
if (!curve->tf->curve_params_valid)
return false;