summaryrefslogtreecommitdiffstats
path: root/src/pacman/remove.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-03-21 01:45:57 +0100
committerDan McGee <dan@archlinux.org>2011-03-21 01:49:45 +0100
commit0303b26b1ed6d060e65ec7dbae5db50fc14836ff (patch)
tree902e26197511ee42a9562bc6b71ae77c20f3c86d /src/pacman/remove.c
parent0cf05c77ad86b5c1895e94284b571afba5feebe8 (diff)
downloadpacman-0303b26b1ed6d060e65ec7dbae5db50fc14836ff.tar.gz
pacman-0303b26b1ed6d060e65ec7dbae5db50fc14836ff.tar.xz
Style change: return(x) --> return x
This was discussed and more or less agreed upon on the mailing list. A huge checkin, but if we just do it and let people adjust the pain will end soon enough. Rebasing should be relatively straighforward for anyone that sees conflicts; just be sure you use the new return style if possible. The following semantic patch was used to do the change, along with some hand-massaging in order to preserve parenthesis where appropriate: The semantic match that finds this problem is as follows, although some hand-massaging was done in order to keep parenthesis where appropriate: (http://coccinelle.lip6.fr/) // <smpl> @@ expression a; @@ - return(a); + return a; // </smpl> A macros_file was also provided with the following content: Additional steps taken, mainly for ASSERT() macros: $ sed -i -e 's#return(NULL)#return NULL#' lib/libalpm/*.c $ sed -i -e 's#return(-1)#return -1#' lib/libalpm/*.c Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/remove.c')
-rw-r--r--src/pacman/remove.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/pacman/remove.c b/src/pacman/remove.c
index fb02e242..58e6edd5 100644
--- a/src/pacman/remove.c
+++ b/src/pacman/remove.c
@@ -40,25 +40,25 @@ static int remove_target(char *target)
if((info = alpm_db_get_pkg(db_local, target)) != NULL) {
if(alpm_remove_pkg(info) == -1) {
pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", target, alpm_strerrorlast());
- return(-1);
+ return -1;
}
- return(0);
+ return 0;
}
/* fallback to group */
pmgrp_t *grp = alpm_db_readgrp(db_local, target);
if(grp == NULL) {
pm_fprintf(stderr, PM_LOG_ERROR, "'%s': target not found\n", target);
- return(-1);
+ return -1;
}
for(p = alpm_grp_get_pkgs(grp); p; p = alpm_list_next(p)) {
pmpkg_t *pkg = alpm_list_getdata(p);
if(alpm_remove_pkg(pkg) == -1) {
pm_fprintf(stderr, PM_LOG_ERROR, "'%s': %s\n", target, alpm_strerrorlast());
- return(-1);
+ return -1;
}
}
- return(0);
+ return 0;
}
/**
@@ -75,12 +75,12 @@ int pacman_remove(alpm_list_t *targets)
if(targets == NULL) {
pm_printf(PM_LOG_ERROR, _("no targets specified (use -h for help)\n"));
- return(1);
+ return 1;
}
/* Step 0: create a new transaction */
if(trans_init(config->flags) == -1) {
- return(1);
+ return 1;
}
/* Step 1: add targets to the created transaction */
@@ -173,7 +173,7 @@ cleanup:
if(trans_release() == -1) {
retval = 1;
}
- return(retval);
+ return retval;
}
/* vim: set ts=2 sw=2 noet: */