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/deps.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/libalpm/deps.c') diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index 51b3207f..b6f8cc80 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -54,7 +54,7 @@ pmdepmissing_t *_alpm_depmiss_new(const char *target, pmdeptype_t type, ALPM_LOG_FUNC; - miss = (pmdepmissing_t *)malloc(sizeof(pmdepmissing_t)); + miss = malloc(sizeof(pmdepmissing_t)); if(miss == NULL) { _alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"), sizeof(pmdepmissing_t)); RET_ERR(PM_ERR_MEMORY, NULL); @@ -431,7 +431,7 @@ pmdepend_t SYMEXPORT *alpm_splitdep(const char *depstring) return(NULL); } - depend = (pmdepend_t *)malloc(sizeof(pmdepend_t)); + depend = malloc(sizeof(pmdepend_t)); if(depend == NULL) { _alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"), sizeof(pmdepend_t)); return(NULL); @@ -628,7 +628,7 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg, _alpm_log(PM_LOG_ERROR, _("cannot resolve dependencies for \"%s\" (\"%s\" is not in the package set)"), miss->target, miss->depend.name); if(data) { - if((miss = (pmdepmissing_t *)malloc(sizeof(pmdepmissing_t))) == NULL) { + if((miss = malloc(sizeof(pmdepmissing_t))) == NULL) { _alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"), sizeof(pmdepmissing_t)); FREELIST(*data); pm_errno = PM_ERR_MEMORY; @@ -668,7 +668,7 @@ int _alpm_resolvedeps(pmdb_t *local, alpm_list_t *dbs_sync, pmpkg_t *syncpkg, } else { _alpm_log(PM_LOG_ERROR, _("cannot resolve dependencies for \"%s\""), miss->target); if(data) { - if((miss = (pmdepmissing_t *)malloc(sizeof(pmdepmissing_t))) == NULL) { + if((miss = malloc(sizeof(pmdepmissing_t))) == NULL) { _alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"), sizeof(pmdepmissing_t)); FREELIST(*data); pm_errno = PM_ERR_MEMORY; -- cgit v1.2.3-24-g4f1b