From 1b8221e5bf3eb5daaa20023dabc69bb1951db6cd Mon Sep 17 00:00:00 2001 From: akallabeth Date: Tue, 7 May 2024 23:41:00 +0200 Subject: [PATCH] [warnings] fix various minor warnings --- channels/audin/client/oss/audin_oss.c | 19 +++++++++---------- winpr/libwinpr/sspi/Kerberos/kerberos.c | 4 ++-- winpr/libwinpr/utils/image.c | 16 ++++++---------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/channels/audin/client/oss/audin_oss.c b/channels/audin/client/oss/audin_oss.c index c42c0894c..d7baaed45 100644 --- a/channels/audin/client/oss/audin_oss.c +++ b/channels/audin/client/oss/audin_oss.c @@ -63,16 +63,15 @@ typedef struct rdpContext* rdpcontext; } AudinOSSDevice; -#define OSS_LOG_ERR(_text, _error) \ - do \ - { \ - if ((_error) != 0) \ - { \ - char buffer[256] = { 0 }; \ - WLog_ERR(TAG, "%s: %i - %s\n", (_text), (_error), \ - winpr_strerror((_error), buffer, sizeof(buffer))); \ - } \ - } while (0) +static void OSS_LOG_ERR(const char* _text, int _error) +{ + if ((_error) != 0) + { + char buffer[256] = { 0 }; + WLog_ERR(TAG, "%s: %i - %s\n", (_text), (_error), + winpr_strerror((_error), buffer, sizeof(buffer))); + } +} static UINT32 audin_oss_get_format(const AUDIO_FORMAT* format) { diff --git a/winpr/libwinpr/sspi/Kerberos/kerberos.c b/winpr/libwinpr/sspi/Kerberos/kerberos.c index 614d94807..962e9ebb3 100644 --- a/winpr/libwinpr/sspi/Kerberos/kerberos.c +++ b/winpr/libwinpr/sspi/Kerberos/kerberos.c @@ -197,8 +197,6 @@ static INLINE krb5glue_key get_key(struct krb5glue_keyset* keyset) : keyset->session_key; } -#endif /* WITH_KRB5 */ - static BOOL isValidIPv4(const char* ipAddress) { struct sockaddr_in sa = { 0 }; @@ -218,6 +216,8 @@ static BOOL isValidIP(const char* ipAddress) return isValidIPv4(ipAddress) || isValidIPv6(ipAddress); } +#endif /* WITH_KRB5 */ + static SECURITY_STATUS SEC_ENTRY kerberos_AcquireCredentialsHandleA( SEC_CHAR* pszPrincipal, SEC_CHAR* pszPackage, ULONG fCredentialUse, void* pvLogonID, void* pAuthData, SEC_GET_KEY_FN pGetKeyFn, void* pvGetKeyArgument, PCredHandle phCredential, diff --git a/winpr/libwinpr/utils/image.c b/winpr/libwinpr/utils/image.c index c60982571..8ff45bc84 100644 --- a/winpr/libwinpr/utils/image.c +++ b/winpr/libwinpr/utils/image.c @@ -579,8 +579,8 @@ void winpr_image_free(wImage* image, BOOL bFreeBuffer) free(image); } -void* winpr_convert_to_jpeg(const void* data, size_t size, UINT32 width, UINT32 height, - UINT32 stride, UINT32 bpp, UINT32* pSize) +static void* winpr_convert_to_jpeg(const void* data, size_t size, UINT32 width, UINT32 height, + UINT32 stride, UINT32 bpp, UINT32* pSize) { WINPR_ASSERT(data || (size == 0)); WINPR_ASSERT(pSize); @@ -695,8 +695,8 @@ fail: #endif } -void* winpr_convert_to_webp(const void* data, size_t size, UINT32 width, UINT32 height, - UINT32 stride, UINT32 bpp, UINT32* pSize) +static void* winpr_convert_to_webp(const void* data, size_t size, UINT32 width, UINT32 height, + UINT32 stride, UINT32 bpp, UINT32* pSize) { WINPR_ASSERT(data || (size == 0)); WINPR_ASSERT(pSize); @@ -968,8 +968,8 @@ fail: } #endif -void* winpr_convert_to_png(const void* data, size_t size, UINT32 width, UINT32 height, - UINT32 stride, UINT32 bpp, UINT32* pSize) +static void* winpr_convert_to_png(const void* data, size_t size, UINT32 width, UINT32 height, + UINT32 stride, UINT32 bpp, UINT32* pSize) { WINPR_ASSERT(data || (size == 0)); WINPR_ASSERT(pSize); @@ -1224,7 +1224,6 @@ void* winpr_image_write_buffer(wImage* image, UINT32 format, size_t* psize) *psize = outsize; return data; } - break; case WINPR_IMAGE_WEBP: { UINT32 outsize = 0; @@ -1234,7 +1233,6 @@ void* winpr_image_write_buffer(wImage* image, UINT32 format, size_t* psize) *psize = outsize; return data; } - break; case WINPR_IMAGE_JPEG: { UINT32 outsize = 0; @@ -1244,7 +1242,6 @@ void* winpr_image_write_buffer(wImage* image, UINT32 format, size_t* psize) *psize = outsize; return data; } - break; case WINPR_IMAGE_PNG: { UINT32 outsize = 0; @@ -1254,7 +1251,6 @@ void* winpr_image_write_buffer(wImage* image, UINT32 format, size_t* psize) *psize = outsize; return data; } - break; default: *psize = 0; return NULL;