Merge pull request #10560 from akallabeth/warn-fix

Warn fix
This commit is contained in:
akallabeth 2024-09-05 08:39:53 +02:00 committed by GitHub
commit 8fd724b7b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 15 additions and 16 deletions

View File

@ -25,6 +25,7 @@ Checks: >
-bugprone-assignment-in-if-condition, -bugprone-assignment-in-if-condition,
-cert-dcl16-c, -cert-dcl16-c,
-cert-env33-c, -cert-env33-c,
-cert-dcl50-cpp,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling, -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
-clang-analyzer-valist.Uninitialized, -clang-analyzer-valist.Uninitialized,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay, -cppcoreguidelines-pro-bounds-array-to-pointer-decay,

View File

@ -19,7 +19,7 @@
#include "webview.h" #include "webview.h"
#include <assert.h> #include <cassert>
#include <string> #include <string>
#include <vector> #include <vector>
#include <map> #include <map>

View File

@ -484,11 +484,9 @@ static pstatus_t opencl_YUV444ToRGB_8u_P3AC4R(const BYTE* const WINPR_RESTRICT p
return opencl_YUVToRGB(kernel_name, pSrc, srcStep, pDst, dstStep, roi); return opencl_YUVToRGB(kernel_name, pSrc, srcStep, pDst, dstStep, roi);
} }
#endif
BOOL primitives_init_opencl(primitives_t* prims) BOOL primitives_init_opencl(primitives_t* prims)
{ {
#if defined(WITH_OPENCL)
primitives_t* p = primitives_get_by_type(PRIMITIVES_ONLY_CPU); primitives_t* p = primitives_get_by_type(PRIMITIVES_ONLY_CPU);
if (!prims || !p) if (!prims || !p)
return FALSE; return FALSE;
@ -501,6 +499,6 @@ BOOL primitives_init_opencl(primitives_t* prims)
prims->YUV444ToRGB_8u_P3AC4R = opencl_YUV444ToRGB_8u_P3AC4R; prims->YUV444ToRGB_8u_P3AC4R = opencl_YUV444ToRGB_8u_P3AC4R;
prims->flags |= PRIM_FLAGS_HAVE_EXTGPU; prims->flags |= PRIM_FLAGS_HAVE_EXTGPU;
prims->uninit = primitives_uninit_opencl; prims->uninit = primitives_uninit_opencl;
#endif
return TRUE; return TRUE;
} }
#endif

View File

@ -127,8 +127,8 @@ static void replace_char(char* buffer, size_t buffer_len, const char* toreplace)
} }
} }
char* freerdp_passphrase_read_tty(rdpContext* context, const char* prompt, char* buf, size_t bufsiz, static char* freerdp_passphrase_read_tty(rdpContext* context, const char* prompt, char* buf,
int from_stdin) size_t bufsiz, int from_stdin)
{ {
BOOL terminal_needs_reset = FALSE; BOOL terminal_needs_reset = FALSE;
char term_name[L_ctermid] = { 0 }; char term_name[L_ctermid] = { 0 };
@ -213,8 +213,8 @@ error:
} }
} }
char* freerdp_passphrase_read_askpass(const char* prompt, char* buf, size_t bufsiz, static char* freerdp_passphrase_read_askpass(const char* prompt, char* buf, size_t bufsiz,
char const* askpass_env) char const* askpass_env)
{ {
char command[4096] = { 0 }; char command[4096] = { 0 };

View File

@ -62,12 +62,12 @@ class DynChannelState
{ {
public: public:
bool skip() const [[nodiscard]] bool skip() const
{ {
return _toSkip != 0; return _toSkip != 0;
} }
bool skip(size_t s) [[nodiscard]] bool skip(size_t s)
{ {
if (s > _toSkip) if (s > _toSkip)
_toSkip = 0; _toSkip = 0;
@ -76,12 +76,12 @@ class DynChannelState
return skip(); return skip();
} }
size_t remaining() const [[nodiscard]] size_t remaining() const
{ {
return _toSkip; return _toSkip;
} }
size_t total() const [[nodiscard]] size_t total() const
{ {
return _totalSkipSize; return _totalSkipSize;
} }
@ -91,7 +91,7 @@ class DynChannelState
_toSkip = _totalSkipSize = len; _toSkip = _totalSkipSize = len;
} }
bool drop() const [[nodiscard]] bool drop() const
{ {
return _drop; return _drop;
} }
@ -101,7 +101,7 @@ class DynChannelState
_drop = d; _drop = d;
} }
uint32_t channelId() const [[nodiscard]] uint32_t channelId() const
{ {
return _channelId; return _channelId;
} }

View File

@ -678,8 +678,8 @@ static int x11_shadow_blend_cursor(x11ShadowSubsystem* subsystem)
for (size_t y = 0; y < nHeight; y++) for (size_t y = 0; y < nHeight; y++)
{ {
const BYTE* pSrcPixel = &pSrcData[((nYSrc + y) * nSrcStep) + (nXSrc * 4)]; const BYTE* pSrcPixel = &pSrcData[((nYSrc + y) * nSrcStep) + (4ULL * nXSrc)];
BYTE* pDstPixel = &pDstData[((nYDst + y) * nDstStep) + (nXDst * 4)]; BYTE* pDstPixel = &pDstData[((nYDst + y) * nDstStep) + (4ULL * nXDst)];
for (size_t x = 0; x < nWidth; x++) for (size_t x = 0; x < nWidth; x++)
{ {