summaryrefslogtreecommitdiff
path: root/lib/libalpm/package.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-05-14 03:16:55 -0400
committerDan McGee <dan@archlinux.org>2007-05-14 03:16:55 -0400
commit2bcecbd62cb2bda681a3aba46bb0bbf690ba7219 (patch)
treecc7f9d60e04c65453527354bbd18312a9c323ed4 /lib/libalpm/package.c
parent5c930c318e7b80af3a322ddc7ddf9fe100e9c16b (diff)
downloadpacman-2bcecbd62cb2bda681a3aba46bb0bbf690ba7219.tar.xz
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 <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/package.c')
-rw-r--r--lib/libalpm/package.c4
1 files changed, 2 insertions, 2 deletions
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");