zdump: fix signatures of the wrappers zg_alloc, zg_realloc and zg_ioctl

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 <mhartmay@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2022-10-10 09:14:13 +00:00
committed by Jan Höppner
parent 2ced5853b4
commit 5a052103ae
2 changed files with 8 additions and 6 deletions

View File

@@ -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;

View File

@@ -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);
/*