Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Consistentify boolean usage
Baptiste Daroussin committed 13 years ago
commit d65e3f7dedc024148024b7ddd4a109ff0028dc47
parent 8215d02
5 files changed +8 -9
modified libpkg/pkg_add.c
@@ -255,7 +255,7 @@ pkg_add(struct pkgdb *db, const char *path, unsigned flags)
	/*
	 * Extract the files on disk.
	 */
-
	if (extract == true && (retcode = do_extract(a, ae)) != EPKG_OK) {
+
	if (extract && (retcode = do_extract(a, ae)) != EPKG_OK) {
		/* If the add failed, clean up */
		pkg_delete_files(pkg, 1);
		pkg_delete_dirs(db, pkg, 1);
modified libpkg/pkg_config.c
@@ -744,13 +744,13 @@ pkg_configs(struct pkg_config **conf)
int
pkg_shutdown(void)
{
-
	if (parsed == true) {
-
		HASH_FREE(config, pkg_config, pkg_config_free);
-
	} else {
+
	if (!parsed) {
		pkg_emit_error("pkg_shutdown() must be called after pkg_init()");
		return (EPKG_FATAL);
	}

+
	HASH_FREE(config, pkg_config, pkg_config_free);
+

	config_by_key = NULL;

	parsed = false;
modified libpkg/pkg_repo.c
@@ -863,9 +863,8 @@ read_pkg_file(void *data)
		 * we unlock the fts_m mutex, we can not access it.
		 */
		pthread_mutex_lock(&d->fts_m);
-
		if (d->stop == false) {
+
		if (!d->stop)
			fts_ent = fts_read(d->fts);
-
		}
		if (fts_ent != NULL) {
			strlcpy(fts_accpath, fts_ent->fts_accpath, sizeof(fts_accpath));
			strlcpy(fts_path, fts_ent->fts_path, sizeof(fts_path));
modified pkg/utils.c
@@ -248,7 +248,7 @@ print_info(struct pkg * const pkg, unsigned int options)
	}

	/* Don't display a tab if quiet, retains compatibility. */
-
	tab = quiet == false ? "\t" : "";
+
	tab = quiet ? "" : "\t";

	/* If we printed a tag, and there are no other items to print,
	   then just return now. If there's only one single-line item
modified pkg/version.c
@@ -102,10 +102,10 @@ print_version(struct pkg *pkg, const char *source, const char *ver, char limchar
		to_print = false;
	}

-
	if (to_print == false)
+
	if (!to_print)
		return;

-
	asprintf(&namever, "%s-%s", name, version);	
+
	asprintf(&namever, "%s-%s", name, version);
	if (opt & VERSION_ORIGIN)
		printf("%-34s %c", origin, key);
	else