From 5a052103ae1ea943a36d2f29b533861ab3c13847 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Mon, 10 Oct 2022 09:14:13 +0000 Subject: [PATCH] zdump: fix signatures of the wrappers zg_alloc, zg_realloc and zg_ioctl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adapt the wrappers `zg_alloc`, `zg_realloc` and `zg_ioctl` to match the signatures used by `calloc`, `realloc` and `ioctl`. Signed-off-by: Marc Hartmayer Reviewed-by: Steffen Eiden Signed-off-by: Jan Höppner --- zdump/zg.c | 7 ++++--- zdump/zg.h | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/zdump/zg.c b/zdump/zg.c index dab3469a..026b1057 100644 --- a/zdump/zg.c +++ b/zdump/zg.c @@ -88,7 +88,7 @@ void __noreturn zg_exit(int rc) /* * Alloc memory and check for errors */ -void *zg_alloc(unsigned int size) +void *zg_alloc(size_t size) { void *ptr = calloc(size, 1); if (!ptr) @@ -99,7 +99,7 @@ void *zg_alloc(unsigned int size) /* * Realloc memory and check for errors */ -void *zg_realloc(void *ptr, unsigned int size) +void *zg_realloc(void *ptr, size_t size) { void *new_ptr = realloc(ptr, size); if (!new_ptr) @@ -308,7 +308,8 @@ off_t zg_seek_cur(const struct zg_fh *zg_fh, off_t off, enum zg_check check) /* * Do ioctl and exit in case of an error */ -int zg_ioctl(const struct zg_fh *zg_fh, int rq, void *data, const char *op, enum zg_check check) +int zg_ioctl(const struct zg_fh *zg_fh, unsigned long rq, void *data, const char *op, + enum zg_check check) { int rc; diff --git a/zdump/zg.h b/zdump/zg.h index d4f3d62b..befa6743 100644 --- a/zdump/zg.h +++ b/zdump/zg.h @@ -48,8 +48,8 @@ STATIC_ASSERT(sizeof(off_t) == sizeof(long)) /* * Memory functions */ -void *zg_alloc(unsigned int size); -void *zg_realloc(void *ptr, unsigned int size); +void *zg_alloc(size_t size); +void *zg_realloc(void *ptr, size_t size); void zg_free(void *ptr); char *zg_strdup(const char *str); @@ -151,7 +151,8 @@ off_t zg_tell(const struct zg_fh *zg_fh, enum zg_check check); off_t zg_seek(const struct zg_fh *zg_fh, off_t off, enum zg_check check); off_t zg_seek_end(const struct zg_fh *zg_fh, off_t off, enum zg_check check); off_t zg_seek_cur(const struct zg_fh *zg_fh, off_t off, enum zg_check check); -int zg_ioctl(const struct zg_fh *zg_fh, int rq, void *data, const char *op, enum zg_check check); +int zg_ioctl(const struct zg_fh *zg_fh, unsigned long rq, void *data, const char *op, + enum zg_check check); enum zg_type zg_type(const struct zg_fh *zg_fh); /*