summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2018-07-09 13:49:04 +0100
committerDaniel Stone <daniels@collabora.com>2018-07-09 15:20:11 +0100
commitdc082cb0718d2d07d259ffc02209cbb28714fbdc (patch)
tree457a11b1f2301b5116a726b2b1a95043d5bf2048
parent7625577a4f8dd975a1ba3270d3b5eca1fdef7256 (diff)
downloadweston-dc082cb0718d2d07d259ffc02209cbb28714fbdc.tar.gz
compositor-drm: Avoid cast by using unsigned loop index
ARRAY_LENGTH returns a size_t; rather than casting its result to int so we can compare to our signed index variable, just declare the index as a compatible type in the first place. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-rw-r--r--libweston/compositor-drm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index e09719ce..7753dfba 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -914,7 +914,7 @@ drm_fb_addfb(struct drm_fb *fb)
int ret = -EINVAL;
#ifdef HAVE_DRM_ADDFB2_MODIFIERS
uint64_t mods[4] = { };
- int i;
+ size_t i;
#endif
/* If we have a modifier set, we must only use the WithModifiers
@@ -923,7 +923,7 @@ drm_fb_addfb(struct drm_fb *fb)
/* KMS demands that if a modifier is set, it must be the same
* for all planes. */
#ifdef HAVE_DRM_ADDFB2_MODIFIERS
- for (i = 0; i < (int) ARRAY_LENGTH(mods) && fb->handles[i]; i++)
+ for (i = 0; i < ARRAY_LENGTH(mods) && fb->handles[i]; i++)
mods[i] = fb->modifier;
ret = drmModeAddFB2WithModifiers(fb->fd, fb->width, fb->height,
fb->format->format,