Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/delta.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/delta.c
parent0cf05c77ad86b5c1895e94284b571afba5feebe8 (diff)
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/delta.c')
-rw-r--r--lib/libalpm/delta.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/libalpm/delta.c b/lib/libalpm/delta.c
index 10c982f2..d3213fd1 100644
--- a/lib/libalpm/delta.c
+++ b/lib/libalpm/delta.c
@@ -41,32 +41,32 @@
const char SYMEXPORT *alpm_delta_get_from(pmdelta_t *delta)
{
- ASSERT(delta != NULL, return(NULL));
- return(delta->from);
+ ASSERT(delta != NULL, return NULL);
+ return delta->from;
}
const char SYMEXPORT *alpm_delta_get_to(pmdelta_t *delta)
{
- ASSERT(delta != NULL, return(NULL));
- return(delta->to);
+ ASSERT(delta != NULL, return NULL);
+ return delta->to;
}
const char SYMEXPORT *alpm_delta_get_filename(pmdelta_t *delta)
{
- ASSERT(delta != NULL, return(NULL));
- return(delta->delta);
+ ASSERT(delta != NULL, return NULL);
+ return delta->delta;
}
const char SYMEXPORT *alpm_delta_get_md5sum(pmdelta_t *delta)
{
- ASSERT(delta != NULL, return(NULL));
- return(delta->delta_md5);
+ ASSERT(delta != NULL, return NULL);
+ return delta->delta_md5;
}
off_t SYMEXPORT alpm_delta_get_size(pmdelta_t *delta)
{
- ASSERT(delta != NULL, return(-1));
- return(delta->delta_size);
+ ASSERT(delta != NULL, return -1);
+ return delta->delta_size;
}
/** @} */
@@ -108,7 +108,7 @@ static alpm_list_t *graph_init(alpm_list_t *deltas, int reverse)
}
v_i->childptr = v_i->children;
}
- return(vertices);
+ return vertices;
}
static void graph_init_size(alpm_list_t *vertices)
@@ -205,7 +205,7 @@ static off_t shortest_path(alpm_list_t *vertices, const char *to, alpm_list_t **
*path = alpm_list_reverse(rpath);
alpm_list_free(rpath);
- return(bestsize);
+ return bestsize;
}
/** Calculates the shortest path from one version to another.
@@ -229,7 +229,7 @@ off_t _alpm_shortest_delta_path(alpm_list_t *deltas,
if(deltas == NULL) {
*path = NULL;
- return(bestsize);
+ return bestsize;
}
_alpm_log(PM_LOG_DEBUG, "started delta shortest-path search for '%s'\n", to);
@@ -245,7 +245,7 @@ off_t _alpm_shortest_delta_path(alpm_list_t *deltas,
alpm_list_free(vertices);
*path = bestpath;
- return(bestsize);
+ return bestsize;
}
static alpm_list_t *find_unused(alpm_list_t *deltas, const char *to, off_t quota)
@@ -273,7 +273,7 @@ static alpm_list_t *find_unused(alpm_list_t *deltas, const char *to, off_t quota
}
alpm_list_free_inner(vertices, _alpm_graph_free);
alpm_list_free(vertices);
- return(unused);
+ return unused;
}
alpm_list_t SYMEXPORT *alpm_pkg_unused_deltas(pmpkg_t *pkg)
@@ -283,7 +283,7 @@ alpm_list_t SYMEXPORT *alpm_pkg_unused_deltas(pmpkg_t *pkg)
alpm_pkg_get_deltas(pkg),
alpm_pkg_get_filename(pkg),
pkgsize * MAX_DELTA_RATIO);
- return(unused);
+ return unused;
}
@@ -308,7 +308,7 @@ pmdelta_t *_alpm_delta_parse(char *line)
if(regexec(&reg, line, 0, 0, 0) != 0) {
/* delta line is invalid, return NULL */
regfree(&reg);
- return(NULL);
+ return NULL;
}
regfree(&reg);
@@ -339,7 +339,7 @@ pmdelta_t *_alpm_delta_parse(char *line)
_alpm_log(PM_LOG_DEBUG, "delta : %s %s '%jd'\n", delta->from, delta->to, (intmax_t)delta->delta_size);
- return(delta);
+ return delta;
}
void _alpm_delta_free(pmdelta_t *delta)