diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2026-04-03 01:40:39 +0200 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2026-04-03 01:40:39 +0200 |
| commit | e4eb716d2688f5c2d4615d79ad5f4f1eb50a9343 (patch) | |
| tree | 5612056173478fecaad0a030195b6ed2f399df4d /ot_mutex.c | |
| parent | b20b0b89264e9d28ab873b8b1cc9ba73cdb58aeb (diff) | |
turn all int offsets into size_t
Diffstat (limited to 'ot_mutex.c')
| -rw-r--r-- | ot_mutex.c | 12 |
1 files changed, 6 insertions, 6 deletions
| @@ -56,7 +56,7 @@ struct ot_task { | |||
| 56 | ot_taskid taskid; | 56 | ot_taskid taskid; |
| 57 | ot_tasktype tasktype; | 57 | ot_tasktype tasktype; |
| 58 | int64 sock; | 58 | int64 sock; |
| 59 | int iovec_entries; | 59 | size_t iovec_entries; |
| 60 | struct iovec *iovec; | 60 | struct iovec *iovec; |
| 61 | struct ot_task *next; | 61 | struct ot_task *next; |
| 62 | }; | 62 | }; |
| @@ -105,7 +105,7 @@ void mutex_workqueue_canceltask(int64 sock) { | |||
| 105 | if ((*task)->sock == sock) { | 105 | if ((*task)->sock == sock) { |
| 106 | struct iovec *iovec = (*task)->iovec; | 106 | struct iovec *iovec = (*task)->iovec; |
| 107 | struct ot_task *ptask = *task; | 107 | struct ot_task *ptask = *task; |
| 108 | int i; | 108 | size_t i; |
| 109 | 109 | ||
| 110 | /* Free task's iovec */ | 110 | /* Free task's iovec */ |
| 111 | for (i = 0; i < (*task)->iovec_entries; ++i) | 111 | for (i = 0; i < (*task)->iovec_entries; ++i) |
| @@ -167,7 +167,7 @@ void mutex_workqueue_pushsuccess(ot_taskid taskid) { | |||
| 167 | pthread_mutex_unlock(&tasklist_mutex); | 167 | pthread_mutex_unlock(&tasklist_mutex); |
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | int mutex_workqueue_pushresult(ot_taskid taskid, int iovec_entries, struct iovec *iovec) { | 170 | int mutex_workqueue_pushresult(ot_taskid taskid, size_t iovec_entries, struct iovec *iovec) { |
| 171 | struct ot_task *task; | 171 | struct ot_task *task; |
| 172 | const char byte = 'o'; | 172 | const char byte = 'o'; |
| 173 | 173 | ||
| @@ -219,7 +219,7 @@ int mutex_workqueue_pushchunked(ot_taskid taskid, struct iovec *iovec) { | |||
| 219 | return task ? 0 : -1; | 219 | return task ? 0 : -1; |
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | int64 mutex_workqueue_popresult(int *iovec_entries, struct iovec **iovec, int *is_partial) { | 222 | int64 mutex_workqueue_popresult(size_t *iovec_entries, struct iovec **iovec, int *is_partial) { |
| 223 | struct ot_task **task; | 223 | struct ot_task **task; |
| 224 | int64 sock = -1; | 224 | int64 sock = -1; |
| 225 | 225 | ||
| @@ -254,7 +254,7 @@ int64 mutex_workqueue_popresult(int *iovec_entries, struct iovec **iovec, int *i | |||
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | void mutex_init() { | 256 | void mutex_init() { |
| 257 | int i; | 257 | size_t i; |
| 258 | pthread_mutex_init(&tasklist_mutex, NULL); | 258 | pthread_mutex_init(&tasklist_mutex, NULL); |
| 259 | pthread_cond_init(&tasklist_being_filled, NULL); | 259 | pthread_cond_init(&tasklist_being_filled, NULL); |
| 260 | for (i = 0; i < OT_BUCKET_COUNT; ++i) | 260 | for (i = 0; i < OT_BUCKET_COUNT; ++i) |
| @@ -263,7 +263,7 @@ void mutex_init() { | |||
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | void mutex_deinit() { | 265 | void mutex_deinit() { |
| 266 | int i; | 266 | size_t i; |
| 267 | for (i = 0; i < OT_BUCKET_COUNT; ++i) | 267 | for (i = 0; i < OT_BUCKET_COUNT; ++i) |
| 268 | pthread_mutex_destroy(bucket_mutex + i); | 268 | pthread_mutex_destroy(bucket_mutex + i); |
| 269 | pthread_mutex_destroy(&tasklist_mutex); | 269 | pthread_mutex_destroy(&tasklist_mutex); |
