From 4b1243fbf8a3fc1c59f186d13466b31ad59d56d6 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 12 Jan 2020 14:06:31 -0800 Subject: [PATCH] GUACAMOLE-249: Ensure CLIPRDR message handlers are accepted by compiler regardless of whether const is required. Without a typecast, errors like the following are generated by the compiler: channels/cliprdr.c: In function 'guac_rdp_cliprdr_channel_connected': channels/cliprdr.c:477:27: error: assignment from incompatible pointer type [-Werror] cliprdr->MonitorReady = guac_rdp_cliprdr_monitor_ready; ^ channels/cliprdr.c:478:31: error: assignment from incompatible pointer type [-Werror] cliprdr->ServerFormatList = guac_rdp_cliprdr_format_list; ^ channels/cliprdr.c:479:38: error: assignment from incompatible pointer type [-Werror] cliprdr->ServerFormatDataRequest = guac_rdp_cliprdr_format_data_request; ^ channels/cliprdr.c:480:39: error: assignment from incompatible pointer type [-Werror] cliprdr->ServerFormatDataResponse = guac_rdp_cliprdr_format_data_response; ^ cc1: all warnings being treated as errors This is because FreeRDP commit 65812bd added const to the pointer argument of each of these handlers, wheras older versions of FreeRDP lack const here. Our implementations of these functions declare const and thus do not match the older prototype, though they are compatible with it. --- src/protocols/rdp/channels/cliprdr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/protocols/rdp/channels/cliprdr.c b/src/protocols/rdp/channels/cliprdr.c index a03ffe93..4332d35f 100644 --- a/src/protocols/rdp/channels/cliprdr.c +++ b/src/protocols/rdp/channels/cliprdr.c @@ -474,10 +474,10 @@ static void guac_rdp_cliprdr_channel_connected(rdpContext* context, cliprdr->custom = clipboard; clipboard->cliprdr = cliprdr; - cliprdr->MonitorReady = guac_rdp_cliprdr_monitor_ready; - cliprdr->ServerFormatList = guac_rdp_cliprdr_format_list; - cliprdr->ServerFormatDataRequest = guac_rdp_cliprdr_format_data_request; - cliprdr->ServerFormatDataResponse = guac_rdp_cliprdr_format_data_response; + cliprdr->MonitorReady = (pcCliprdrMonitorReady) guac_rdp_cliprdr_monitor_ready; + cliprdr->ServerFormatList = (pcCliprdrServerFormatList) guac_rdp_cliprdr_format_list; + cliprdr->ServerFormatDataRequest = (pcCliprdrServerFormatDataRequest) guac_rdp_cliprdr_format_data_request; + cliprdr->ServerFormatDataResponse = (pcCliprdrServerFormatDataResponse) guac_rdp_cliprdr_format_data_response; guac_client_log(client, GUAC_LOG_DEBUG, "CLIPRDR (clipboard redirection) " "channel connected.");