mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2025-06-03 00:00:20 +00:00
[warnings] fix coverity warnings
This commit is contained in:
parent
3e6707c443
commit
8fb49b0abe
@ -426,6 +426,9 @@ UINT cliprdr_read_format_list(wStream* s, CLIPRDR_FORMAT_LIST* formatList, BOOL
|
||||
|
||||
while (Stream_GetRemainingLength(sub1) >= 4)
|
||||
{
|
||||
if (index >= formatList->numFormats)
|
||||
goto error_out;
|
||||
|
||||
CLIPRDR_FORMAT* format = &formats[index];
|
||||
|
||||
Stream_Read_UINT32(sub1, format->formatId); /* formatId (4 bytes) */
|
||||
|
@ -2114,7 +2114,7 @@ exit:
|
||||
|
||||
if (groupDsc)
|
||||
{
|
||||
groupDsc->cItems = clipboard->nFiles;
|
||||
groupDsc->cItems = WINPR_ASSERTING_INT_CAST(UINT, clipboard->nFiles);
|
||||
|
||||
for (size_t i = 0; i < clipboard->nFiles; i++)
|
||||
{
|
||||
|
@ -2895,10 +2895,10 @@ static bool sUuidEqual(const UUID* Uuid1, const UUID* Uuid2)
|
||||
if (!Uuid1 && !Uuid2)
|
||||
return false;
|
||||
|
||||
if (!Uuid2 && Uuid1)
|
||||
if (Uuid1 && !Uuid2)
|
||||
return false;
|
||||
|
||||
if (!Uuid1 && !Uuid2)
|
||||
if (!Uuid1 && Uuid2)
|
||||
return true;
|
||||
|
||||
if (Uuid1->Data1 != Uuid2->Data1)
|
||||
|
@ -139,7 +139,6 @@
|
||||
int shifts = 0; \
|
||||
const _type_* sptr = pSrc; \
|
||||
_type_* dptr = pDst; \
|
||||
size_t count; \
|
||||
__m128i xmm0; \
|
||||
if (sizeof(_type_) == 1) \
|
||||
shifts = 1; \
|
||||
@ -150,10 +149,10 @@
|
||||
else if (sizeof(_type_) == 8) \
|
||||
shifts = 4; \
|
||||
/* Use 4 128-bit SSE registers. */ \
|
||||
count = len >> (7 - shifts); \
|
||||
size_t count = len >> (7 - shifts); \
|
||||
len -= count << (7 - shifts); \
|
||||
xmm0 = mm_set1_epu32(val); \
|
||||
while (count--) \
|
||||
for (size_t x = 0; x < count; x++) \
|
||||
{ \
|
||||
__m128i xmm1 = LOAD_SI128(sptr); \
|
||||
sptr += (16 / sizeof(_type_)); \
|
||||
@ -179,7 +178,7 @@
|
||||
/* Use a single 128-bit SSE register. */ \
|
||||
count = len >> (5 - shifts); \
|
||||
len -= count << (5 - shifts); \
|
||||
while (count--) \
|
||||
for (size_t x = 0; x < count; x++) \
|
||||
{ \
|
||||
__m128i xmm1 = LOAD_SI128(sptr); \
|
||||
sptr += (16 / sizeof(_type_)); \
|
||||
@ -188,7 +187,7 @@
|
||||
dptr += (16 / sizeof(_type_)); \
|
||||
} \
|
||||
/* Finish off the remainder. */ \
|
||||
while (len--) \
|
||||
for (size_t x = 0; x < len; x++) \
|
||||
{ \
|
||||
_slowWay_; \
|
||||
} \
|
||||
|
@ -379,7 +379,7 @@ BOOL BufferPool_Return(wBufferPool* pool, void* buffer)
|
||||
|
||||
if ((pool->size + 1) >= pool->capacity)
|
||||
{
|
||||
SSIZE_T newCapacity = MAX(1, pool->size + (pool->size + 2) / 2 + 1);
|
||||
SSIZE_T newCapacity = MAX(2, pool->size + (pool->size + 2) / 2 + 1);
|
||||
void** newArray = (void**)realloc(
|
||||
(void*)pool->array, sizeof(void*) * WINPR_ASSERTING_INT_CAST(size_t, newCapacity));
|
||||
if (!newArray)
|
||||
@ -416,7 +416,7 @@ BOOL BufferPool_Return(wBufferPool* pool, void* buffer)
|
||||
{
|
||||
if ((pool->aSize + 1) >= pool->aCapacity)
|
||||
{
|
||||
SSIZE_T newCapacity = MAX(1, pool->aSize + (pool->aSize + 2) / 2 + 1);
|
||||
SSIZE_T newCapacity = MAX(2, pool->aSize + (pool->aSize + 2) / 2 + 1);
|
||||
wBufferPoolItem* newArray = (wBufferPoolItem*)realloc(
|
||||
pool->aArray,
|
||||
sizeof(wBufferPoolItem) * WINPR_ASSERTING_INT_CAST(size_t, newCapacity));
|
||||
|
Loading…
Reference in New Issue
Block a user