From 17a4e95a5b2441da873f79de03aaec571ec8d15c Mon Sep 17 00:00:00 2001 From: David Fort Date: Fri, 12 May 2017 11:11:41 +0200 Subject: [PATCH] Drop some annoying warning Probably that some unused functions should be removed, but at least it makes it compile with no warnings. --- channels/encomsp/client/encomsp_main.c | 28 +------------------ channels/remdesk/client/remdesk_main.c | 37 -------------------------- client/X11/xf_input.c | 2 ++ client/X11/xf_rail.c | 2 ++ include/freerdp/codec/color.h | 24 ++++++++--------- libfreerdp/cache/nine_grid.c | 2 +- libfreerdp/cache/palette.c | 1 + libfreerdp/codec/progressive.c | 8 +++--- libfreerdp/codec/xcrush.c | 4 ++- libfreerdp/core/capabilities.c | 4 +-- libfreerdp/core/fastpath.c | 14 ---------- libfreerdp/core/gateway/tsg.c | 10 ------- libfreerdp/core/mcs.c | 2 ++ 13 files changed, 29 insertions(+), 109 deletions(-) diff --git a/channels/encomsp/client/encomsp_main.c b/channels/encomsp/client/encomsp_main.c index 96b60a625..bd5bd2c2e 100644 --- a/channels/encomsp/client/encomsp_main.c +++ b/channels/encomsp/client/encomsp_main.c @@ -916,31 +916,6 @@ static void encomsp_process_connect(encomspPlugin* encomsp) { } -static int encomsp_send(encomspPlugin* encomsp, wStream* s) -{ - UINT32 status = 0; - encomspPlugin* plugin = (encomspPlugin*) encomsp; - - if (!plugin) - { - status = CHANNEL_RC_BAD_INIT_HANDLE; - } - else - { - status = plugin->channelEntryPoints.pVirtualChannelWriteEx(plugin->InitHandle, plugin->OpenHandle, - Stream_Buffer(s), (UINT32) Stream_GetPosition(s), s); - } - - if (status != CHANNEL_RC_OK) - { - Stream_Free(s, TRUE); - WLog_ERR(TAG, "VirtualChannelWriteEx failed with %s [%08"PRIX32"]", - WTSErrorToString(status), status); - } - - return status; -} - /** * Function description * @@ -1018,8 +993,7 @@ static VOID VCAPITYPE encomsp_virtual_channel_open_event_ex(LPVOID lpUserParam, case CHANNEL_EVENT_DATA_RECEIVED: if ((error = encomsp_virtual_channel_event_data_received(encomsp, pData, dataLength, totalLength, dataFlags))) - WLog_ERR(TAG, - "encomsp_virtual_channel_event_data_received failed with error %"PRIu32"", error); + WLog_ERR(TAG, "encomsp_virtual_channel_event_data_received failed with error %"PRIu32"", error); break; diff --git a/channels/remdesk/client/remdesk_main.c b/channels/remdesk/client/remdesk_main.c index c7d95f7ca..ec3948cfe 100644 --- a/channels/remdesk/client/remdesk_main.c +++ b/channels/remdesk/client/remdesk_main.c @@ -33,14 +33,6 @@ #include "remdesk_main.h" -static RemdeskClientContext* remdesk_get_client_interface( - remdeskPlugin* remdesk) -{ - RemdeskClientContext* pInterface; - pInterface = (RemdeskClientContext*) remdesk->channelEntryPoints.pInterface; - return pInterface; -} - /** * Function description * @@ -710,35 +702,6 @@ static void remdesk_process_connect(remdeskPlugin* remdesk) remdesk->settings = (rdpSettings*) remdesk->channelEntryPoints.pExtendedData; } -/** - * Function description - * - * @return 0 on success, otherwise a Win32 error code - */ -static UINT remdesk_send(remdeskPlugin* remdesk, wStream* s) -{ - UINT status = 0; - remdeskPlugin* plugin = (remdeskPlugin*) remdesk; - - if (!plugin) - { - status = CHANNEL_RC_BAD_INIT_HANDLE; - } - else - { - status = plugin->channelEntryPoints.pVirtualChannelWriteEx(plugin->InitHandle, plugin->OpenHandle, - Stream_Buffer(s), (UINT32) Stream_GetPosition(s), s); - } - - if (status != CHANNEL_RC_OK) - { - Stream_Free(s, TRUE); - WLog_ERR(TAG, "pVirtualChannelWriteEx failed with %s [%08"PRIX32"]", - WTSErrorToString(status), status); - } - - return status; -} /** * Function description diff --git a/client/X11/xf_input.c b/client/X11/xf_input.c index cf9900093..ec08e9f96 100644 --- a/client/X11/xf_input.c +++ b/client/X11/xf_input.c @@ -480,6 +480,7 @@ static int xf_input_handle_event_local(xfContext* xfc, XEvent* event) return 0; } +#ifdef WITH_DEBUG_X11 static char* xf_input_touch_state_string(DWORD flags) { if (flags & CONTACT_FLAG_DOWN) @@ -491,6 +492,7 @@ static char* xf_input_touch_state_string(DWORD flags) else return "TouchUnknown"; } +#endif static void xf_input_hide_cursor(xfContext* xfc) { diff --git a/client/X11/xf_rail.c b/client/X11/xf_rail.c index 51c565b8c..4928175d5 100644 --- a/client/X11/xf_rail.c +++ b/client/X11/xf_rail.c @@ -43,6 +43,7 @@ static const char* error_code_names[] = "RAIL_EXEC_E_SESSION_LOCKED" }; +#ifdef WITH_DEBUG_RAIL static const char* movetype_names[] = { "(invalid)", @@ -58,6 +59,7 @@ static const char* movetype_names[] = "RAIL_WMSZ_KEYMOVE", "RAIL_WMSZ_KEYSIZE" }; +#endif void xf_rail_enable_remoteapp_mode(xfContext* xfc) { diff --git a/include/freerdp/codec/color.h b/include/freerdp/codec/color.h index 9c1f3d1b1..d61790c70 100644 --- a/include/freerdp/codec/color.h +++ b/include/freerdp/codec/color.h @@ -789,9 +789,9 @@ FREERDP_API BYTE* freerdp_glyph_convert(UINT32 width, UINT32 height, /*** * - * @param pDstData destionation buffer - * @param DstFormat destionation buffer format - * @param nDstStep destionation buffer stride (line in bytes) 0 for default + * @param pDstData destination buffer + * @param DstFormat destination buffer format + * @param nDstStep destination buffer stride (line in bytes) 0 for default * @param nXDst destination buffer offset x * @param nYDst destination buffer offset y * @param nWidth width to copy in pixels @@ -799,7 +799,7 @@ FREERDP_API BYTE* freerdp_glyph_convert(UINT32 width, UINT32 height, * @param pSrcData source buffer, must be (nWidth + 7) / 8 bytes long * @param backColor The background color in internal representation format * @param foreColor The foreground color in internal representation format - * @param palette pallete to use (only used for 8 bit color!) + * @param palette palette to use (only used for 8 bit color!) * * @return TRUE if success, FALSE otherwise */ @@ -813,9 +813,9 @@ FREERDP_API BOOL freerdp_image_copy_from_monochrome(BYTE* pDstData, /*** * - * @param pDstData destionation buffer - * @param DstFormat destionation buffer format - * @param nDstStep destionation buffer stride (line in bytes) 0 for default + * @param pDstData destination buffer + * @param DstFormat destination buffer format + * @param nDstStep destination buffer stride (line in bytes) 0 for default * @param nXDst destination buffer offset x * @param nYDst destination buffer offset y * @param nWidth width to copy in pixels @@ -825,7 +825,7 @@ FREERDP_API BOOL freerdp_image_copy_from_monochrome(BYTE* pDstData, * @param andMask AND mask buffer * @param andMaskLength AND mask length in bytes * @param xorBpp XOR bits per pixel - * @param palette pallete to use (only used for 8 bit color!) + * @param palette palette to use (only used for 8 bit color!) * * @return TRUE if success, FALSE otherwise */ @@ -838,9 +838,9 @@ FREERDP_API BOOL freerdp_image_copy_from_pointer_data( /*** * - * @param pDstData destionation buffer - * @param DstFormat destionation buffer format - * @param nDstStep destionation buffer stride (line in bytes) 0 for default + * @param pDstData destination buffer + * @param DstFormat destination buffer format + * @param nDstStep destination buffer stride (line in bytes) 0 for default * @param nXDst destination buffer offset x * @param nYDst destination buffer offset y * @param nWidth width to copy in pixels @@ -850,7 +850,7 @@ FREERDP_API BOOL freerdp_image_copy_from_pointer_data( * @param nSrcStep source buffer stride (line in bytes) 0 for default * @param nXSrc source buffer x offset in pixels * @param nYSrc source buffer y offset in pixels - * @param palette pallete to use (only used for 8 bit color!) + * @param palette palette to use (only used for 8 bit color!) * @param flags Image flipping flags FREERDP_FLIP_NONE et al * * @return TRUE if success, FALSE otherwise diff --git a/libfreerdp/cache/nine_grid.c b/libfreerdp/cache/nine_grid.c index 8dde7c1d6..7f5a7e825 100644 --- a/libfreerdp/cache/nine_grid.c +++ b/libfreerdp/cache/nine_grid.c @@ -35,10 +35,10 @@ #define TAG FREERDP_TAG("cache.nine_grid") - static void* nine_grid_cache_get(rdpNineGridCache* nine_grid, UINT32 index); static void nine_grid_cache_put(rdpNineGridCache* nine_grid, UINT32 index, void* entry); + static BOOL update_gdi_draw_nine_grid(rdpContext* context, const DRAW_NINE_GRID_ORDER* draw_nine_grid) { diff --git a/libfreerdp/cache/palette.c b/libfreerdp/cache/palette.c index 7b093150f..d5d5732c9 100644 --- a/libfreerdp/cache/palette.c +++ b/libfreerdp/cache/palette.c @@ -31,6 +31,7 @@ #define TAG FREERDP_TAG("cache.palette") static void* palette_cache_get(rdpPaletteCache* palette, UINT32 index); + static void palette_cache_put(rdpPaletteCache* palette, UINT32 index, void* entry); static BOOL update_gdi_cache_color_table(rdpContext* context, diff --git a/libfreerdp/codec/progressive.c b/libfreerdp/codec/progressive.c index 7b9781613..b79408e90 100644 --- a/libfreerdp/codec/progressive.c +++ b/libfreerdp/codec/progressive.c @@ -292,8 +292,7 @@ static INLINE BOOL progressive_rfx_quant_cmp_equal(RFX_COMPONENT_CODEC_QUANT* q1 return TRUE; } -static void progressive_rfx_quant_print(RFX_COMPONENT_CODEC_QUANT* q, - const char* name) +static void progressive_rfx_quant_print(RFX_COMPONENT_CODEC_QUANT* q, const char* name) { fprintf(stderr, "%s: HL1: %"PRIu8" LH1: %"PRIu8" HH1: %"PRIu8" HL2: %"PRIu8" LH2: %"PRIu8" HH2: %"PRIu8" HL3: %"PRIu8" LH3: %"PRIu8" HH3: %"PRIu8" LL3: %"PRIu8"\n", @@ -301,6 +300,7 @@ static void progressive_rfx_quant_print(RFX_COMPONENT_CODEC_QUANT* q, q->LL3); } + static INLINE BOOL progressive_set_surface_data(PROGRESSIVE_CONTEXT* progressive, UINT16 surfaceId, void* pData) { @@ -338,8 +338,7 @@ static PROGRESSIVE_SURFACE_CONTEXT* progressive_surface_context_new(UINT16 surfa surface->gridWidth = (width + (64 - width % 64)) / 64; surface->gridHeight = (height + (64 - height % 64)) / 64; surface->gridSize = surface->gridWidth * surface->gridHeight; - surface->tiles = (RFX_PROGRESSIVE_TILE*) calloc( - surface->gridSize, sizeof(RFX_PROGRESSIVE_TILE)); + surface->tiles = (RFX_PROGRESSIVE_TILE*) calloc(surface->gridSize, sizeof(RFX_PROGRESSIVE_TILE)); if (!surface->tiles) { @@ -399,7 +398,6 @@ INT32 progressive_create_surface_context(PROGRESSIVE_CONTEXT* progressive, int progressive_delete_surface_context(PROGRESSIVE_CONTEXT* progressive, UINT16 surfaceId) { - int ret = 0; PROGRESSIVE_SURFACE_CONTEXT* surface; surface = (PROGRESSIVE_SURFACE_CONTEXT *)progressive_get_surface_data(progressive, surfaceId); diff --git a/libfreerdp/codec/xcrush.c b/libfreerdp/codec/xcrush.c index ba453b331..5df781677 100644 --- a/libfreerdp/codec/xcrush.c +++ b/libfreerdp/codec/xcrush.c @@ -32,6 +32,7 @@ #define TAG FREERDP_TAG("codec") +#ifdef DEBUG_XCRUSH static const char* xcrush_get_level_2_compression_flags_string(UINT32 flags) { flags &= 0xE0; @@ -95,6 +96,7 @@ static const char* xcrush_get_level_1_compression_flags_string(UINT32 flags) return "L1_UNKNOWN"; } +#endif static UINT32 xcrush_update_hash(BYTE* data, UINT32 size) { @@ -974,7 +976,7 @@ int xcrush_compress(XCRUSH_CONTEXT* xcrush, BYTE* pSrcData, UINT32 SrcSize, BYTE Level1ComprFlags |= L1_INNER_COMPRESSION; OriginalData[0] = (BYTE) Level1ComprFlags; OriginalData[1] = (BYTE) Level2ComprFlags; -#if 0 +#if DEBUG_XCRUSH WLog_DBG(TAG, "XCrushCompress: Level1ComprFlags: %s Level2ComprFlags: %s", xcrush_get_level_1_compression_flags_string(Level1ComprFlags), xcrush_get_level_2_compression_flags_string(Level2ComprFlags)); diff --git a/libfreerdp/core/capabilities.c b/libfreerdp/core/capabilities.c index fabe616aa..c083527ae 100644 --- a/libfreerdp/core/capabilities.c +++ b/libfreerdp/core/capabilities.c @@ -2039,6 +2039,7 @@ static void rdp_write_gdiplus_image_cache_properties(wStream* s, UINT16 oiccs, Stream_Write_UINT16(s, oicms); /* gdipObjectImageCacheMaxSize (2 bytes) */ } + #ifdef WITH_DEBUG_CAPABILITIES static BOOL rdp_print_draw_nine_grid_cache_capability_set(wStream* s, UINT16 length) @@ -2098,8 +2099,7 @@ static BOOL rdp_read_draw_gdiplus_cache_capability_set(wStream* s, * @param settings settings */ -static BOOL rdp_write_draw_gdiplus_cache_capability_set(wStream* s, - rdpSettings* settings) +static BOOL rdp_write_draw_gdiplus_cache_capability_set(wStream* s, rdpSettings* settings) { int header; UINT32 drawGDIPlusSupportLevel; diff --git a/libfreerdp/core/fastpath.c b/libfreerdp/core/fastpath.c index fe40f54d3..04c3fc4cb 100644 --- a/libfreerdp/core/fastpath.c +++ b/libfreerdp/core/fastpath.c @@ -446,20 +446,6 @@ static int fastpath_recv_update(rdpFastPath* fastpath, BYTE updateCode, UINT32 s return status; } -static const char* fastpath_get_fragmentation_string(BYTE fragmentation) -{ - if (fragmentation == FASTPATH_FRAGMENT_SINGLE) - return "FASTPATH_FRAGMENT_SINGLE"; - else if (fragmentation == FASTPATH_FRAGMENT_LAST) - return "FASTPATH_FRAGMENT_LAST"; - else if (fragmentation == FASTPATH_FRAGMENT_FIRST) - return "FASTPATH_FRAGMENT_FIRST"; - else if (fragmentation == FASTPATH_FRAGMENT_NEXT) - return "FASTPATH_FRAGMENT_NEXT"; - - return "FASTPATH_FRAGMENT_UNKNOWN"; -} - static int fastpath_recv_update_data(rdpFastPath* fastpath, wStream* s) { int status; diff --git a/libfreerdp/core/gateway/tsg.c b/libfreerdp/core/gateway/tsg.c index 1e24f28bd..589482f06 100644 --- a/libfreerdp/core/gateway/tsg.c +++ b/libfreerdp/core/gateway/tsg.c @@ -1214,11 +1214,6 @@ static BOOL TsProxySetupReceivePipeWriteRequest(rdpTsg* tsg, CONTEXT_HANDLE* cha return TRUE; } -static BOOL TsProxySetupReceivePipeReadResponse(rdpTsg* tsg, RPC_PDU* pdu) -{ - WLog_DBG(TAG, "TsProxySetupReceivePipeReadResponse"); - return TRUE; -} int tsg_transition_to_state(rdpTsg* tsg, TSG_STATE state) { @@ -1860,11 +1855,6 @@ void tsg_free(rdpTsg* tsg) } } -static long transport_bio_tsg_callback(BIO* bio, int mode, const char* argp, int argi, long argl, - long ret) -{ - return 1; -} static int transport_bio_tsg_write(BIO* bio, const char* buf, int num) { diff --git a/libfreerdp/core/mcs.c b/libfreerdp/core/mcs.c index 6fdd5f004..aedb9eae1 100644 --- a/libfreerdp/core/mcs.c +++ b/libfreerdp/core/mcs.c @@ -353,6 +353,7 @@ static BOOL mcs_write_domain_parameters(wStream* s, DomainParameters* domainPara return TRUE; } +#ifdef DEBUG_MCS /** * Print MCS Domain Parameters. * @param domainParameters domain parameters @@ -378,6 +379,7 @@ static void mcs_print_domain_parameters(DomainParameters* domainParameters) WLog_INFO(TAG, "}"); } +#endif /** * Merge MCS Domain Parameters.