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.
This commit is contained in:
Michael Jumper 2020-01-12 14:06:31 -08:00
parent 5e9c7cdb42
commit 4b1243fbf8

View File

@ -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.");