diff options
| author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2026-05-10 17:37:31 +0200 |
|---|---|---|
| committer | Sander Vrijders <sander@ouroboros.rocks> | 2026-05-20 08:17:06 +0200 |
| commit | 46fa893af9ed74e2a473354c1777bd494b3374db (patch) | |
| tree | 0368e7f18dc33e50688321e9969e273579853f0f /src | |
| parent | 3f962298bfcf2fb0c6a30b4f1d9e1423321409cb (diff) | |
| download | ouroboros-46fa893af9ed74e2a473354c1777bd494b3374db.tar.gz ouroboros-46fa893af9ed74e2a473354c1777bd494b3374db.zip | |
lib: Use const for ssm_pk_buff getters
Mark ssm_pk_buff_get_off, _head, _tail, and _len as taking a const
struct ssm_pk_buff *. Cast through the flex array in _head and _tail
since the buffer view they return remains mutable.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/ssm/pool.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/ssm/pool.c b/src/lib/ssm/pool.c index f2c94133..5265fb4d 100644 --- a/src/lib/ssm/pool.c +++ b/src/lib/ssm/pool.c @@ -783,28 +783,28 @@ int ssm_pool_remove(struct ssm_pool * pool, return 0; } -size_t ssm_pk_buff_get_off(struct ssm_pk_buff * spb) +size_t ssm_pk_buff_get_off(const struct ssm_pk_buff * spb) { assert(spb != NULL); return spb->off; } -uint8_t * ssm_pk_buff_head(struct ssm_pk_buff * spb) +uint8_t * ssm_pk_buff_head(const struct ssm_pk_buff * spb) { assert(spb != NULL); - return spb->data + spb->pk_head; + return (uint8_t *) spb->data + spb->pk_head; } -uint8_t * ssm_pk_buff_tail(struct ssm_pk_buff * spb) +uint8_t * ssm_pk_buff_tail(const struct ssm_pk_buff * spb) { assert(spb != NULL); - return spb->data + spb->pk_tail; + return (uint8_t *) spb->data + spb->pk_tail; } -size_t ssm_pk_buff_len(struct ssm_pk_buff * spb) +size_t ssm_pk_buff_len(const struct ssm_pk_buff * spb) { assert(spb != NULL); |
