[winpr,collections] ListDictionary_Count

This commit is contained in:
akallabeth 2023-06-27 09:28:35 +02:00 committed by akallabeth
parent 5fffaf6cd2
commit ac39e8aac2
4 changed files with 7 additions and 9 deletions

View File

@ -617,7 +617,7 @@ static void create_irp_thread(SERIAL_DEVICE* serial, IRP* irp)
if (ListDictionary_Count(serial->IrpThreads) >= MAX_IRP_THREADS)
{
WLog_Print(serial->log, WLOG_WARN,
"Number of IRP threads threshold reached: %d, keep on anyway",
"Number of IRP threads threshold reached: %" PRIuz ", keep on anyway",
ListDictionary_Count(serial->IrpThreads));
WINPR_ASSERT(FALSE); /* unimplemented */
/* TODO: MAX_IRP_THREADS has been thought to avoid a

View File

@ -215,7 +215,7 @@ extern "C"
#define ListDictionary_KeyObject(_dictionary) (&_dictionary->objectKey)
#define ListDictionary_ValueObject(_dictionary) (&_dictionary->objectValue)
WINPR_API int ListDictionary_Count(wListDictionary* listDictionary);
WINPR_API size_t ListDictionary_Count(wListDictionary* listDictionary);
WINPR_API void ListDictionary_Lock(wListDictionary* listDictionary);
WINPR_API void ListDictionary_Unlock(wListDictionary* listDictionary);

View File

@ -38,20 +38,18 @@
* Gets the number of key/value pairs contained in the ListDictionary.
*/
int ListDictionary_Count(wListDictionary* listDictionary)
size_t ListDictionary_Count(wListDictionary* listDictionary)
{
int count = 0;
wListDictionaryItem* item;
size_t count = 0;
if (!listDictionary)
return -1;
WINPR_ASSERT(listDictionary);
if (listDictionary->synchronized)
EnterCriticalSection(&listDictionary->lock);
if (listDictionary->head)
{
item = listDictionary->head;
wListDictionaryItem* item = listDictionary->head;
while (item)
{

View File

@ -13,7 +13,7 @@ static char* val3 = "val3";
int TestListDictionary(int argc, char* argv[])
{
int count;
size_t count;
char* value;
wListDictionary* list;