aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVille Syrjälä2012-02-02 13:53:43 -0600
committerJerome Glisse2012-02-02 13:53:43 -0600
commit76b4a69aab7cbfb4a087194b6d6ee182c1d5dd7e (patch)
treee8acfa3beb1ef0041bc37d461d73a02f80988b1f /xf86drmMode.c
parenta14c3dd0f9c468d5dba86df5ffa786aea77068a9 (diff)
downloadexternal-libgbm-76b4a69aab7cbfb4a087194b6d6ee182c1d5dd7e.tar.gz
external-libgbm-76b4a69aab7cbfb4a087194b6d6ee182c1d5dd7e.tar.xz
external-libgbm-76b4a69aab7cbfb4a087194b6d6ee182c1d5dd7e.zip
Using sizeof() on a function parameter with an array type does not
work. sizeof() treats such parameters as pointers. Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
Diffstat (limited to 'xf86drmMode.c')
-rw-r--r--xf86drmMode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xf86drmMode.c b/xf86drmMode.c
index 473e7341..c809c44a 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -271,9 +271,9 @@ int drmModeAddFB2(int fd, uint32_t width, uint32_t height,
271 f.height = height; 271 f.height = height;
272 f.pixel_format = pixel_format; 272 f.pixel_format = pixel_format;
273 f.flags = flags; 273 f.flags = flags;
274 memcpy(f.handles, bo_handles, sizeof(bo_handles)); 274 memcpy(f.handles, bo_handles, 4 * sizeof(bo_handles[0]));
275 memcpy(f.pitches, pitches, sizeof(pitches)); 275 memcpy(f.pitches, pitches, 4 * sizeof(pitches[0]));
276 memcpy(f.offsets, offsets, sizeof(offsets)); 276 memcpy(f.offsets, offsets, 4 * sizeof(offsets[0]));
277 277
278 if ((ret = DRM_IOCTL(fd, DRM_IOCTL_MODE_ADDFB2, &f))) 278 if ((ret = DRM_IOCTL(fd, DRM_IOCTL_MODE_ADDFB2, &f)))
279 return ret; 279 return ret;