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/backup.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/libalpm/backup.c') diff --git a/lib/libalpm/backup.c b/lib/libalpm/backup.c index ca955ca4..7df97471 100644 --- a/lib/libalpm/backup.c +++ b/lib/libalpm/backup.c @@ -47,7 +47,7 @@ static int backup_split(const char *string, char **file, char **hash) /* don't need our dup as the fname wasn't requested, so free it */ FREE(str); } - return(0); + return 0; } *ptr = '\0'; ptr++; @@ -59,21 +59,21 @@ static int backup_split(const char *string, char **file, char **hash) *hash = strdup(ptr); } FREE(str); - return(1); + return 1; } char *_alpm_backup_file(const char *string) { char *file = NULL; backup_split(string, &file, NULL); - return(file); + return file; } char *_alpm_backup_hash(const char *string) { char *hash = NULL; backup_split(string, NULL, &hash); - return(hash); + return hash; } /* Look for a filename in a pmpkg_t.backup list. If we find it, @@ -86,7 +86,7 @@ char *_alpm_needbackup(const char *file, const alpm_list_t *backup) ALPM_LOG_FUNC; if(file == NULL || backup == NULL) { - return(NULL); + return NULL; } /* run through the backup list and parse out the hash for our file */ @@ -101,13 +101,13 @@ char *_alpm_needbackup(const char *file, const alpm_list_t *backup) } if(strcmp(file, filename) == 0) { FREE(filename); - return(hash); + return hash; } FREE(filename); FREE(hash); } - return(NULL); + return NULL; } /* vim: set ts=2 sw=2 noet: */ -- cgit v1.2.3-70-g09d2