Skip to content

Commit 263e7b4

Browse files
committed
CAPI - use size_t for size_approx
1 parent c144e9f commit 263e7b4

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

c_api/concurrentqueue.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ int moodycamel_cq_try_dequeue(MoodycamelCQHandle handle, MoodycamelValue* value)
3131
return reinterpret_cast<MoodycamelCQPtr>(handle)->try_dequeue(*value) ? 1 : 0;
3232
}
3333

34-
unsigned int moodycamel_cq_size_approx(MoodycamelCQHandle handle)
34+
size_t moodycamel_cq_size_approx(MoodycamelCQHandle handle)
3535
{
36-
return (unsigned int)reinterpret_cast<MoodycamelCQPtr>(handle)->size_approx();
36+
return reinterpret_cast<MoodycamelCQPtr>(handle)->size_approx();
3737
}
3838

3939
}

c_api/concurrentqueue.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#pragma once
22

3+
#include <stddef.h>
4+
35
#ifdef __cplusplus
46
extern "C" {
57
#endif
@@ -26,7 +28,7 @@ MOODYCAMEL_EXPORT int moodycamel_cq_create(MoodycamelCQHandle* handle);
2628
MOODYCAMEL_EXPORT int moodycamel_cq_destroy(MoodycamelCQHandle handle);
2729
MOODYCAMEL_EXPORT int moodycamel_cq_enqueue(MoodycamelCQHandle handle, MoodycamelValue value);
2830
MOODYCAMEL_EXPORT int moodycamel_cq_try_dequeue(MoodycamelCQHandle handle, MoodycamelValue* value);
29-
MOODYCAMEL_EXPORT unsigned int moodycamel_cq_size_approx(MoodycamelCQHandle handle);
31+
MOODYCAMEL_EXPORT size_t moodycamel_cq_size_approx(MoodycamelCQHandle handle);
3032

3133
MOODYCAMEL_EXPORT int moodycamel_bcq_create(MoodycamelBCQHandle* handle);
3234
MOODYCAMEL_EXPORT int moodycamel_bcq_destroy(MoodycamelBCQHandle handle);

0 commit comments

Comments
 (0)