diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2023-03-31 05:39:04 +0700 |
---|---|---|
committer | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2023-03-31 05:39:24 +0700 |
commit | 37dc995234c50cc5f3caf325598e7fddd52cb878 (patch) | |
tree | 9cbef6dcc17c67fc0cf1f515fd993e8877fd0281 | |
parent | 48c60f97714581e53de068b4a1b7c0d70bd41fdf (diff) |
core: remove unnecessary #include <osmocom/core/talloc.h>
Including this header just for TALLOC_CTX is an overkill, we use
'void *' for talloc contexts in nearly all other Osmocom projects.
Change-Id: I4b9ffd7a329081df3d2c0b0ee8698a3cf759e94e
Related: OS#5960
-rw-r--r-- | include/osmocom/core/bitvec.h | 3 | ||||
-rw-r--r-- | include/osmocom/core/strrb.h | 4 | ||||
-rw-r--r-- | src/core/bitvec.c | 2 | ||||
-rw-r--r-- | src/core/strrb.c | 4 |
4 files changed, 5 insertions, 8 deletions
diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 70b0e27d..1e2fe7b4 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -23,7 +23,6 @@ * \file bitvec.h */ #include <stdint.h> -#include <osmocom/core/talloc.h> #include <osmocom/core/defs.h> #include <stdbool.h> @@ -61,7 +60,7 @@ int bitvec_find_bit_pos(const struct bitvec *bv, unsigned int n, enum bit_value int bitvec_spare_padding(struct bitvec *bv, unsigned int up_to_bit); int bitvec_get_bytes(struct bitvec *bv, uint8_t *bytes, unsigned int count); int bitvec_set_bytes(struct bitvec *bv, const uint8_t *bytes, unsigned int count); -struct bitvec *bitvec_alloc(unsigned int size, TALLOC_CTX *bvctx); +struct bitvec *bitvec_alloc(unsigned int size, void *bvctx); void bitvec_free(struct bitvec *bv); int bitvec_unhex(struct bitvec *bv, const char *src); unsigned int bitvec_pack(const struct bitvec *bv, uint8_t *buffer); diff --git a/include/osmocom/core/strrb.h b/include/osmocom/core/strrb.h index e3d3201c..92d6a2f2 100644 --- a/include/osmocom/core/strrb.h +++ b/include/osmocom/core/strrb.h @@ -26,8 +26,6 @@ #include <stdbool.h> #include <stdint.h> -#include <osmocom/core/talloc.h> - /*! A structure representing an osmocom string ringbuffer */ #define RB_MAX_MESSAGE_SIZE 240 @@ -38,7 +36,7 @@ struct osmo_strrb { char **buffer; /*!< storage for messages */ }; -struct osmo_strrb *osmo_strrb_create(TALLOC_CTX * ctx, size_t rb_size); +struct osmo_strrb *osmo_strrb_create(void *talloc_ctx, size_t rb_size); bool osmo_strrb_is_empty(const struct osmo_strrb *rb); const char *osmo_strrb_get_nth(const struct osmo_strrb *rb, unsigned int string_index); diff --git a/src/core/bitvec.c b/src/core/bitvec.c index 350f7383..38ea1bb5 100644 --- a/src/core/bitvec.c +++ b/src/core/bitvec.c @@ -395,7 +395,7 @@ int bitvec_set_bytes(struct bitvec *bv, const uint8_t *bytes, unsigned int count * \param[in] size Number of bytes in the vector * \param[in] ctx Context from which to allocate * \return pointer to allocated vector; NULL in case of error */ -struct bitvec *bitvec_alloc(unsigned int size, TALLOC_CTX *ctx) +struct bitvec *bitvec_alloc(unsigned int size, void *ctx) { struct bitvec *bv = talloc(ctx, struct bitvec); if (!bv) diff --git a/src/core/strrb.c b/src/core/strrb.c index df7edb31..c5a5ed6e 100644 --- a/src/core/strrb.c +++ b/src/core/strrb.c @@ -52,12 +52,12 @@ * This function creates and initializes a ringbuffer. * Note that the ringbuffer stores at most rb_size - 1 messages. */ -struct osmo_strrb *osmo_strrb_create(TALLOC_CTX * ctx, size_t rb_size) +struct osmo_strrb *osmo_strrb_create(void *talloc_ctx, size_t rb_size) { struct osmo_strrb *rb = NULL; unsigned int i; - rb = talloc_zero(ctx, struct osmo_strrb); + rb = talloc_zero(talloc_ctx, struct osmo_strrb); if (!rb) goto alloc_error; |