From 2bcecbd62cb2bda681a3aba46bb0bbf690ba7219 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 14 May 2007 03:16:55 -0400 Subject: Remove unnecessary casts on malloc and elsewhere We had many unnecessary casts, most of them dealing with malloc and other memory allocations. The variable type should take care of it; no need to do it explicitly. In addition, I caught a const error while removing the casts. Signed-off-by: Dan McGee --- lib/libalpm/trans.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/trans.c') diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index cb873e7a..2637197c 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -59,7 +59,7 @@ pmtrans_t *_alpm_trans_new() ALPM_LOG_FUNC; - if((trans = (pmtrans_t *)malloc(sizeof(pmtrans_t))) == NULL) { + if((trans = malloc(sizeof(pmtrans_t))) == NULL) { _alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"), sizeof(pmtrans_t)); return(NULL); } @@ -594,14 +594,14 @@ int _alpm_check_freespace(pmtrans_t *trans, alpm_list_t **data) if(pkgsize > freespace) { if(data) { long long *ptr; - if((ptr = (long long*)malloc(sizeof(long long)))==NULL) { + if((ptr = malloc(sizeof(long long)))==NULL) { _alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"), sizeof(long long)); pm_errno = PM_ERR_MEMORY; return(-1); } *ptr = pkgsize; *data = alpm_list_add(*data, ptr); - if((ptr = (long long*)malloc(sizeof(long long)))==NULL) { + if((ptr = malloc(sizeof(long long)))==NULL) { _alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"), sizeof(long long)); FREELIST(*data); pm_errno = PM_ERR_MEMORY; -- cgit v1.2.3-24-g4f1b