From: akallabeth Date: Mon, 18 May 2020 05:54:48 +0000 (+0200) Subject: Fixed rails debug string warnings. X-Git-Tag: 2.1.1^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3a2ce9b8bdd53b4ccfb16d795d75c42396070a72;p=platform%2Fupstream%2Ffreerdp.git Fixed rails debug string warnings. (cherry picked from commit e58ea30305e8754ada82018c4f2042ec1b72337c) --- diff --git a/channels/rail/client/rail_orders.c b/channels/rail/client/rail_orders.c index 86a3456..c394a59 100644 --- a/channels/rail/client/rail_orders.c +++ b/channels/rail/client/rail_orders.c @@ -49,8 +49,7 @@ UINT rail_send_pdu(railPlugin* rail, wStream* s, UINT16 orderType) rail_write_pdu_header(s, orderType, orderLength); Stream_SetPosition(s, orderLength); WLog_Print(rail->log, WLOG_DEBUG, "Sending %s PDU, length: %" PRIu16 "", - RAIL_ORDER_TYPE_STRINGS[((orderType & 0xF0) >> 3) + (orderType & 0x0F)], - orderLength); + rail_get_order_type_string(orderType), orderLength); return rail_send_channel_data(rail, s); } @@ -926,8 +925,7 @@ UINT rail_order_recv(railPlugin* rail, wStream* s) } WLog_Print(rail->log, WLOG_DEBUG, "Received %s PDU, length:%" PRIu16 "", - RAIL_ORDER_TYPE_STRINGS[((orderType & 0xF0) >> 3) + (orderType & 0x0F)], - orderLength); + rail_get_order_type_string(orderType), orderLength); switch (orderType) { diff --git a/channels/rail/rail_common.c b/channels/rail/rail_common.c index 4e1a81d..902a738 100644 --- a/channels/rail/rail_common.c +++ b/channels/rail/rail_common.c @@ -27,29 +27,34 @@ #define TAG CHANNELS_TAG("rail.common") -const char* const RAIL_ORDER_TYPE_STRINGS[] = { "", - "Execute", - "Activate", - "System Parameters Update", - "System Command", - "Handshake", - "Notify Event", - "", - "Window Move", - "Local Move/Size", - "Min Max Info", - "Client Status", - "System Menu", - "Language Bar Info", - "Get Application ID Request", - "Get Application ID Response", - "Execute Result", - "", - "", - "", - "", - "", - "" }; +static const char* const RAIL_ORDER_TYPE_STRINGS[] = { "", + "Execute", + "Activate", + "System Parameters Update", + "System Command", + "Handshake", + "Notify Event", + "", + "Window Move", + "Local Move/Size", + "Min Max Info", + "Client Status", + "System Menu", + "Language Bar Info", + "Get Application ID Request", + "Get Application ID Response", + "Execute Result", + "", + "", + "", + "", + "", + "" }; + +const char* rail_get_order_type_string(BYTE orderType) +{ + return RAIL_ORDER_TYPE_STRINGS[((orderType & 0xF0) >> 3) + (orderType & 0x0F)]; +} /** * Function description diff --git a/channels/rail/rail_common.h b/channels/rail/rail_common.h index aa83b8a..6d411eb 100644 --- a/channels/rail/rail_common.h +++ b/channels/rail/rail_common.h @@ -26,7 +26,7 @@ #include -extern const char* const RAIL_ORDER_TYPE_STRINGS[]; +const char* rail_get_order_type_string(BYTE orderType); #define RAIL_PDU_HEADER_LENGTH 4 diff --git a/channels/rail/server/rail_main.c b/channels/rail/server/rail_main.c index 385b0dd..18a7072 100644 --- a/channels/rail/server/rail_main.c +++ b/channels/rail/server/rail_main.c @@ -71,8 +71,8 @@ UINT rail_send_pdu(RailServerContext* context, wStream* s, UINT16 orderType) Stream_SetPosition(s, 0); rail_write_pdu_header(s, orderType, orderLength); Stream_SetPosition(s, orderLength); - WLog_DBG(TAG, "Sending %s PDU, length: %" PRIu16 "", - RAIL_ORDER_TYPE_STRINGS[((orderType & 0xF0) >> 3) + (orderType & 0x0F)], orderLength); + WLog_DBG(TAG, "Sending %s PDU, length: %" PRIu16 "", rail_get_order_type_string(orderType), + orderLength); return rail_send(context, s, orderLength); } @@ -1573,8 +1573,8 @@ UINT rail_server_handle_messages(RailServerContext* context) return ERROR_INTERNAL_ERROR; } - WLog_DBG(TAG, "Received %s PDU, length:%" PRIu16 "", - RAIL_ORDER_TYPE_STRINGS[((orderType & 0xF0) >> 3) + (orderType & 0x0F)], orderLength); + WLog_DBG(TAG, "Received %s PDU, length:%" PRIu16 "", rail_get_order_type_string(orderType), + orderLength); switch (orderType) {