Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/trans.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/trans.c
parent5c930c318e7b80af3a322ddc7ddf9fe100e9c16b (diff)
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/trans.c')
-rw-r--r--lib/libalpm/trans.c6
1 files changed, 3 insertions, 3 deletions
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;