From e4eb716d2688f5c2d4615d79ad5f4f1eb50a9343 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Fri, 3 Apr 2026 01:40:39 +0200 Subject: turn all int offsets into size_t --- ot_mutex.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ot_mutex.c') diff --git a/ot_mutex.c b/ot_mutex.c index 3011987..a1dba1f 100644 --- a/ot_mutex.c +++ b/ot_mutex.c @@ -56,7 +56,7 @@ struct ot_task { ot_taskid taskid; ot_tasktype tasktype; int64 sock; - int iovec_entries; + size_t iovec_entries; struct iovec *iovec; struct ot_task *next; }; @@ -105,7 +105,7 @@ void mutex_workqueue_canceltask(int64 sock) { if ((*task)->sock == sock) { struct iovec *iovec = (*task)->iovec; struct ot_task *ptask = *task; - int i; + size_t i; /* Free task's iovec */ for (i = 0; i < (*task)->iovec_entries; ++i) @@ -167,7 +167,7 @@ void mutex_workqueue_pushsuccess(ot_taskid taskid) { pthread_mutex_unlock(&tasklist_mutex); } -int mutex_workqueue_pushresult(ot_taskid taskid, int iovec_entries, struct iovec *iovec) { +int mutex_workqueue_pushresult(ot_taskid taskid, size_t iovec_entries, struct iovec *iovec) { struct ot_task *task; const char byte = 'o'; @@ -219,7 +219,7 @@ int mutex_workqueue_pushchunked(ot_taskid taskid, struct iovec *iovec) { return task ? 0 : -1; } -int64 mutex_workqueue_popresult(int *iovec_entries, struct iovec **iovec, int *is_partial) { +int64 mutex_workqueue_popresult(size_t *iovec_entries, struct iovec **iovec, int *is_partial) { struct ot_task **task; int64 sock = -1; @@ -254,7 +254,7 @@ int64 mutex_workqueue_popresult(int *iovec_entries, struct iovec **iovec, int *i } void mutex_init() { - int i; + size_t i; pthread_mutex_init(&tasklist_mutex, NULL); pthread_cond_init(&tasklist_being_filled, NULL); for (i = 0; i < OT_BUCKET_COUNT; ++i) @@ -263,7 +263,7 @@ void mutex_init() { } void mutex_deinit() { - int i; + size_t i; for (i = 0; i < OT_BUCKET_COUNT; ++i) pthread_mutex_destroy(bucket_mutex + i); pthread_mutex_destroy(&tasklist_mutex); -- cgit v1.2.3