summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-04-20 19:45:16 -0500
committerDan McGee <dan@archlinux.org>2011-04-20 19:47:39 -0500
commit4af6c72d790e13fd28abc0d7b2eaaece51fd7862 (patch)
tree1ac5a83657f77ee3a43d885c973c95f1ad3f31d2
parent6760ec2b770e65f2aae9cfd39135cefd49961195 (diff)
downloadpacman-4af6c72d790e13fd28abc0d7b2eaaece51fd7862.tar.xz
syntax: if/while statements should have no trailing space
This is the standard, and we have had a few of these introduced lately that should not be here. Done with: find -name '*.c' | xargs sed -i -e 's#if (#if(#g' find -name '*.c' | xargs sed -i -e 's#while (#while(#g' Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--lib/libalpm/add.c2
-rw-r--r--lib/libalpm/alpm_list.c26
-rw-r--r--lib/libalpm/be_local.c2
-rw-r--r--lib/libalpm/be_package.c4
-rw-r--r--lib/libalpm/db.c6
-rw-r--r--lib/libalpm/deps.c12
-rw-r--r--lib/libalpm/diskspace.c6
-rw-r--r--lib/libalpm/dload.c2
-rw-r--r--lib/libalpm/handle.c40
-rw-r--r--lib/libalpm/package.c2
-rw-r--r--lib/libalpm/remove.c2
-rw-r--r--lib/libalpm/signing.c2
-rw-r--r--lib/libalpm/sync.c4
-rw-r--r--lib/libalpm/trans.c2
-rw-r--r--lib/libalpm/util.c14
-rw-r--r--src/pacman/callback.c4
-rw-r--r--src/pacman/package.c2
-rw-r--r--src/pacman/pacman.c48
-rw-r--r--src/pacman/query.c16
-rw-r--r--src/pacman/sync.c6
-rw-r--r--src/pacman/util.c10
-rw-r--r--src/util/testdb.c2
22 files changed, 107 insertions, 107 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 0a5cb539..b920465d 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -559,7 +559,7 @@ static int commit_single_pkg(pmpkg_t *newpkg, size_t pkg_current,
_alpm_log(PM_LOG_DEBUG, "extracting files\n");
- if ((archive = archive_read_new()) == NULL) {
+ if((archive = archive_read_new()) == NULL) {
pm_errno = PM_ERR_LIBARCHIVE;
ret = -1;
goto cleanup;
diff --git a/lib/libalpm/alpm_list.c b/lib/libalpm/alpm_list.c
index 0a3f6502..d7019d79 100644
--- a/lib/libalpm/alpm_list.c
+++ b/lib/libalpm/alpm_list.c
@@ -178,10 +178,10 @@ alpm_list_t SYMEXPORT *alpm_list_join(alpm_list_t *first, alpm_list_t *second)
{
alpm_list_t *tmp;
- if (first == NULL) {
+ if(first == NULL) {
return second;
}
- if (second == NULL) {
+ if(second == NULL) {
return first;
}
/* tmp is the last element of the first list */
@@ -209,12 +209,12 @@ alpm_list_t SYMEXPORT *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, a
{
alpm_list_t *newlist, *lp;
- if (left == NULL)
+ if(left == NULL)
return right;
- if (right == NULL)
+ if(right == NULL)
return left;
- if (fn(left->data, right->data) <= 0) {
+ if(fn(left->data, right->data) <= 0) {
newlist = left;
left = left->next;
}
@@ -226,8 +226,8 @@ alpm_list_t SYMEXPORT *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, a
newlist->next = NULL;
lp = newlist;
- while ((left != NULL) && (right != NULL)) {
- if (fn(left->data, right->data) <= 0) {
+ while((left != NULL) && (right != NULL)) {
+ if(fn(left->data, right->data) <= 0) {
lp->next = left;
left->prev = lp;
left = left->next;
@@ -240,11 +240,11 @@ alpm_list_t SYMEXPORT *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, a
lp = lp->next;
lp->next = NULL;
}
- if (left != NULL) {
+ if(left != NULL) {
lp->next = left;
left->prev = lp;
}
- else if (right != NULL) {
+ else if(right != NULL) {
lp->next = right;
right->prev = lp;
}
@@ -271,7 +271,7 @@ alpm_list_t SYMEXPORT *alpm_list_mmerge(alpm_list_t *left, alpm_list_t *right, a
*/
alpm_list_t SYMEXPORT *alpm_list_msort(alpm_list_t *list, size_t n, alpm_list_fn_cmp fn)
{
- if (n > 1) {
+ if(n > 1) {
alpm_list_t *left = list;
alpm_list_t *lastleft = alpm_list_nth(list, n/2 - 1);
alpm_list_t *right = lastleft->next;
@@ -689,7 +689,7 @@ void SYMEXPORT alpm_list_diff_sorted(const alpm_list_t *left,
return;
}
- while (l != NULL && r != NULL) {
+ while(l != NULL && r != NULL) {
int cmp = fn(l->data, r->data);
if(cmp < 0) {
if(onlyleft) {
@@ -707,13 +707,13 @@ void SYMEXPORT alpm_list_diff_sorted(const alpm_list_t *left,
r = r->next;
}
}
- while (l != NULL) {
+ while(l != NULL) {
if(onlyleft) {
*onlyleft = alpm_list_add(*onlyleft, l->data);
}
l = l->next;
}
- while (r != NULL) {
+ while(r != NULL) {
if(onlyright) {
*onlyright = alpm_list_add(*onlyright, r->data);
}
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c
index 0257c0b8..f4784e00 100644
--- a/lib/libalpm/be_local.c
+++ b/lib/libalpm/be_local.c
@@ -335,7 +335,7 @@ static int is_dir(const char *path, struct dirent *entry)
snprintf(buffer, PATH_MAX, "%s/%s", path, entry->d_name);
- if (!stat(buffer, &sbuf)) {
+ if(!stat(buffer, &sbuf)) {
return S_ISDIR(sbuf.st_mode);
}
}
diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c
index 4ac9c5ad..1531a52e 100644
--- a/lib/libalpm/be_package.c
+++ b/lib/libalpm/be_package.c
@@ -60,7 +60,7 @@ static void *_package_changelog_open(pmpkg_t *pkg)
archive_read_support_compression_all(archive);
archive_read_support_format_all(archive);
- if (archive_read_open_filename(archive, pkgfile,
+ if(archive_read_open_filename(archive, pkgfile,
ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
RET_ERR(PM_ERR_PKG_OPEN, NULL);
}
@@ -275,7 +275,7 @@ static pmpkg_t *pkg_load(const char *pkgfile, int full)
archive_read_support_compression_all(archive);
archive_read_support_format_all(archive);
- if (archive_read_open_filename(archive, pkgfile,
+ if(archive_read_open_filename(archive, pkgfile,
ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
alpm_pkg_free(newpkg);
RET_ERR(PM_ERR_PKG_OPEN, NULL);
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index fab1945f..c16133bb 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -443,7 +443,7 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles)
matched = name;
}
/* check desc */
- else if (desc && regexec(&reg, desc, 0, 0, 0) == 0) {
+ else if(desc && regexec(&reg, desc, 0, 0, 0) == 0) {
matched = desc;
}
/* TODO: should we be doing this, and should we print something
@@ -451,7 +451,7 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles)
if(!matched) {
/* check provides */
for(k = alpm_pkg_get_provides(pkg); k; k = k->next) {
- if (regexec(&reg, k->data, 0, 0, 0) == 0) {
+ if(regexec(&reg, k->data, 0, 0, 0) == 0) {
matched = k->data;
break;
}
@@ -460,7 +460,7 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles)
if(!matched) {
/* check groups */
for(k = alpm_pkg_get_groups(pkg); k; k = k->next) {
- if (regexec(&reg, k->data, 0, 0, 0) == 0) {
+ if(regexec(&reg, k->data, 0, 0, 0) == 0) {
matched = k->data;
break;
}
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index dda5ed79..c5fb92ef 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -153,7 +153,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, int reverse)
while(vertex->childptr && !found) {
pmgraph_t *nextchild = vertex->childptr->data;
vertex->childptr = vertex->childptr->next;
- if (nextchild->state == 0) {
+ if(nextchild->state == 0) {
found = 1;
nextchild->parent = vertex;
vertex = nextchild;
@@ -181,7 +181,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, int reverse)
vptr = vptr->next;
while(vptr) {
vertex = vptr->data;
- if (vertex->state == 0) break;
+ if(vertex->state == 0) break;
vptr = vptr->next;
}
}
@@ -569,7 +569,7 @@ static pmpkg_t *resolvedep(pmdepend_t *dep, alpm_list_t *dbs,
if(pkg && _alpm_depcmp(pkg, dep) && !_alpm_pkg_find(excluding, pkg->name)) {
if(_alpm_pkg_should_ignore(pkg)) {
int install = 0;
- if (prompt) {
+ if(prompt) {
QUESTION(handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, pkg,
NULL, NULL, &install);
} else {
@@ -591,7 +591,7 @@ static pmpkg_t *resolvedep(pmdepend_t *dep, alpm_list_t *dbs,
!_alpm_pkg_find(excluding, pkg->name)) {
if(_alpm_pkg_should_ignore(pkg)) {
int install = 0;
- if (prompt) {
+ if(prompt) {
QUESTION(handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG,
pkg, NULL, NULL, &install);
} else {
@@ -613,13 +613,13 @@ static pmpkg_t *resolvedep(pmdepend_t *dep, alpm_list_t *dbs,
/* first check if one provider is already installed locally */
for(i = providers; i; i = i->next) {
pmpkg_t *pkg = i->data;
- if (_alpm_pkghash_find(_alpm_db_get_pkgcache_hash(handle->db_local), pkg->name)) {
+ if(_alpm_pkghash_find(_alpm_db_get_pkgcache_hash(handle->db_local), pkg->name)) {
alpm_list_free(providers);
return pkg;
}
}
count = alpm_list_count(providers);
- if (count >= 1) {
+ if(count >= 1) {
/* default to first provider if there is no QUESTION callback */
int index = 0;
if(count > 1) {
diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c
index a34a63cd..102b42c6 100644
--- a/lib/libalpm/diskspace.c
+++ b/lib/libalpm/diskspace.c
@@ -71,7 +71,7 @@ static alpm_list_t *mount_point_list(void)
fp = setmntent(MOUNTED, "r");
- if (fp == NULL) {
+ if(fp == NULL) {
return NULL;
}
@@ -103,7 +103,7 @@ static alpm_list_t *mount_point_list(void)
entries = getmntinfo(&fsp, MNT_NOWAIT);
- if (entries < 0) {
+ if(entries < 0) {
return NULL;
}
@@ -192,7 +192,7 @@ static int calculate_installed_size(const alpm_list_t *mount_points,
struct archive *archive;
struct archive_entry *entry;
- if ((archive = archive_read_new()) == NULL) {
+ if((archive = archive_read_new()) == NULL) {
pm_errno = PM_ERR_LIBARCHIVE;
ret = -1;
goto cleanup;
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index 5347b9bb..40099b61 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -195,7 +195,7 @@ static int curl_download_internal(const char *url, const char *localpath,
curl_easy_setopt(handle->curl, CURLOPT_PROGRESSDATA, (void *)&dlfile);
useragent = getenv("HTTP_USER_AGENT");
- if (useragent != NULL) {
+ if(useragent != NULL) {
curl_easy_setopt(handle->curl, CURLOPT_USERAGENT, useragent);
}
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index c4b98631..1c7d6590 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -98,7 +98,7 @@ void _alpm_handle_free(pmhandle_t *handle)
alpm_cb_log SYMEXPORT alpm_option_get_logcb()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
@@ -107,7 +107,7 @@ alpm_cb_log SYMEXPORT alpm_option_get_logcb()
alpm_cb_download SYMEXPORT alpm_option_get_dlcb()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
@@ -116,7 +116,7 @@ alpm_cb_download SYMEXPORT alpm_option_get_dlcb()
alpm_cb_fetch SYMEXPORT alpm_option_get_fetchcb()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
@@ -125,7 +125,7 @@ alpm_cb_fetch SYMEXPORT alpm_option_get_fetchcb()
alpm_cb_totaldl SYMEXPORT alpm_option_get_totaldlcb()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
@@ -134,7 +134,7 @@ alpm_cb_totaldl SYMEXPORT alpm_option_get_totaldlcb()
const char SYMEXPORT *alpm_option_get_root()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
@@ -143,7 +143,7 @@ const char SYMEXPORT *alpm_option_get_root()
const char SYMEXPORT *alpm_option_get_dbpath()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
@@ -152,7 +152,7 @@ const char SYMEXPORT *alpm_option_get_dbpath()
alpm_list_t SYMEXPORT *alpm_option_get_cachedirs()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
@@ -161,7 +161,7 @@ alpm_list_t SYMEXPORT *alpm_option_get_cachedirs()
const char SYMEXPORT *alpm_option_get_logfile()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
@@ -170,7 +170,7 @@ const char SYMEXPORT *alpm_option_get_logfile()
const char SYMEXPORT *alpm_option_get_lockfile()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
@@ -179,7 +179,7 @@ const char SYMEXPORT *alpm_option_get_lockfile()
const char SYMEXPORT *alpm_option_get_signaturedir()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
@@ -188,7 +188,7 @@ const char SYMEXPORT *alpm_option_get_signaturedir()
int SYMEXPORT alpm_option_get_usesyslog()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return -1;
}
@@ -197,7 +197,7 @@ int SYMEXPORT alpm_option_get_usesyslog()
alpm_list_t SYMEXPORT *alpm_option_get_noupgrades()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
@@ -206,7 +206,7 @@ alpm_list_t SYMEXPORT *alpm_option_get_noupgrades()
alpm_list_t SYMEXPORT *alpm_option_get_noextracts()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
@@ -215,7 +215,7 @@ alpm_list_t SYMEXPORT *alpm_option_get_noextracts()
alpm_list_t SYMEXPORT *alpm_option_get_ignorepkgs()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
@@ -224,7 +224,7 @@ alpm_list_t SYMEXPORT *alpm_option_get_ignorepkgs()
alpm_list_t SYMEXPORT *alpm_option_get_ignoregrps()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
@@ -233,7 +233,7 @@ alpm_list_t SYMEXPORT *alpm_option_get_ignoregrps()
const char SYMEXPORT *alpm_option_get_arch()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
@@ -242,7 +242,7 @@ const char SYMEXPORT *alpm_option_get_arch()
int SYMEXPORT alpm_option_get_usedelta()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return -1;
}
@@ -251,7 +251,7 @@ int SYMEXPORT alpm_option_get_usedelta()
int SYMEXPORT alpm_option_get_checkspace()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return -1;
}
@@ -260,7 +260,7 @@ int SYMEXPORT alpm_option_get_checkspace()
pmdb_t SYMEXPORT *alpm_option_get_localdb()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
@@ -269,7 +269,7 @@ pmdb_t SYMEXPORT *alpm_option_get_localdb()
alpm_list_t SYMEXPORT *alpm_option_get_syncdbs()
{
- if (handle == NULL) {
+ if(handle == NULL) {
pm_errno = PM_ERR_HANDLE_NULL;
return NULL;
}
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index 035ff170..2bd93e2a 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -80,7 +80,7 @@ int SYMEXPORT alpm_pkg_checkmd5sum(pmpkg_t *pkg)
if(retval == 0) {
return 0;
- } else if (retval == 1) {
+ } else if(retval == 1) {
pm_errno = PM_ERR_PKG_INVALID;
retval = -1;
}
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index b08a925f..31b20131 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -160,7 +160,7 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
if(trans->flags & PM_TRANS_FLAG_CASCADE) {
remove_prepare_cascade(trans, db, lp);
- } else if (trans->flags & PM_TRANS_FLAG_UNNEEDED) {
+ } else if(trans->flags & PM_TRANS_FLAG_UNNEEDED) {
/* Remove needed packages (which would break dependencies)
* from target list */
remove_prepare_keep_needed(trans, db, lp);
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index a7cb041d..42e8c677 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -148,7 +148,7 @@ int _alpm_gpgme_checksig(const char *path, const pmpgpsig_t *sig)
CHECK_ERR();
result = gpgme_op_verify_result(ctx);
gpgsig = result->signatures;
- if (!gpgsig || gpgsig->next) {
+ if(!gpgsig || gpgsig->next) {
_alpm_log(PM_LOG_ERROR, _("Unexpected number of signatures\n"));
ret = -1;
goto error;
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 0143eed1..df255152 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -360,7 +360,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
int remove_unresolvable = 0;
QUESTION(handle->trans, PM_TRANS_CONV_REMOVE_PKGS, unresolvable,
NULL, NULL, &remove_unresolvable);
- if (remove_unresolvable) {
+ if(remove_unresolvable) {
/* User wants to remove the unresolvable packages from the
transaction. The packages will be removed from the actual
transaction when the transaction packages are replaced with a
@@ -764,7 +764,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data)
EVENT(trans, PM_TRANS_EVT_RETRIEVE_START, current->treename, NULL);
errors = _alpm_download_files(files, current->servers, cachedir);
- if (errors) {
+ if(errors) {
_alpm_log(PM_LOG_WARNING, _("failed to retrieve some files from %s\n"),
current->treename);
if(pm_errno == 0) {
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index e1722225..a7edb97e 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -72,7 +72,7 @@ static int make_lock(pmhandle_t *handle)
do {
fd = open(handle->lockfile, O_WRONLY | O_CREAT | O_EXCL, 0000);
- } while (fd == -1 && errno == EINTR);
+ } while(fd == -1 && errno == EINTR);
if(fd > 0) {
FILE *f = fdopen(fd, "w");
fprintf(f, "%ld\n", (long)getpid());
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 0a9dde2a..667e31e1 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -65,14 +65,14 @@ char* strsep(char** str, const char* delims)
{
char* token;
- if (*str==NULL) {
+ if(*str==NULL) {
/* No more tokens */
return NULL;
}
token=*str;
- while (**str!='\0') {
- if (strchr(delims,**str)!=NULL) {
+ while(**str!='\0') {
+ if(strchr(delims,**str)!=NULL) {
**str='\0';
(*str)++;
return token;
@@ -307,7 +307,7 @@ int _alpm_unpack(const char *archive, const char *prefix, alpm_list_t *list, int
char *found = alpm_list_find_str(list, prefix);
free(prefix);
if(!found) {
- if (archive_read_data_skip(_archive) != ARCHIVE_OK) {
+ if(archive_read_data_skip(_archive) != ARCHIVE_OK) {
ret = 1;
goto cleanup;
}
@@ -700,7 +700,7 @@ char SYMEXPORT *alpm_compute_md5sum(const char *filename)
/* defined above for OpenSSL, otherwise defined in md5.h */
ret = md5_file(filename, output);
- if (ret > 0) {
+ if(ret > 0) {
RET_ERR(PM_ERR_NOT_A_FILE, NULL);
}
@@ -838,7 +838,7 @@ int _alpm_splitname(const char *target, pmpkg_t *pkg)
end = target + strlen(target);
/* remove any trailing '/' */
- while (*(end - 1) == '/') {
+ while(*(end - 1) == '/') {
--end;
}
@@ -916,7 +916,7 @@ char *strndup(const char *s, size_t n)
size_t len = strnlen(s, n);
char *new = (char *) malloc(len + 1);
- if (new == NULL)
+ if(new == NULL)
return NULL;
new[len] = '\0';
diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index 5071d524..d3dc7440 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -398,7 +398,7 @@ void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent,
}
infolen = getcols() * 6 / 10;
- if (infolen < 50) {
+ if(infolen < 50) {
infolen = 50;
}
@@ -507,7 +507,7 @@ void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total)
}
infolen = getcols() * 6 / 10;
- if (infolen < 50) {
+ if(infolen < 50) {
infolen = 50;
}
/* explanation of magic 28 number at the end */
diff --git a/src/pacman/package.c b/src/pacman/package.c
index a113d615..93c56ad9 100644
--- a/src/pacman/package.c
+++ b/src/pacman/package.c
@@ -179,7 +179,7 @@ static const char *get_backup_file_status(const char *root,
}
/* if checksums don't match, file has been modified */
- if (strcmp(md5sum, expected_md5) != 0) {
+ if(strcmp(md5sum, expected_md5) != 0) {
ret = "MODIFIED";
} else {
ret = "UNMODIFIED";
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 4c43c36a..7e9fd6b9 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -170,7 +170,7 @@ static void usage(int op, const char * const myname)
addlist(_(" -w, --downloadonly download packages but do not install/upgrade anything\n"));
addlist(_(" -y, --refresh download fresh package databases from the server\n"));
addlist(_(" --needed don't reinstall up to date packages\n"));
- } else if (op == PM_OP_DATABASE) {
+ } else if(op == PM_OP_DATABASE) {
printf("%s: %s {-D --database} <%s> <%s>\n", str_usg, myname, str_opt, str_pkg);
printf("%s:\n", str_opt);
addlist(_(" --asdeps mark packages as non-explicitly installed\n"));
@@ -240,7 +240,7 @@ static void version(void)
static void localize(void)
{
static int init = 0;
- if (!init) {
+ if(!init) {
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
@@ -264,7 +264,7 @@ static void setuseragent(void)
static void setarch(const char *arch)
{
- if (strcmp(arch, "auto") == 0) {
+ if(strcmp(arch, "auto") == 0) {
struct utsname un;
uname(&un);
pm_printf(PM_LOG_DEBUG, "config: Architecture: %s\n", un.machine);
@@ -346,7 +346,7 @@ static void handler(int signum)
static void setlibpaths(void)
{
static int init = 0;
- if (!init) {
+ if(!init) {
int ret = 0;
pm_printf(PM_LOG_DEBUG, "setlibpaths() called\n");
@@ -594,7 +594,7 @@ static int parsearg_trans(int opt)
static int parsearg_remove(int opt)
{
- if (parsearg_trans(opt) == 0)
+ if(parsearg_trans(opt) == 0)
return 0;
switch(opt) {
case 'c': config->flags |= PM_TRANS_FLAG_CASCADE; break;
@@ -615,7 +615,7 @@ static int parsearg_remove(int opt)
/* options common to -S -U */
static int parsearg_upgrade(int opt)
{
- if (parsearg_trans(opt) == 0)
+ if(parsearg_trans(opt) == 0)
return 0;
switch(opt) {
case 'f': config->flags |= PM_TRANS_FLAG_FORCE; break;
@@ -634,7 +634,7 @@ static int parsearg_upgrade(int opt)
static int parsearg_sync(int opt)
{
- if (parsearg_upgrade(opt) == 0)
+ if(parsearg_upgrade(opt) == 0)
return 0;
switch(opt) {
case OP_NEEDED: config->flags |= PM_TRANS_FLAG_NEEDED; break;
@@ -787,7 +787,7 @@ static int parseargs(int argc, char *argv[])
result = 1;
break;
}
- if (result == 0) {
+ if(result == 0) {
continue;
}
@@ -823,9 +823,9 @@ static int option_add_syncfirst(const char *name) {
/* helper for being used with setrepeatingoption */
static int option_add_cleanmethod(const char *value) {
- if (strcmp(value, "KeepInstalled") == 0) {
+ if(strcmp(value, "KeepInstalled") == 0) {
config->cleanmethod |= PM_CLEAN_KEEPINST;
- } else if (strcmp(value, "KeepCurrent") == 0) {
+ } else if(strcmp(value, "KeepCurrent") == 0) {
config->cleanmethod |= PM_CLEAN_KEEPCUR;
} else {
pm_printf(PM_LOG_ERROR, _("invalid value for 'CleanMethod' : '%s'\n"),
@@ -1041,24 +1041,24 @@ static int _parse_options(const char *key, char *value,
config->rootdir = strdup(value);
pm_printf(PM_LOG_DEBUG, "config: rootdir: %s\n", value);
}
- } else if (strcmp(key, "GPGDir") == 0) {
+ } else if(strcmp(key, "GPGDir") == 0) {
if(!config->gpgdir) {
config->gpgdir = strdup(value);
pm_printf(PM_LOG_DEBUG, "config: gpgdir: %s\n", value);
}
- } else if (strcmp(key, "LogFile") == 0) {
+ } else if(strcmp(key, "LogFile") == 0) {
if(!config->logfile) {
config->logfile = strdup(value);
pm_printf(PM_LOG_DEBUG, "config: logfile: %s\n", value);
}
- } else if (strcmp(key, "XferCommand") == 0) {
+ } else if(strcmp(key, "XferCommand") == 0) {
config->xfercommand = strdup(value);
alpm_option_set_fetchcb(download_with_xfercommand);
pm_printf(PM_LOG_DEBUG, "config: xfercommand: %s\n", value);
- } else if (strcmp(key, "CleanMethod") == 0) {
+ } else if(strcmp(key, "CleanMethod") == 0) {
setrepeatingoption(value, "CleanMethod", option_add_cleanmethod);
} else if(strcmp(key, "VerifySig") == 0) {
- if (strcmp(value, "Always") == 0) {
+ if(strcmp(value, "Always") == 0) {
alpm_option_set_default_sigverify(PM_PGP_VERIFY_ALWAYS);
} else if(strcmp(value, "Optional") == 0) {
alpm_option_set_default_sigverify(PM_PGP_VERIFY_OPTIONAL);
@@ -1262,18 +1262,18 @@ static int _parseconfig(const char *file, const char *givensection,
goto cleanup;
}
} else if(strcmp(key, "VerifySig") == 0) {
- if (strcmp(value, "Always") == 0) {
- ret = alpm_db_set_pgp_verify(db,PM_PGP_VERIFY_ALWAYS);
- } else if (strcmp(value, "Optional") == 0) {
- ret = alpm_db_set_pgp_verify(db,PM_PGP_VERIFY_OPTIONAL);
- } else if (strcmp(value, "Never") == 0) {
- ret = alpm_db_set_pgp_verify(db,PM_PGP_VERIFY_NEVER);
+ if(strcmp(value, "Always") == 0) {
+ ret = alpm_db_set_pgp_verify(db, PM_PGP_VERIFY_ALWAYS);
+ } else if(strcmp(value, "Optional") == 0) {
+ ret = alpm_db_set_pgp_verify(db, PM_PGP_VERIFY_OPTIONAL);
+ } else if(strcmp(value, "Never") == 0) {
+ ret = alpm_db_set_pgp_verify(db, PM_PGP_VERIFY_NEVER);
} else {
pm_printf(PM_LOG_ERROR, _("invalid value for 'VerifySig' : '%s'\n"), value);
ret = 1;
goto cleanup;
}
- if (ret != 0) {
+ if(ret != 0) {
pm_printf(PM_LOG_ERROR, _("could not add pgp verify option to database '%s': %s (%s)\n"),
alpm_db_get_name(db), value, alpm_strerrorlast());
goto cleanup;
@@ -1438,7 +1438,7 @@ int main(int argc, char *argv[])
}
}
/* check for buffer overflow */
- if (i >= PATH_MAX) {
+ if(i >= PATH_MAX) {
pm_printf(PM_LOG_ERROR, _("buffer overflow detected in arg parsing\n"));
cleanup(EXIT_FAILURE);
}
@@ -1448,7 +1448,7 @@ int main(int argc, char *argv[])
line[i] = '\0';
pm_targets = alpm_list_add(pm_targets, strdup(line));
}
- if (!freopen(ctermid(NULL), "r", stdin)) {
+ if(!freopen(ctermid(NULL), "r", stdin)) {
pm_printf(PM_LOG_ERROR, _("failed to reopen stdin for reading: (%s)\n"),
strerror(errno));
}
diff --git a/src/pacman/query.c b/src/pacman/query.c
index 5f751191..4208d2a2 100644
--- a/src/pacman/query.c
+++ b/src/pacman/query.c
@@ -60,16 +60,16 @@ static int search_path(char **filename, struct stat *bufptr)
char *envpath, *envpathsplit, *path, *fullname;
size_t flen;
- if ((envpath = getenv("PATH")) == NULL) {
+ if((envpath = getenv("PATH")) == NULL) {
return -1;
}
- if ((envpath = envpathsplit = strdup(envpath)) == NULL) {
+ if((envpath = envpathsplit = strdup(envpath)) == NULL) {
return -1;
}
flen = strlen(*filename);
- while ((path = strsep(&envpathsplit, ":")) != NULL) {
+ while((path = strsep(&envpathsplit, ":")) != NULL) {
size_t plen = strlen(path);
/* strip the trailing slash if one exists */
@@ -94,7 +94,7 @@ static int search_path(char **filename, struct stat *bufptr)
static void print_query_fileowner(const char *filename, pmpkg_t *info)
{
- if (!config->quiet) {
+ if(!config->quiet) {
printf(_("%s is owned by %s %s\n"), filename,
alpm_pkg_get_name(info), alpm_pkg_get_version(info));
} else {
@@ -167,7 +167,7 @@ static int query_fileowner(alpm_list_t *targets)
bname = mbasename(filename);
dname = mdirname(filename);
/* for files in '/', there is no directory name to match */
- if (strcmp(dname, "") == 0) {
+ if(strcmp(dname, "") == 0) {
rpath = NULL;
} else {
rpath = resolve_path(dname);
@@ -255,14 +255,14 @@ static int query_search(alpm_list_t *targets)
alpm_list_t *grp;
pmpkg_t *pkg = alpm_list_getdata(i);
- if (!config->quiet) {
+ if(!config->quiet) {
printf("local/%s %s", alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg));
} else {
printf("%s", alpm_pkg_get_name(pkg));
}
- if (!config->quiet) {
+ if(!config->quiet) {
if((grp = alpm_pkg_get_groups(pkg)) != NULL) {
alpm_list_t *k;
printf(" (");
@@ -468,7 +468,7 @@ static int display(pmpkg_t *pkg)
}
if(!config->op_q_info && !config->op_q_list
&& !config->op_q_changelog && !config->op_q_check) {
- if (!config->quiet) {
+ if(!config->quiet) {
printf("%s %s\n", alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg));
} else {
printf("%s\n", alpm_pkg_get_name(pkg));
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 025e2a4b..64d8cb08 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -340,14 +340,14 @@ static int sync_search(alpm_list_t *syncs, alpm_list_t *targets)
alpm_list_t *grp;
pmpkg_t *pkg = alpm_list_getdata(j);
- if (!config->quiet) {
+ if(!config->quiet) {
printf("%s/%s %s", alpm_db_get_name(db), alpm_pkg_get_name(pkg),
alpm_pkg_get_version(pkg));
} else {
printf("%s", alpm_pkg_get_name(pkg));
}
- if (!config->quiet) {
+ if(!config->quiet) {
if((grp = alpm_pkg_get_groups(pkg)) != NULL) {
alpm_list_t *k;
printf(" (");
@@ -550,7 +550,7 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets)
for(j = alpm_db_get_pkgcache(db); j; j = alpm_list_next(j)) {
pmpkg_t *pkg = alpm_list_getdata(j);
- if (!config->quiet) {
+ if(!config->quiet) {
printf("%s %s %s", alpm_db_get_name(db), alpm_pkg_get_name(pkg),
alpm_pkg_get_version(pkg));
print_installed(db_local, pkg);
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 098daf70..7fb2322d 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -589,7 +589,7 @@ void list_display(const char *title, const alpm_list_t *list)
for (j = 1; j <= len; j++) {
printf(" ");
}
- } else if (cols != len) {
+ } else if(cols != len) {
/* 2 spaces are added if this is not the first element on a line. */
printf(" ");
cols += 2;
@@ -978,7 +978,7 @@ static int multiselect_parse(char *array, int count, char *response)
char *ends = NULL;
char *starts = strtok_r(str, " ", &saveptr);
- if (starts == NULL) {
+ if(starts == NULL) {
break;
}
strtrim(starts);
@@ -986,7 +986,7 @@ static int multiselect_parse(char *array, int count, char *response)
if(len == 0)
continue;
- if (*starts == '^') {
+ if(*starts == '^') {
starts++;
len--;
include = 0;
@@ -1145,7 +1145,7 @@ static int question(short preset, char *fmt, va_list args)
if(strcasecmp(response, _("Y")) == 0 || strcasecmp(response, _("YES")) == 0) {
return 1;
- } else if (strcasecmp(response, _("N")) == 0 || strcasecmp(response, _("NO")) == 0) {
+ } else if(strcasecmp(response, _("N")) == 0 || strcasecmp(response, _("NO")) == 0) {
return 0;
}
}
@@ -1316,7 +1316,7 @@ char *strndup(const char *s, size_t n)
size_t len = strnlen(s, n);
char *new = (char *) malloc(len + 1);
- if (new == NULL)
+ if(new == NULL)
return NULL;
new[len] = '\0';
diff --git a/src/util/testdb.c b/src/util/testdb.c
index 3d4fa6ae..b29e49f4 100644
--- a/src/util/testdb.c
+++ b/src/util/testdb.c
@@ -66,7 +66,7 @@ static int check_localdb_files(void)
return 1;
}
- while ((ent = readdir(dir)) != NULL) {
+ while((ent = readdir(dir)) != NULL) {
if(strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0
|| ent->d_name[0] == '.') {
continue;