[warnings] fix sign comparison issues

This commit is contained in:
akallabeth 2024-10-22 10:10:33 +02:00
parent 9e18bd94f9
commit 28037f100c
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5
3 changed files with 4 additions and 4 deletions

View File

@ -62,7 +62,7 @@ static INLINE pstatus_t avx2_image_copy_bgr24_bgrx32(BYTE* WINPR_RESTRICT pDstDa
const SSIZE_T width = nWidth - rem;
const size_t align = nSrcStep % 32;
const BOOL fast = (align == 0) ? TRUE : (align >= 8 - MIN(8, rem) ? TRUE : FALSE);
const BOOL fast = (align == 0) ? TRUE : (align >= 8 - MIN(8, (size_t)rem) ? TRUE : FALSE);
for (SSIZE_T y = 0; y < nHeight; y++)
{
const BYTE* WINPR_RESTRICT srcLine =

View File

@ -57,7 +57,7 @@ static INLINE pstatus_t sse_image_copy_bgr24_bgrx32(BYTE* WINPR_RESTRICT pDstDat
const SSIZE_T rem = nWidth % 4;
const size_t align = nSrcStep % 64;
const BOOL fast = (align == 0) ? TRUE : (align >= 16 - MIN(16, rem) ? TRUE : FALSE);
const BOOL fast = (align == 0) ? TRUE : (align >= 16 - MIN(16, (size_t)rem) ? TRUE : FALSE);
const SSIZE_T width = nWidth - rem;
for (SSIZE_T y = 0; y < nHeight; y++)
{

View File

@ -602,8 +602,8 @@ static void* clipboard_synthesize_text_html(wClipboard* clipboard, UINT32 format
const long end = strtol(&endStr[8], NULL, 10);
if (beg < 0 || end < 0 || (beg > SrcSize) || (end > SrcSize) || (beg >= end) ||
(errno != 0))
if (beg < 0 || end < 0 || ((size_t)beg > SrcSize) || ((size_t)end > SrcSize) ||
(beg >= end) || (errno != 0))
return NULL;
const size_t DstSize = (size_t)(end - beg);