[warnings] fix integer narrowing

This commit is contained in:
akallabeth 2024-10-03 13:15:25 +02:00
parent b19dcf8d68
commit 57ed259be2
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5

View File

@ -187,7 +187,8 @@ static void StreamPool_ShiftAvailable(wStreamPool* pool, size_t index, INT64 cou
wStream* StreamPool_Take(wStreamPool* pool, size_t size)
{
SSIZE_T foundIndex = -1;
BOOL found = FALSE;
size_t foundIndex = 0;
wStream* s = NULL;
StreamPool_Lock(pool);
@ -201,12 +202,13 @@ wStream* StreamPool_Take(wStreamPool* pool, size_t size)
if (Stream_Capacity(s) >= size)
{
found = TRUE;
foundIndex = index;
break;
}
}
if (foundIndex < 0)
if (!found)
{
s = Stream_New(NULL, size);
if (!s)