[winpr,collections] ListDictionary_Count
This commit is contained in:
parent
5fffaf6cd2
commit
ac39e8aac2
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ static char* val3 = "val3";
|
||||
|
||||
int TestListDictionary(int argc, char* argv[])
|
||||
{
|
||||
int count;
|
||||
size_t count;
|
||||
char* value;
|
||||
wListDictionary* list;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user