[warnings] use ARRAYSIZE macro
This commit is contained in:
parent
baa70d1ab6
commit
f3d84d4557
@ -334,7 +334,6 @@ static int xcrush_find_next_matching_chunk(XCRUSH_CONTEXT* WINPR_RESTRICT xcrush
|
|||||||
XCRUSH_CHUNK* WINPR_RESTRICT chunk,
|
XCRUSH_CHUNK* WINPR_RESTRICT chunk,
|
||||||
XCRUSH_CHUNK** WINPR_RESTRICT pNextChunk)
|
XCRUSH_CHUNK** WINPR_RESTRICT pNextChunk)
|
||||||
{
|
{
|
||||||
UINT32 index = 0;
|
|
||||||
XCRUSH_CHUNK* next = NULL;
|
XCRUSH_CHUNK* next = NULL;
|
||||||
|
|
||||||
WINPR_ASSERT(xcrush);
|
WINPR_ASSERT(xcrush);
|
||||||
@ -344,7 +343,7 @@ static int xcrush_find_next_matching_chunk(XCRUSH_CONTEXT* WINPR_RESTRICT xcrush
|
|||||||
|
|
||||||
if (chunk->next)
|
if (chunk->next)
|
||||||
{
|
{
|
||||||
index = (chunk - xcrush->Chunks) / sizeof(XCRUSH_CHUNK);
|
UINT32 index = (chunk - xcrush->Chunks) / sizeof(XCRUSH_CHUNK);
|
||||||
|
|
||||||
if (index >= 65534)
|
if (index >= 65534)
|
||||||
return -4002; /* error */
|
return -4002; /* error */
|
||||||
|
@ -1925,7 +1925,7 @@ static BOOL rdg_process_control_packet(rdpRdg* rdg, int type, size_t packetLengt
|
|||||||
|
|
||||||
static int rdg_read_data_packet(rdpRdg* rdg, BYTE* buffer, int size)
|
static int rdg_read_data_packet(rdpRdg* rdg, BYTE* buffer, int size)
|
||||||
{
|
{
|
||||||
RdgPacketHeader header;
|
RdgPacketHeader header = { 0 };
|
||||||
size_t readCount = 0;
|
size_t readCount = 0;
|
||||||
size_t readSize = 0;
|
size_t readSize = 0;
|
||||||
int status = 0;
|
int status = 0;
|
||||||
|
@ -987,7 +987,7 @@ void sspi_GlobalFinish(void)
|
|||||||
|
|
||||||
static const SecurityFunctionTableA* sspi_GetSecurityFunctionTableAByNameA(const SEC_CHAR* Name)
|
static const SecurityFunctionTableA* sspi_GetSecurityFunctionTableAByNameA(const SEC_CHAR* Name)
|
||||||
{
|
{
|
||||||
size_t cPackages = sizeof(SecPkgInfoA_LIST) / sizeof(*(SecPkgInfoA_LIST));
|
size_t cPackages = ARRAYSIZE(SecPkgInfoA_LIST);
|
||||||
|
|
||||||
for (size_t index = 0; index < cPackages; index++)
|
for (size_t index = 0; index < cPackages; index++)
|
||||||
{
|
{
|
||||||
@ -1002,7 +1002,7 @@ static const SecurityFunctionTableA* sspi_GetSecurityFunctionTableAByNameA(const
|
|||||||
|
|
||||||
static const SecurityFunctionTableW* sspi_GetSecurityFunctionTableWByNameW(const SEC_WCHAR* Name)
|
static const SecurityFunctionTableW* sspi_GetSecurityFunctionTableWByNameW(const SEC_WCHAR* Name)
|
||||||
{
|
{
|
||||||
size_t cPackages = sizeof(SecPkgInfoW_LIST) / sizeof(*(SecPkgInfoW_LIST));
|
size_t cPackages = ARRAYSIZE(SecPkgInfoW_LIST);
|
||||||
|
|
||||||
for (size_t index = 0; index < cPackages; index++)
|
for (size_t index = 0; index < cPackages; index++)
|
||||||
{
|
{
|
||||||
@ -1073,12 +1073,10 @@ static void sspi_ContextBufferFree(void* contextBuffer)
|
|||||||
static SECURITY_STATUS SEC_ENTRY winpr_EnumerateSecurityPackagesW(ULONG* pcPackages,
|
static SECURITY_STATUS SEC_ENTRY winpr_EnumerateSecurityPackagesW(ULONG* pcPackages,
|
||||||
PSecPkgInfoW* ppPackageInfo)
|
PSecPkgInfoW* ppPackageInfo)
|
||||||
{
|
{
|
||||||
size_t size = 0;
|
size_t cPackages = ARRAYSIZE(SecPkgInfoW_LIST);
|
||||||
UINT32 cPackages = 0;
|
size_t size = sizeof(SecPkgInfoW) * cPackages;
|
||||||
SecPkgInfoW* pPackageInfo = NULL;
|
SecPkgInfoW* pPackageInfo =
|
||||||
cPackages = sizeof(SecPkgInfoW_LIST) / sizeof(*(SecPkgInfoW_LIST));
|
(SecPkgInfoW*)sspi_ContextBufferAlloc(EnumerateSecurityPackagesIndex, size);
|
||||||
size = sizeof(SecPkgInfoW) * cPackages;
|
|
||||||
pPackageInfo = (SecPkgInfoW*)sspi_ContextBufferAlloc(EnumerateSecurityPackagesIndex, size);
|
|
||||||
|
|
||||||
if (!pPackageInfo)
|
if (!pPackageInfo)
|
||||||
return SEC_E_INSUFFICIENT_MEMORY;
|
return SEC_E_INSUFFICIENT_MEMORY;
|
||||||
@ -1101,12 +1099,10 @@ static SECURITY_STATUS SEC_ENTRY winpr_EnumerateSecurityPackagesW(ULONG* pcPacka
|
|||||||
static SECURITY_STATUS SEC_ENTRY winpr_EnumerateSecurityPackagesA(ULONG* pcPackages,
|
static SECURITY_STATUS SEC_ENTRY winpr_EnumerateSecurityPackagesA(ULONG* pcPackages,
|
||||||
PSecPkgInfoA* ppPackageInfo)
|
PSecPkgInfoA* ppPackageInfo)
|
||||||
{
|
{
|
||||||
size_t size = 0;
|
size_t cPackages = ARRAYSIZE(SecPkgInfoA_LIST);
|
||||||
UINT32 cPackages = 0;
|
size_t size = sizeof(SecPkgInfoA) * cPackages;
|
||||||
SecPkgInfoA* pPackageInfo = NULL;
|
SecPkgInfoA* pPackageInfo =
|
||||||
cPackages = sizeof(SecPkgInfoA_LIST) / sizeof(*(SecPkgInfoA_LIST));
|
(SecPkgInfoA*)sspi_ContextBufferAlloc(EnumerateSecurityPackagesIndex, size);
|
||||||
size = sizeof(SecPkgInfoA) * cPackages;
|
|
||||||
pPackageInfo = (SecPkgInfoA*)sspi_ContextBufferAlloc(EnumerateSecurityPackagesIndex, size);
|
|
||||||
|
|
||||||
if (!pPackageInfo)
|
if (!pPackageInfo)
|
||||||
return SEC_E_INSUFFICIENT_MEMORY;
|
return SEC_E_INSUFFICIENT_MEMORY;
|
||||||
@ -1134,9 +1130,8 @@ static SECURITY_STATUS SEC_ENTRY winpr_EnumerateSecurityPackagesA(ULONG* pcPacka
|
|||||||
|
|
||||||
static void FreeContextBuffer_EnumerateSecurityPackages(void* contextBuffer)
|
static void FreeContextBuffer_EnumerateSecurityPackages(void* contextBuffer)
|
||||||
{
|
{
|
||||||
UINT32 cPackages = 0;
|
|
||||||
SecPkgInfoA* pPackageInfo = (SecPkgInfoA*)contextBuffer;
|
SecPkgInfoA* pPackageInfo = (SecPkgInfoA*)contextBuffer;
|
||||||
cPackages = sizeof(SecPkgInfoA_LIST) / sizeof(*(SecPkgInfoA_LIST));
|
size_t cPackages = ARRAYSIZE(SecPkgInfoA_LIST);
|
||||||
|
|
||||||
if (!pPackageInfo)
|
if (!pPackageInfo)
|
||||||
return;
|
return;
|
||||||
@ -1163,16 +1158,14 @@ SecurityFunctionTableA* SEC_ENTRY winpr_InitSecurityInterfaceA(void)
|
|||||||
static SECURITY_STATUS SEC_ENTRY winpr_QuerySecurityPackageInfoW(SEC_WCHAR* pszPackageName,
|
static SECURITY_STATUS SEC_ENTRY winpr_QuerySecurityPackageInfoW(SEC_WCHAR* pszPackageName,
|
||||||
PSecPkgInfoW* ppPackageInfo)
|
PSecPkgInfoW* ppPackageInfo)
|
||||||
{
|
{
|
||||||
size_t size = 0;
|
size_t cPackages = ARRAYSIZE(SecPkgInfoW_LIST);
|
||||||
SecPkgInfoW* pPackageInfo = NULL;
|
|
||||||
size_t cPackages = sizeof(SecPkgInfoW_LIST) / sizeof(*(SecPkgInfoW_LIST));
|
|
||||||
|
|
||||||
for (size_t index = 0; index < cPackages; index++)
|
for (size_t index = 0; index < cPackages; index++)
|
||||||
{
|
{
|
||||||
if (_wcscmp(pszPackageName, SecPkgInfoW_LIST[index]->Name) == 0)
|
if (_wcscmp(pszPackageName, SecPkgInfoW_LIST[index]->Name) == 0)
|
||||||
{
|
{
|
||||||
size = sizeof(SecPkgInfoW);
|
size_t size = sizeof(SecPkgInfoW);
|
||||||
pPackageInfo =
|
SecPkgInfoW* pPackageInfo =
|
||||||
(SecPkgInfoW*)sspi_ContextBufferAlloc(QuerySecurityPackageInfoIndex, size);
|
(SecPkgInfoW*)sspi_ContextBufferAlloc(QuerySecurityPackageInfoIndex, size);
|
||||||
|
|
||||||
if (!pPackageInfo)
|
if (!pPackageInfo)
|
||||||
@ -1196,16 +1189,14 @@ static SECURITY_STATUS SEC_ENTRY winpr_QuerySecurityPackageInfoW(SEC_WCHAR* pszP
|
|||||||
static SECURITY_STATUS SEC_ENTRY winpr_QuerySecurityPackageInfoA(SEC_CHAR* pszPackageName,
|
static SECURITY_STATUS SEC_ENTRY winpr_QuerySecurityPackageInfoA(SEC_CHAR* pszPackageName,
|
||||||
PSecPkgInfoA* ppPackageInfo)
|
PSecPkgInfoA* ppPackageInfo)
|
||||||
{
|
{
|
||||||
size_t size = 0;
|
size_t cPackages = ARRAYSIZE(SecPkgInfoA_LIST);
|
||||||
SecPkgInfoA* pPackageInfo = NULL;
|
|
||||||
size_t cPackages = sizeof(SecPkgInfoA_LIST) / sizeof(*(SecPkgInfoA_LIST));
|
|
||||||
|
|
||||||
for (size_t index = 0; index < cPackages; index++)
|
for (size_t index = 0; index < cPackages; index++)
|
||||||
{
|
{
|
||||||
if (strcmp(pszPackageName, SecPkgInfoA_LIST[index]->Name) == 0)
|
if (strcmp(pszPackageName, SecPkgInfoA_LIST[index]->Name) == 0)
|
||||||
{
|
{
|
||||||
size = sizeof(SecPkgInfoA);
|
size_t size = sizeof(SecPkgInfoA);
|
||||||
pPackageInfo =
|
SecPkgInfoA* pPackageInfo =
|
||||||
(SecPkgInfoA*)sspi_ContextBufferAlloc(QuerySecurityPackageInfoIndex, size);
|
(SecPkgInfoA*)sspi_ContextBufferAlloc(QuerySecurityPackageInfoIndex, size);
|
||||||
|
|
||||||
if (!pPackageInfo)
|
if (!pPackageInfo)
|
||||||
|
Loading…
Reference in New Issue
Block a user