summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/be_sync.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 /lib/libalpm/be_sync.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 'lib/libalpm/be_sync.c')
-rw-r--r--lib/libalpm/be_sync.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c
index 98516fd8..4966ce6f 100644
--- a/lib/libalpm/be_sync.c
+++ b/lib/libalpm/be_sync.c
@@ -133,17 +133,17 @@ int SYMEXPORT alpm_db_update(int force, pmdb_t *db)
if(ret == 1) {
/* files match, do nothing */
pm_errno = 0;
- return(1);
+ return 1;
} else if(ret == -1) {
/* pm_errno was set by the download code */
_alpm_log(PM_LOG_DEBUG, "failed to sync db: %s\n", alpm_strerrorlast());
- return(-1);
+ return -1;
}
/* Cache needs to be rebuilt */
_alpm_db_free_pkgcache(db);
- return(0);
+ return 0;
}
/* Forward decl so I don't reorganize the whole file right now */
@@ -204,7 +204,7 @@ static size_t estimate_package_count(struct stat *st, struct archive *archive)
/* assume it is at least somewhat compressed */
per_package = 200;
}
- return((size_t)(st->st_size / per_package) + 1);
+ return (size_t)((st->st_size / per_package) + 1);
}
static int sync_db_populate(pmdb_t *db)
@@ -294,7 +294,7 @@ static int sync_db_populate(pmdb_t *db)
}
archive_read_finish(archive);
- return(count);
+ return count;
}
#define READ_NEXT(s) do { \
@@ -334,7 +334,7 @@ static int sync_db_read(pmdb_t *db, struct archive *archive,
}
if(entryname == NULL) {
_alpm_log(PM_LOG_DEBUG, "invalid archive entry provided to _alpm_sync_db_read, skipping\n");
- return(-1);
+ return -1;
}
_alpm_log(PM_LOG_FUNCTION, "loading package data from archive entry %s\n",
@@ -365,7 +365,7 @@ static int sync_db_read(pmdb_t *db, struct archive *archive,
if(pkg == NULL) {
_alpm_log(PM_LOG_DEBUG, "package %s not found in %s sync database",
pkgname, db->treename);
- return(-1);
+ return -1;
}
if(strcmp(filename, "desc") == 0 || strcmp(filename, "depends") == 0
@@ -452,12 +452,12 @@ static int sync_db_read(pmdb_t *db, struct archive *archive,
error:
FREE(pkgname);
/* TODO: return 0 always? */
- return(0);
+ return 0;
}
static int sync_db_version(pmdb_t *db)
{
- return(2);
+ return 2;
}
struct db_operations sync_db_ops = {
@@ -490,7 +490,7 @@ pmdb_t *_alpm_db_register_sync(const char *treename)
db->ops = &sync_db_ops;
handle->dbs_sync = alpm_list_add(handle->dbs_sync, db);
- return(db);
+ return db;
}