update: Don't cast returns from malloc()
authorSimon Wilkinson <sxw@your-file-system.com>
Thu, 17 May 2012 12:31:53 +0000 (13:31 +0100)
committerDerrick Brashear <shadow@dementix.org>
Thu, 24 May 2012 16:19:40 +0000 (09:19 -0700)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

src/update/client.c
src/update/server.c
src/update/utils.c

index a5f0024..5bf827b 100644 (file)
@@ -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;
index e91a470..37d79b9 100644 (file)
@@ -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;
index ef2712f..1d5dc6a 100644 (file)
@@ -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);