Tame warning when compiling with _DEBUG_
authorroot <root@xa-s05.(none)>
Thu, 30 Jun 2005 09:38:57 +0000 (11:38 +0200)
committerroot <root@xa-s05.(none)>
Thu, 30 Jun 2005 09:38:57 +0000 (11:38 +0200)
All about uncasted MALLOC()s when it is defined to dbg_malloc().

libmultipath/config.c
multipathd/cli.c
multipathd/main.c

index e11bc25..d59f754 100644 (file)
@@ -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;
 }
index cbfe19c..ef5e461 100644 (file)
@@ -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
index e1c0246..5933bb5 100644 (file)
@@ -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