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/package.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/package.c') diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index d0aba7ba..e8dd5d60 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -230,7 +230,7 @@ static int parse_descfile(const char *descfile, pmpkg_t *info) /* char *lang_tmp; info->desc_localized = alpm_list_add(info->desc_localized, strdup(ptr)); - if((lang_tmp = (char *)malloc(strlen(setlocale(LC_ALL, "")))) == NULL) { + if((lang_tmp = malloc(strlen(setlocale(LC_ALL, "")))) == NULL) { RET_ERR(PM_ERR_MEMORY, -1); } strncpy(lang_tmp, setlocale(LC_ALL, ""), strlen(setlocale(LC_ALL, ""))); @@ -373,7 +373,7 @@ pmpkg_t *_alpm_pkg_load(const char *pkgfile) char *str; int fd; - if((str = (char *)malloc(PATH_MAX)) == NULL) { + if((str = malloc(PATH_MAX)) == NULL) { RET_ERR(PM_ERR_MEMORY, (pmpkg_t *)-1); } fn = strdup("/tmp/alpm_XXXXXX"); -- cgit v1.2.3-24-g4f1b