From 1c734bd7e59b0e2b1f79dbd9b203de1ecb921f3c Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Thu, 17 May 2012 13:31:53 +0100 Subject: [PATCH] update: Don't cast returns from malloc() malloc() returns a (void *) on all of our current platforms. So, don't bother casting the return value before assigning it - it is unnecessary noise. Change-Id: I6a33ab25b092faa96c764f0a469d052c181344ee Reviewed-on: http://gerrit.openafs.org/7471 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/update/client.c | 2 +- src/update/server.c | 2 +- src/update/utils.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/update/client.c b/src/update/client.c index a5f0024..5bf827b 100644 --- a/src/update/client.c +++ b/src/update/client.c @@ -472,7 +472,7 @@ update_ReceiveFile(int fd, struct rx_call *call, struct stat *status) #else blockSize = status->st_blksize; #endif - buffer = (char *)malloc(blockSize); + buffer = malloc(blockSize); if (!buffer) { printf("malloc failed\n"); return UPDATE_ERROR; diff --git a/src/update/server.c b/src/update/server.c index e91a470..37d79b9 100644 --- a/src/update/server.c +++ b/src/update/server.c @@ -400,7 +400,7 @@ update_SendFile(int fd, struct rx_call *call, struct stat *status) blockSize = status->st_blksize; #endif length = status->st_size; - buffer = (char *)malloc(blockSize); + buffer = malloc(blockSize); if (!buffer) { printf("malloc failed\n"); return UPDATE_ERROR; diff --git a/src/update/utils.c b/src/update/utils.c index ef2712f..1d5dc6a 100644 --- a/src/update/utils.c +++ b/src/update/utils.c @@ -27,7 +27,7 @@ int AddToList(struct filestr **ah, char *aname) { struct filestr *tf; - tf = (struct filestr *)malloc(sizeof(struct filestr)); + tf = malloc(sizeof(struct filestr)); tf->next = *ah; *ah = tf; tf->name = strdup(aname); -- 1.9.4