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,
-cert-dcl16-c,
-cert-env33-c,
-cert-dcl50-cpp,
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,
-clang-analyzer-valist.Uninitialized,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,

View File

@ -19,7 +19,7 @@
#include "webview.h"
#include <assert.h>
#include <cassert>
#include <string>
#include <vector>
#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);
}
#endif
BOOL primitives_init_opencl(primitives_t* prims)
{
#if defined(WITH_OPENCL)
primitives_t* p = primitives_get_by_type(PRIMITIVES_ONLY_CPU);
if (!prims || !p)
return FALSE;
@ -501,6 +499,6 @@ BOOL primitives_init_opencl(primitives_t* prims)
prims->YUV444ToRGB_8u_P3AC4R = opencl_YUV444ToRGB_8u_P3AC4R;
prims->flags |= PRIM_FLAGS_HAVE_EXTGPU;
prims->uninit = primitives_uninit_opencl;
#endif
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,
int from_stdin)
static char* freerdp_passphrase_read_tty(rdpContext* context, const char* prompt, char* buf,
size_t bufsiz, int from_stdin)
{
BOOL terminal_needs_reset = FALSE;
char term_name[L_ctermid] = { 0 };
@ -213,8 +213,8 @@ error:
}
}
char* freerdp_passphrase_read_askpass(const char* prompt, char* buf, size_t bufsiz,
char const* askpass_env)
static char* freerdp_passphrase_read_askpass(const char* prompt, char* buf, size_t bufsiz,
char const* askpass_env)
{
char command[4096] = { 0 };

View File

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

View File

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