MonitorManager: make sure to pass the right sizes to vararg functions

A gulong is not enough to get 64 bits in all arches, so we must
cast it, or we can corrupt the stack.

This was downstream bug bugzilla.redhat.com/show_bug.cgi?id=1002055

https://bugzilla.gnome.org/show_bug.cgi?id=707267
This commit is contained in:
Giovanni Campagna 2013-09-02 09:29:26 +02:00 committed by Jasper St. Pierre
parent e215f3f5eb
commit 42f267bb50

View File

@ -536,13 +536,13 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
g_variant_builder_add (&crtc_builder, "(uxiiiiiuaua{sv})", g_variant_builder_add (&crtc_builder, "(uxiiiiiuaua{sv})",
i, /* ID */ i, /* ID */
crtc->crtc_id, (gint64)crtc->crtc_id,
(int)crtc->rect.x, (int)crtc->rect.x,
(int)crtc->rect.y, (int)crtc->rect.y,
(int)crtc->rect.width, (int)crtc->rect.width,
(int)crtc->rect.height, (int)crtc->rect.height,
(int)(crtc->current_mode ? crtc->current_mode - manager->modes : -1), (int)(crtc->current_mode ? crtc->current_mode - manager->modes : -1),
crtc->transform, (guint32)crtc->transform,
&transforms, &transforms,
NULL /* properties */); NULL /* properties */);
} }
@ -613,7 +613,7 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
g_variant_builder_add (&output_builder, "(uxiausauaua{sv})", g_variant_builder_add (&output_builder, "(uxiausauaua{sv})",
i, /* ID */ i, /* ID */
output->output_id, (gint64)output->output_id,
(int)(output->crtc ? output->crtc - manager->crtcs : -1), (int)(output->crtc ? output->crtc - manager->crtcs : -1),
&crtcs, &crtcs,
output->name, output->name,
@ -628,9 +628,9 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
g_variant_builder_add (&mode_builder, "(uxuud)", g_variant_builder_add (&mode_builder, "(uxuud)",
i, /* ID */ i, /* ID */
mode->mode_id, (gint64)mode->mode_id,
mode->width, (guint32)mode->width,
mode->height, (guint32)mode->height,
(double)mode->refresh_rate); (double)mode->refresh_rate);
} }