From 2b19576fc7685695822269a08d6bb1525b6490b9 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Tue, 18 May 2021 12:16:21 +0200 Subject: [PATCH] Fixed compiler warnings, function arguments and const parameter --- client/common/file.c | 2 +- client/common/test/TestClientRdpFile.c | 2 +- include/freerdp/settings.h | 2 +- libfreerdp/codec/progressive.c | 2 +- libfreerdp/common/settings.c | 4 ++-- libfreerdp/crypto/certificate.c | 2 +- libfreerdp/crypto/tls.c | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/common/file.c b/client/common/file.c index 7d394e924..bcc996a4a 100644 --- a/client/common/file.c +++ b/client/common/file.c @@ -2034,7 +2034,7 @@ BOOL freerdp_client_populate_settings_from_rdp_file(rdpFile* file, rdpSettings* free(args); return FALSE; } - list = freerdp_settings_get_pointer(settings, FreeRDP_MonitorIds); + list = freerdp_settings_get_pointer_writable(settings, FreeRDP_MonitorIds); if (!list && (count > 0)) { free(args); diff --git a/client/common/test/TestClientRdpFile.c b/client/common/test/TestClientRdpFile.c index 271c86bd2..1bd4b103a 100644 --- a/client/common/test/TestClientRdpFile.c +++ b/client/common/test/TestClientRdpFile.c @@ -401,7 +401,7 @@ int TestClientRdpFile(int argc, char* argv[]) printf("desktopscalefactor uses invalid default value %d", iValue); goto fail; } - if (freerdp_settings_get_uint32(settings, FreeRDP_DesktopScaleFactor) != iValue) + if ((INT64)freerdp_settings_get_uint32(settings, FreeRDP_DesktopScaleFactor) != iValue) { printf("FreeRDP_DesktopScaleFactor has invalid value"); goto fail; diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index 9a746562a..a6c0c1a78 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -1650,7 +1650,7 @@ extern "C" ADDIN_ARGV* channel); FREERDP_API BOOL freerdp_dynamic_channel_collection_del(rdpSettings* settings, const char* name); - FREERDP_API ADDIN_ARGV* freerdp_dynamic_channel_collection_find(rdpSettings* settings, + FREERDP_API ADDIN_ARGV* freerdp_dynamic_channel_collection_find(const rdpSettings* settings, const char* name); FREERDP_API WINPR_DEPRECATED(ADDIN_ARGV* freerdp_dynamic_channel_clone(ADDIN_ARGV* channel)); diff --git a/libfreerdp/codec/progressive.c b/libfreerdp/codec/progressive.c index 5190c7c1e..cd0fa3b87 100644 --- a/libfreerdp/codec/progressive.c +++ b/libfreerdp/codec/progressive.c @@ -2158,7 +2158,7 @@ INT32 progressive_decompress(PROGRESSIVE_CONTEXT* progressive, const BYTE* pSrcD UINT32 frameId) { INT32 rc = 1; - UINT32 i, j; + UINT32 i; UINT16 blockType; UINT32 blockLen; UINT32 count = 0; diff --git a/libfreerdp/common/settings.c b/libfreerdp/common/settings.c index a1c00e80b..0c0bc4a88 100644 --- a/libfreerdp/common/settings.c +++ b/libfreerdp/common/settings.c @@ -621,7 +621,7 @@ BOOL freerdp_dynamic_channel_collection_add(rdpSettings* settings, ADDIN_ARGV* c return freerdp_settings_set_uint32(settings, FreeRDP_DynamicChannelCount, count); } -ADDIN_ARGV* freerdp_dynamic_channel_collection_find(rdpSettings* settings, const char* name) +ADDIN_ARGV* freerdp_dynamic_channel_collection_find(const rdpSettings* settings, const char* name) { UINT32 index; ADDIN_ARGV* channel; @@ -1055,7 +1055,7 @@ BOOL freerdp_settings_set_pointer_len(rdpSettings* settings, size_t id, const vo { case FreeRDP_RdpServerCertificate: certificate_free(settings->RdpServerCertificate); - settings->RdpServerCertificate = data; + settings->RdpServerCertificate = (rdpCertificate*)data; return TRUE; case FreeRDP_RdpServerRsaKey: key_free(settings->RdpServerRsaKey); diff --git a/libfreerdp/crypto/certificate.c b/libfreerdp/crypto/certificate.c index 08a79bfcd..5992ce9f4 100644 --- a/libfreerdp/crypto/certificate.c +++ b/libfreerdp/crypto/certificate.c @@ -1069,7 +1069,7 @@ rdpCertificateStore* certificate_store_new(const rdpSettings* settings) if (!certificate_store_init(certificate_store)) { - certificate_data_free(certificate_store); + certificate_store_free(certificate_store); return NULL; } diff --git a/libfreerdp/crypto/tls.c b/libfreerdp/crypto/tls.c index dae38c87b..e07625179 100644 --- a/libfreerdp/crypto/tls.c +++ b/libfreerdp/crypto/tls.c @@ -1373,7 +1373,7 @@ int tls_verify_certificate(rdpTls* tls, CryptoCert cert, const char* hostname, U size_t length = 0; char* issuer = crypto_cert_issuer(cert->px509); char* subject = crypto_cert_subject(cert->px509); - char* pem = crypto_cert_pem(cert->px509, NULL, &length); + char* pem = (char*)crypto_cert_pem(cert->px509, NULL, &length); if (!pem) goto end;