diff options
author | Dan McGee <dan@archlinux.org> | 2011-03-21 01:45:57 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-03-21 01:49:45 +0100 |
commit | 0303b26b1ed6d060e65ec7dbae5db50fc14836ff (patch) | |
tree | 902e26197511ee42a9562bc6b71ae77c20f3c86d /lib/libalpm/remove.c | |
parent | 0cf05c77ad86b5c1895e94284b571afba5feebe8 (diff) | |
download | pacman-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 'lib/libalpm/remove.c')
-rw-r--r-- | lib/libalpm/remove.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 5def92a6..a01349ed 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -69,7 +69,7 @@ int SYMEXPORT alpm_remove_pkg(pmpkg_t *pkg) _alpm_log(PM_LOG_DEBUG, "adding %s in the target list\n", pkgname); trans->remove = alpm_list_add(trans->remove, _alpm_pkg_dup(pkg)); - return(0); + return 0; } static void remove_prepare_cascade(pmtrans_t *trans, pmdb_t *db, @@ -185,7 +185,7 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data) EVENT(trans, PM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL); } - return(0); + return 0; } static int can_remove_file(const char *path, alpm_list_t *skip) @@ -196,7 +196,7 @@ static int can_remove_file(const char *path, alpm_list_t *skip) if(alpm_list_find_str(skip, file)) { /* return success because we will never actually remove this file */ - return(1); + return 1; } /* If we fail write permissions due to a read-only filesystem, abort. * Assume all other possible failures are covered somewhere else */ @@ -206,11 +206,11 @@ static int can_remove_file(const char *path, alpm_list_t *skip) * it - ignore "chmod -w" simple permission failures */ _alpm_log(PM_LOG_ERROR, _("cannot remove file '%s': %s\n"), file, strerror(errno)); - return(0); + return 0; } } - return(1); + return 1; } /* Helper function for iterating through a package's file and deleting them @@ -351,7 +351,7 @@ db: pkgname); } - return(0); + return 0; } int _alpm_remove_packages(pmtrans_t *trans, pmdb_t *db) @@ -375,7 +375,7 @@ int _alpm_remove_packages(pmtrans_t *trans, pmdb_t *db) size_t targcount = alpm_list_count(targ); if(handle->trans->state == STATE_INTERRUPTED) { - return(0); + return 0; } /* get the name now so we can use it after package is removed */ @@ -457,7 +457,7 @@ int _alpm_remove_packages(pmtrans_t *trans, pmdb_t *db) /* run ldconfig if it exists */ _alpm_ldconfig(handle->root); - return(0); + return 0; } /* vim: set ts=2 sw=2 noet: */ |