From 19f6ba2133989dcf74ea6f89f775b1d18e43c2d0 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 30 Jun 2005 11:38:57 +0200 Subject: [PATCH] Tame warning when compiling with _DEBUG_ All about uncasted MALLOC()s when it is defined to dbg_malloc(). --- libmultipath/config.c | 6 ++++-- multipathd/cli.c | 4 ++-- multipathd/main.c | 10 +++++----- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/libmultipath/config.c b/libmultipath/config.c index e11bc25..d59f754 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c @@ -195,7 +195,8 @@ free_mptable (vector mptable) struct mpentry * alloc_mpe (void) { - struct mpentry * mpe = MALLOC(sizeof(struct mpentry)); + struct mpentry * mpe = (struct mpentry *) + MALLOC(sizeof(struct mpentry)); return mpe; } @@ -203,7 +204,8 @@ alloc_mpe (void) static struct hwentry * alloc_hwe (void) { - struct hwentry * hwe = MALLOC(sizeof(struct hwentry)); + struct hwentry * hwe = (struct hwentry *) + MALLOC(sizeof(struct hwentry)); return hwe; } diff --git a/multipathd/cli.c b/multipathd/cli.c index cbfe19c..ef5e461 100644 --- a/multipathd/cli.c +++ b/multipathd/cli.c @@ -7,13 +7,13 @@ static struct key * alloc_key (void) { - return MALLOC(sizeof(struct key)); + return (struct key *)MALLOC(sizeof(struct key)); } static struct handler * alloc_handler (void) { - return MALLOC(sizeof(struct handler)); + return (struct handler *)MALLOC(sizeof(struct handler)); } static int diff --git a/multipathd/main.c b/multipathd/main.c index e1c0246..5933bb5 100644 --- a/multipathd/main.c +++ b/multipathd/main.c @@ -98,7 +98,7 @@ alloc_waiter (void) struct event_thread * wp; - wp = MALLOC(sizeof(struct event_thread)); + wp = (struct event_thread *)MALLOC(sizeof(struct event_thread)); return wp; } @@ -1059,9 +1059,9 @@ checkerloop (void *ap) static struct paths * init_paths (void) { - struct paths *allpaths; + struct paths * allpaths; - allpaths = MALLOC(sizeof(struct paths)); + allpaths = (struct paths *)MALLOC(sizeof(struct paths)); if (!allpaths) return NULL; @@ -1107,7 +1107,7 @@ static int prepare_namespace(void) { mode_t mode = S_IRWXU; - struct stat *buf; + struct stat * buf; char ramfs_args[64]; int i; int fd; @@ -1115,7 +1115,7 @@ prepare_namespace(void) size_t size = 10; struct stat statbuf; - buf = MALLOC(sizeof(struct stat)); + buf = (struct stat *)MALLOC(sizeof(struct stat)); /* * create a temp mount point for ramfs -- 2.7.4