From a79ffd053deb0a43ac82d917036bc4c28fc3c09c Mon Sep 17 00:00:00 2001 From: Ahmet Artu Yildirim Date: Thu, 22 Dec 2022 23:04:48 -0800 Subject: [PATCH] Use void* as parameter type in buffer-related functions --- src/check_progbuf.c | 2 +- src/progbuf.c | 6 +++--- src/progbuf.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/check_progbuf.c b/src/check_progbuf.c index cabfd60..8a5a48d 100644 --- a/src/check_progbuf.c +++ b/src/check_progbuf.c @@ -350,7 +350,7 @@ START_TEST (test_progbuf_load_from_buffer) ck_assert (iter_internal->read_pos == 4); - char *buffer; + void *buffer; progbuf_own_buffer (buf, &buffer, &size); ck_assert (buffer); diff --git a/src/progbuf.c b/src/progbuf.c index 068f22e..d4954e7 100644 --- a/src/progbuf.c +++ b/src/progbuf.c @@ -557,7 +557,7 @@ progbuf_alloc (long message_tag) } progbuf_h -progbuf_from_buffer (char *buffer, size_t size) +progbuf_from_buffer (void *buffer, size_t size) { if (!buffer || size == 0) return 0; @@ -657,7 +657,7 @@ progbuf_message_tag (progbuf_h buf, long *message_tag) } int -progbuf_own_buffer (progbuf_h buf, char **buffer, size_t *size) +progbuf_own_buffer (progbuf_h buf, void **buffer, size_t *size) { if (!buf || !buffer || !size) return PROGBUF_ERROR_NULL_PARAM; @@ -674,7 +674,7 @@ progbuf_own_buffer (progbuf_h buf, char **buffer, size_t *size) } int -progbuf_copy_buffer (progbuf_h buf, char **buffer, size_t *size) +progbuf_copy_buffer (progbuf_h buf, void **buffer, size_t *size) { if (!buf || !buffer || !size) return PROGBUF_ERROR_NULL_PARAM; diff --git a/src/progbuf.h b/src/progbuf.h index 713209a..0344c7b 100644 --- a/src/progbuf.h +++ b/src/progbuf.h @@ -16,11 +16,11 @@ typedef struct progbuf_s *progbuf_h; typedef struct progbuf_it_s *progbuf_it_h; progbuf_h progbuf_alloc (long message_tag); -progbuf_h progbuf_from_buffer (char *buffer, size_t size); +progbuf_h progbuf_from_buffer (void *buffer, size_t size); int progbuf_message_tag (progbuf_h buf, long *message_tag); -int progbuf_own_buffer (progbuf_h buf, char **buffer, size_t *size); -int progbuf_copy_buffer (progbuf_h buf, char **buffer, size_t *size); +int progbuf_own_buffer (progbuf_h buf, void **buffer, size_t *size); +int progbuf_copy_buffer (progbuf_h buf, void **buffer, size_t *size); int progbuf_buffer_size (progbuf_h buf, size_t *size); int progbuf_free (progbuf_h buf); -- 2.20.1