From 0303b26b1ed6d060e65ec7dbae5db50fc14836ff Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 20 Mar 2011 19:45:57 -0500 Subject: 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/) // @@ expression a; @@ - return(a); + return a; // 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 --- lib/libalpm/be_sync.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lib/libalpm/be_sync.c') 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; } -- cgit v1.2.3-54-g00ecf