From ddced3f3ca7db3ceb474eee550cd3b345071731a Mon Sep 17 00:00:00 2001 From: Bernhard Miklautz Date: Tue, 4 Oct 2016 16:04:20 +0200 Subject: [PATCH] Fix compiler warnings clang version 3.9.1-svn281634-1~exp1 (branches/release_39) freerdp-firerds/libfreerdp/core/channels.c:270:9: warning: returning 'const WtsApiFunctionTable *' (aka 'const struct _WtsApiFunctionTable *') from a function with result type 'PWtsApiFunctionTable' (aka 'struct _WtsApiFunctionTable *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] return &FreeRDP_WtsApiFunctionTable; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ uwac/libuwac/uwac-display.c:502:12: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare] if (error < 0 || error >= UWAC_ERROR_LAST) ~~~~~ ^ ~ --- libfreerdp/core/channels.c | 2 +- uwac/libuwac/uwac-display.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libfreerdp/core/channels.c b/libfreerdp/core/channels.c index 647bc8186..268c55749 100644 --- a/libfreerdp/core/channels.c +++ b/libfreerdp/core/channels.c @@ -267,5 +267,5 @@ static const WtsApiFunctionTable FreeRDP_WtsApiFunctionTable = PWtsApiFunctionTable FreeRDP_InitWtsApi(void) { - return &FreeRDP_WtsApiFunctionTable; + return (PWtsApiFunctionTable)&FreeRDP_WtsApiFunctionTable; } diff --git a/uwac/libuwac/uwac-display.c b/uwac/libuwac/uwac-display.c index 2fa20b490..b44172ac1 100644 --- a/uwac/libuwac/uwac-display.c +++ b/uwac/libuwac/uwac-display.c @@ -499,7 +499,7 @@ static const char *errorStrings[] = { }; const char *UwacErrorString(UwacReturnCode error) { - if (error < 0 || error >= UWAC_ERROR_LAST) + if (error < UWAC_SUCCESS || error >= UWAC_ERROR_LAST) return "invalid error code"; return errorStrings[error];