Fix segfaults on 32-bit systems.

The new "id" properties for the MetaCrtc* and MetaOuput* objects are 64-bit
values, so take care to pass 64-bit values when calling g_object_new.

Fixes https://gitlab.gnome.org/GNOME/mutter/-/issues/1343.
This commit is contained in:
Martin Whitaker
2020-07-23 16:01:16 +01:00
committed by Jonas Ådahl
parent ac6990ef51
commit 7b79fcee45
7 changed files with 15 additions and 15 deletions

View File

@ -137,14 +137,14 @@ meta_test_headless_monitor_connect (void)
crtc_mode_info->refresh_rate = 60.0;
crtc_mode = g_object_new (META_TYPE_CRTC_MODE,
"id", 1,
"id", (uint64_t) 1,
"info", crtc_mode_info,
NULL);
test_setup->modes = g_list_append (NULL, crtc_mode);
gpu = META_GPU (meta_backend_get_gpus (meta_get_backend ())->data);
crtc = g_object_new (META_TYPE_CRTC_TEST,
"id", 1,
"id", (uint64_t) 1,
"gpu", gpu,
NULL);
test_setup->crtcs = g_list_append (NULL, crtc);
@ -169,7 +169,7 @@ meta_test_headless_monitor_connect (void)
output_info->connector_type = META_CONNECTOR_TYPE_DisplayPort;
output = g_object_new (META_TYPE_OUTPUT_TEST,
"id", 1,
"id", (uint64_t) 1,
"gpu", gpu,
"info", output_info,
NULL);

View File

@ -556,7 +556,7 @@ create_monitor_test_setup (MonitorTestCaseSetup *setup,
crtc_mode_info->flags = setup->modes[i].flags;
mode = g_object_new (META_TYPE_CRTC_MODE,
"id", i,
"id", (uint64_t) i,
"info", crtc_mode_info,
NULL);
@ -569,7 +569,7 @@ create_monitor_test_setup (MonitorTestCaseSetup *setup,
MetaCrtc *crtc;
crtc = g_object_new (META_TYPE_CRTC_TEST,
"id", i + 1,
"id", (uint64_t) i + 1,
"gpu", test_get_gpu (),
NULL);
@ -676,7 +676,7 @@ create_monitor_test_setup (MonitorTestCaseSetup *setup,
setup->outputs[i].panel_orientation_transform;
output = g_object_new (META_TYPE_OUTPUT_TEST,
"id", i,
"id", (uint64_t) i,
"gpu", test_get_gpu (),
"info", output_info,
NULL);