mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-21 22:25:58 +01:00
build: Fix build when using clang (#100)
* Add -Wno-address-of-temporary to allow taking an address of temporary like -fpermissive does for gcc * Make some implicit casts explicit * Implement the wl_array_for_each macro inline as clang does not like to handle it's implicit typecast * Removed unecessary include that was automatically added by the ide * Replaced reinterpret_cast's with c-style casts
This commit is contained in:
parent
b6e1732fda
commit
f9461b0b7d
3 changed files with 15 additions and 12 deletions
|
@ -28,7 +28,8 @@ add_project_arguments(cpp_compiler.get_supported_arguments([
|
|||
'-Wno-pointer-arith',
|
||||
'-Wno-unused-parameter',
|
||||
'-Wno-unused-value',
|
||||
'-fpermissive'
|
||||
'-fpermissive',
|
||||
'-Wno-address-of-temporary'
|
||||
]), language: 'cpp')
|
||||
|
||||
conf_data = configuration_data()
|
||||
|
|
|
@ -169,7 +169,8 @@ static void dmabufFeedbackTrancheFormats(void* data, zwp_linux_dmabuf_feedback_v
|
|||
uint32_t n_modifiers = g_pPortalManager->m_sWaylandConnection.dma.formatTableSize / sizeof(struct fm_entry);
|
||||
fm_entry* fm_entry = (struct fm_entry*)g_pPortalManager->m_sWaylandConnection.dma.formatTable;
|
||||
uint16_t* idx;
|
||||
wl_array_for_each(idx, indices) {
|
||||
|
||||
for (idx = (uint16_t*)indices->data; (const char*)idx < (const char*)indices->data + indices->size; idx++) {
|
||||
if (*idx >= n_modifiers)
|
||||
continue;
|
||||
|
||||
|
|
|
@ -781,7 +781,7 @@ static void pwStreamParamChanged(void* data, uint32_t id, const spa_pod* param)
|
|||
const spa_pod* pod_modifier = &prop_modifier->value;
|
||||
|
||||
uint32_t n_modifiers = SPA_POD_CHOICE_N_VALUES(pod_modifier) - 1;
|
||||
uint64_t* modifiers = SPA_POD_CHOICE_VALUES(pod_modifier);
|
||||
uint64_t* modifiers = (uint64_t*)SPA_POD_CHOICE_VALUES(pod_modifier);
|
||||
modifiers++;
|
||||
uint32_t flags = GBM_BO_USE_RENDERING;
|
||||
uint64_t modifier;
|
||||
|
@ -853,13 +853,14 @@ static void pwStreamParamChanged(void* data, uint32_t id, const spa_pod* param)
|
|||
|
||||
params[0] = build_buffer(&dynBuilder[0].b, blocks, PSTREAM->pSession->sharingData.frameInfoSHM.size, PSTREAM->pSession->sharingData.frameInfoSHM.stride, data_type);
|
||||
|
||||
params[1] = spa_pod_builder_add_object(&dynBuilder[1].b, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header), SPA_PARAM_META_size,
|
||||
SPA_POD_Int(sizeof(struct spa_meta_header)));
|
||||
params[1] = (const spa_pod*)spa_pod_builder_add_object(&dynBuilder[1].b, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header),
|
||||
SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header)));
|
||||
|
||||
params[2] = spa_pod_builder_add_object(&dynBuilder[1].b, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, SPA_POD_Id(SPA_META_VideoTransform),
|
||||
params[2] = (const spa_pod*)spa_pod_builder_add_object(&dynBuilder[1].b, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, SPA_POD_Id(SPA_META_VideoTransform),
|
||||
SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_videotransform)));
|
||||
|
||||
params[3] = spa_pod_builder_add_object(&dynBuilder[2].b, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, SPA_POD_Id(SPA_META_VideoDamage), SPA_PARAM_META_size,
|
||||
params[3] = (const spa_pod*)spa_pod_builder_add_object(
|
||||
&dynBuilder[2].b, SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, SPA_PARAM_META_type, SPA_POD_Id(SPA_META_VideoDamage), SPA_PARAM_META_size,
|
||||
SPA_POD_CHOICE_RANGE_Int(sizeof(struct spa_meta_region) * 4, sizeof(struct spa_meta_region) * 1, sizeof(struct spa_meta_region) * 4));
|
||||
|
||||
pw_stream_update_params(PSTREAM->stream, params, 4);
|
||||
|
|
Loading…
Reference in a new issue