[warnigs] fixed readability-non-const-parameter

This commit is contained in:
akallabeth
2024-09-30 20:56:04 +02:00
parent 8d64d75aa2
commit 5f9ef68b07
4 changed files with 9 additions and 7 deletions

View File

@@ -1109,7 +1109,7 @@ extern "C"
WINPR_API void Stream_AddRef(wStream* s);
WINPR_API void Stream_Release(wStream* s);
WINPR_API wStream* StreamPool_Find(wStreamPool* pool, BYTE* ptr);
WINPR_API wStream* StreamPool_Find(wStreamPool* pool, const BYTE* ptr);
WINPR_API void StreamPool_Clear(wStreamPool* pool);

View File

@@ -301,27 +301,26 @@ void Stream_Release(wStream* s)
* Find stream in pool using pointer inside buffer
*/
wStream* StreamPool_Find(wStreamPool* pool, BYTE* ptr)
wStream* StreamPool_Find(wStreamPool* pool, const BYTE* ptr)
{
wStream* s = NULL;
BOOL found = FALSE;
StreamPool_Lock(pool);
for (size_t index = 0; index < pool->uSize; index++)
{
s = pool->uArray[index];
wStream* cur = pool->uArray[index];
if ((ptr >= Stream_Buffer(s)) && (ptr < (Stream_Buffer(s) + Stream_Capacity(s))))
if ((ptr >= Stream_Buffer(cur)) && (ptr < (Stream_Buffer(cur) + Stream_Capacity(cur))))
{
found = TRUE;
s = cur;
break;
}
}
StreamPool_Unlock(pool);
return (found) ? s : NULL;
return s;
}
/**

View File

@@ -658,8 +658,10 @@ fail:
#endif
}
// NOLINTBEGIN(readability-non-const-parameter)
SSIZE_T winpr_convert_from_jpeg(const BYTE* comp_data, size_t comp_data_bytes, UINT32* width,
UINT32* height, UINT32* bpp, BYTE** ppdecomp_data)
// NOLINTEND(readability-non-const-parameter)
{
WINPR_ASSERT(comp_data || (comp_data_bytes == 0));
WINPR_ASSERT(width);

View File

@@ -1042,6 +1042,7 @@ int _connect(SOCKET s, const struct sockaddr* name, int namelen)
return status;
}
// NOLINTNEXTLINE(readability-non-const-parameter)
int _ioctlsocket(SOCKET s, long cmd, u_long* argp)
{
int fd = (int)s;