diff --git a/src/util/dirpath.c b/src/util/dirpath.c index b307184068..3e76824e0b 100644 --- a/src/util/dirpath.c +++ b/src/util/dirpath.c @@ -569,7 +569,7 @@ ConstructLocalPath(const char *cpath, const char *relativeTo, /* construct path relative to install directory only */ pathSize += strlen(cpath); - newPath = (char *)malloc(pathSize); + newPath = malloc(pathSize); if (!newPath) { status = ENOMEM; } else { @@ -579,7 +579,7 @@ ConstructLocalPath(const char *cpath, const char *relativeTo, /* construct path relative to 'relativeTo' (and install dir) */ pathSize += strlen(relativeTo) + 1 + strlen(cpath); - newPath = (char *)malloc(pathSize); + newPath = malloc(pathSize); if (!newPath) { status = ENOMEM; } else { diff --git a/src/util/fileutil.c b/src/util/fileutil.c index 509d728972..fcd6f581f6 100644 --- a/src/util/fileutil.c +++ b/src/util/fileutil.c @@ -102,7 +102,7 @@ BufioOpen(char *path, int oflag, int mode) { bufio_p bp; - bp = (bufio_p) malloc(sizeof(bufio_t)); + bp = malloc(sizeof(bufio_t)); if (bp == NULL) { return NULL; } diff --git a/src/util/hostparse.c b/src/util/hostparse.c index 0079d8cf6a..9caf422299 100644 --- a/src/util/hostparse.c +++ b/src/util/hostparse.c @@ -244,7 +244,7 @@ gettmpdir(void) if (saveTmpDir == NULL) { /* initialize global temporary directory string */ - char *dirp = (char *)malloc(MAX_PATH+1); + char *dirp = malloc(MAX_PATH+1); int freeDirp = 1; if (dirp != NULL) { diff --git a/src/util/tabular_output.c b/src/util/tabular_output.c index bc8f3e4981..5866fbef14 100644 --- a/src/util/tabular_output.c +++ b/src/util/tabular_output.c @@ -337,13 +337,12 @@ util_newCellContents(struct util_Table* Table) { char **CellContents=NULL; int i; - if ( (CellContents=(char **) malloc( sizeof(char *) * Table->numColumns))\ - == NULL ) { + if ( (CellContents=malloc( sizeof(char *) * Table->numColumns))== NULL ) { fprintf(stderr,"Internal Error. Cannot allocate memory for new CellContents-array.\n"); exit(EXIT_FAILURE); } for (i=0;inumColumns;i++) { - if ( (CellContents[i]=(char *) malloc(UTIL_T_MAX_CELLCONTENT_LEN)) == NULL) { + if ( (CellContents[i]=malloc(UTIL_T_MAX_CELLCONTENT_LEN)) == NULL) { fprintf(stderr,\ "Internal Error. Cannot allocate memory for new CellContents-array.\n"); exit(EXIT_FAILURE); @@ -417,7 +416,7 @@ struct util_TableRow* newTableRow(struct util_Table* Table) { struct util_TableRow *aRow =NULL; - if ( (aRow= (struct util_TableRow*) malloc(sizeof(struct util_TableRow))) == NULL) { + if ( (aRow = malloc(sizeof(struct util_TableRow))) == NULL) { fprintf(stderr,\ "Internal Error. Cannot allocate memory for new TableRow.\n"); exit(EXIT_FAILURE); diff --git a/src/util/work_queue.c b/src/util/work_queue.c index e2f1553a28..d1ffa6f759 100644 --- a/src/util/work_queue.c +++ b/src/util/work_queue.c @@ -1180,7 +1180,7 @@ afs_wq_node_alloc(struct afs_work_queue_node ** node_out) int ret = 0; struct afs_work_queue_node * node; - *node_out = node = (struct afs_work_queue_node *) malloc(sizeof(*node)); + *node_out = node = malloc(sizeof(*node)); if (node == NULL) { ret = ENOMEM; goto error;