From 242f1734ecabfe90edc966ebcf427a54df4bad6a Mon Sep 17 00:00:00 2001 From: akallabeth Date: Wed, 30 Jun 2021 10:19:16 +0200 Subject: [PATCH] Fixed dpkg-buildpackage warnings --- client/Wayland/wlf_input.c | 2 +- client/X11/xf_floatbar.c | 5 +++++ client/X11/xf_graphics.c | 5 ----- client/X11/xf_input.c | 7 +++++-- client/X11/xf_monitor.c | 2 +- client/X11/xf_window.c | 26 +++++++++++++++++--------- libfreerdp/core/nla.c | 5 +++-- server/proxy/pf_context.c | 3 --- 8 files changed, 32 insertions(+), 23 deletions(-) diff --git a/client/Wayland/wlf_input.c b/client/Wayland/wlf_input.c index c2ca50840..f75f90269 100644 --- a/client/Wayland/wlf_input.c +++ b/client/Wayland/wlf_input.c @@ -443,7 +443,7 @@ BOOL wlf_handle_touch_down(freerdp* instance, const UwacTouchDown* ev) return FALSE; context = (wlfContext*)instance->context; - RdpeiClientContext* rdpei = ((wlfContext*)instance->context)->rdpei; + RdpeiClientContext* rdpei = context->rdpei; // Emulate mouse click if touch is not possible, like in login screen if (!rdpei) diff --git a/client/X11/xf_floatbar.c b/client/X11/xf_floatbar.c index 0966ff5b4..c73653b3a 100644 --- a/client/X11/xf_floatbar.c +++ b/client/X11/xf_floatbar.c @@ -183,6 +183,11 @@ static BOOL create_floatbar(xfFloatbar* floatbar) xfc = floatbar->xfc; status = XGetWindowAttributes(xfc->display, floatbar->root_window, &attr); + if (status != 0) + { + WLog_WARN(TAG, "XGetWindowAttributes returned %d", status); + return FALSE; + } floatbar->x = attr.x + attr.width / 2 - FLOATBAR_DEFAULT_WIDTH / 2; floatbar->y = 0; diff --git a/client/X11/xf_graphics.c b/client/X11/xf_graphics.c index bd5f57678..ca6f7ba58 100644 --- a/client/X11/xf_graphics.c +++ b/client/X11/xf_graphics.c @@ -633,7 +633,6 @@ static BOOL xf_Glyph_BeginDraw(rdpContext* context, INT32 x, INT32 y, INT32 widt UINT32 bgcolor, UINT32 fgcolor, BOOL fOpRedundant) { xfContext* xfc = (xfContext*)context; - XRectangle rect; XColor xbgcolor, xfgcolor; if (!xf_decode_color(xfc, bgcolor, &xbgcolor)) @@ -642,10 +641,6 @@ static BOOL xf_Glyph_BeginDraw(rdpContext* context, INT32 x, INT32 y, INT32 widt if (!xf_decode_color(xfc, fgcolor, &xfgcolor)) return FALSE; - rect.x = x; - rect.y = y; - rect.width = width; - rect.height = height; xf_lock_x11(xfc); if (!fOpRedundant) diff --git a/client/X11/xf_input.c b/client/X11/xf_input.c index b20bd38b1..e6ad6bc9d 100644 --- a/client/X11/xf_input.c +++ b/client/X11/xf_input.c @@ -95,7 +95,6 @@ int xf_input_init(xfContext* xfc, Window window) int ndevices; int major = 2; int minor = 2; - Status xstatus; XIDeviceInfo* info; XIEventMask evmasks[64]; int opcode, event, error; @@ -196,7 +195,11 @@ int xf_input_init(xfContext* xfc, Window window) XIFreeDeviceInfo(info); if (nmasks > 0) - xstatus = XISelectEvents(xfc->display, window, evmasks, nmasks); + { + Status xstatus = XISelectEvents(xfc->display, window, evmasks, nmasks); + if (xstatus != 0) + WLog_WARN(TAG, "XISelectEvents returned %d", xstatus); + } return 0; } diff --git a/client/X11/xf_monitor.c b/client/X11/xf_monitor.c index a545892f0..352646885 100644 --- a/client/X11/xf_monitor.c +++ b/client/X11/xf_monitor.c @@ -402,7 +402,7 @@ BOOL xf_detect_monitors(xfContext* xfc, UINT32* pMaxWidth, UINT32* pMaxHeight) attrs->physicalWidth = rrmonitors[i].mwidth; attrs->physicalHeight = rrmonitors[i].mheight; ret = XRRRotations(xfc->display, i, &rot); - attrs->orientation = rot; + attrs->orientation = ret; } #endif diff --git a/client/X11/xf_window.c b/client/X11/xf_window.c index f6871f966..776a772d1 100644 --- a/client/X11/xf_window.c +++ b/client/X11/xf_window.c @@ -497,19 +497,27 @@ xfWindow* xf_CreateDesktopWindow(xfContext* xfc, char* name, int width, int heig } else { - void* mem; - ftruncate(window->shmid, sizeof(window->handle)); - mem = mmap(0, sizeof(window->handle), PROT_READ | PROT_WRITE, MAP_SHARED, window->shmid, 0); - - if (mem == MAP_FAILED) + int rc = ftruncate(window->shmid, sizeof(window->handle)); + if (rc != 0) { - DEBUG_X11("xf_CreateDesktopWindow: failed to assign pointer to the memory address - " - "shmat()\n"); + DEBUG_X11("%s: ftruncate failed with %s [%d]", __FUNCTION__, strerror(rc), rc); } else { - window->xfwin = mem; - *window->xfwin = window->handle; + void* mem = mmap(0, sizeof(window->handle), PROT_READ | PROT_WRITE, MAP_SHARED, + window->shmid, 0); + + if (mem == MAP_FAILED) + { + DEBUG_X11( + "xf_CreateDesktopWindow: failed to assign pointer to the memory address - " + "shmat()\n"); + } + else + { + window->xfwin = mem; + *window->xfwin = window->handle; + } } } diff --git a/libfreerdp/core/nla.c b/libfreerdp/core/nla.c index 922cd14de..b397ed7a2 100644 --- a/libfreerdp/core/nla.c +++ b/libfreerdp/core/nla.c @@ -1144,7 +1144,6 @@ static int nla_server_authenticate(rdpNla* nla) while (TRUE) { - int rc = -1; SecBuffer inputBuffer = { 0 }; SecBuffer outputBuffer = { 0 }; SecBufferDesc inputBufferDesc = { 0 }; @@ -1219,6 +1218,8 @@ static int nla_server_authenticate(rdpNla* nla) if (nla->status == SEC_E_OK) { + int rc = -1; + if (outputBuffer.cbBuffer != 0) { if (!nla_send(nla)) @@ -2219,7 +2220,7 @@ int nla_recv_pdu(rdpNla* nla, wStream* s) int nla_server_recv(rdpNla* nla) { - int status; + int status = -1; wStream* s = nla_server_recv_stream(nla); if (!s) goto fail; diff --git a/server/proxy/pf_context.c b/server/proxy/pf_context.c index c5598d7cd..24d38deba 100644 --- a/server/proxy/pf_context.c +++ b/server/proxy/pf_context.c @@ -88,13 +88,10 @@ error: static void client_to_proxy_context_free(freerdp_peer* client, rdpContext* ctx) { pServerContext* context = (pServerContext*)ctx; - proxyServer* server; if (!client || !context) return; - server = (proxyServer*)client->ContextExtra; - WTSCloseServer((HANDLE)context->vcm); if (context->dynvcReady)