summaryrefslogtreecommitdiff
path: root/lib/libalpm/backup.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-03-20 19:45:57 -0500
committerDan McGee <dan@archlinux.org>2011-03-20 19:49:45 -0500
commit0303b26b1ed6d060e65ec7dbae5db50fc14836ff (patch)
tree902e26197511ee42a9562bc6b71ae77c20f3c86d /lib/libalpm/backup.c
parent0cf05c77ad86b5c1895e94284b571afba5feebe8 (diff)
downloadpacman-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/backup.c')
-rw-r--r--lib/libalpm/backup.c14
1 files changed, 7 insertions, 7 deletions
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: */