Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
quality: remove dead assignements
Baptiste Daroussin committed 4 years ago
commit d1f7fc99d72e4197f64170b86eac2e24782b33f9
parent b7e41c1
13 files changed +15 -27
modified libpkg/backup_lib.c
@@ -36,7 +36,6 @@ register_backup(struct pkgdb *db, int fd, const char *path)
{
	struct pkgdb_it *it;
	struct pkg *pkg = NULL;
-
	int rc = EPKG_OK;
	time_t t;
	char buf[BUFSIZ];
	char *sum;
@@ -49,8 +48,7 @@ register_backup(struct pkgdb *db, int fd, const char *path)

	it = pkgdb_query(db, "compat-libraries", MATCH_EXACT);
	if (it != NULL) {
-
		if (pkgdb_it_next(it, &pkg, PKG_LOAD_BASIC|PKG_LOAD_FILES) != EPKG_OK)
-
			rc = EPKG_FATAL;
+
		pkgdb_it_next(it, &pkg, PKG_LOAD_BASIC|PKG_LOAD_FILES);
		pkgdb_it_free(it);
	}
	if (pkg == NULL) {
@@ -100,7 +98,7 @@ backup_library(struct pkgdb *db, struct pkg *p, const char *path)
	ssize_t nread, nwritten;

	pkg_open_root_fd(p);
-
	from = to = backupdir = -1;
+
	to = -1;

	if (libname == NULL)
		return;
@@ -162,7 +160,6 @@ backup_library(struct pkgdb *db, struct pkg *p, const char *path)
		close(from);
		register_backup(db, backupdir, libname);
		close(backupdir);
-
		backupdir = -1;
		return;
	}

modified libpkg/flags.c
@@ -77,7 +77,6 @@ checkflags(const char *mode, int *optr)
		break;

	default:	/* illegal mode */
-
		ret = 0;
		errno = EINVAL;
		return (0);
	}
modified libpkg/lua_scripts.c
@@ -186,12 +186,9 @@ pkg_lua_script_to_ucl(struct pkg_lua_script *scripts)
{
	struct pkg_lua_script *script;
	ucl_object_t *array;
-
	ucl_object_t *obj;

	array = ucl_object_typed_new(UCL_ARRAY);
	LL_FOREACH(scripts, script) {
-
		obj = ucl_object_typed_new(UCL_OBJECT);
-

		ucl_array_append(array, ucl_object_fromstring_common(script->script,
				strlen(script->script), UCL_STRING_RAW|UCL_STRING_TRIM));
	}
modified libpkg/pkg_audit.c
@@ -157,7 +157,7 @@ static int
pkg_audit_sandboxed_extract(int fd, void *ud)
{
	struct pkg_audit_extract_cbdata *cbdata = ud;
-
	int ret, rc = EPKG_OK;
+
	int rc = EPKG_OK;
	struct archive *a = NULL;
	struct archive_entry *ae = NULL;

@@ -176,7 +176,7 @@ pkg_audit_sandboxed_extract(int fd, void *ud)
		rc = EPKG_FATAL;
	}
	else {
-
		while ((ret = archive_read_next_header(a, &ae)) == ARCHIVE_OK) {
+
		while (archive_read_next_header(a, &ae) == ARCHIVE_OK) {
			if (archive_read_data_into_fd(a, cbdata->out) != ARCHIVE_OK) {
				pkg_emit_error("archive_read_data_into_fd(%s) failed: %s",
						cbdata->dest, archive_error_string(a));
modified libpkg/pkg_create.c
@@ -381,7 +381,7 @@ pkg_create(struct pkg_create *pc, const char *metadata, const char *plist,
		return (EPKG_FATAL);
	}

-
	if ((ret = load_metadata(pkg, metadata, plist, pc->rootdir)) != EPKG_OK) {
+
	if (load_metadata(pkg, metadata, plist, pc->rootdir) != EPKG_OK) {
		pkg_free(pkg);
		return (EPKG_FATAL);
	}
modified libpkg/pkg_cudf.c
@@ -431,12 +431,11 @@ pkg_jobs_cudf_parse_output(struct pkg_jobs *j, FILE *f)
{
	char *line = NULL, *begin, *param, *value;
	size_t linecap = 0;
-
	ssize_t linelen;
	struct pkg_cudf_entry cur_pkg;

	memset(&cur_pkg, 0, sizeof(cur_pkg));

-
	while ((linelen = getline(&line, &linecap, f)) > 0) {
+
	while (getline(&line, &linecap, f) > 0) {
		/* Split line, cut spaces */
		begin = line;
		param = strsep(&begin, ": \t");
modified libpkg/pkg_delete.c
@@ -62,7 +62,6 @@ pkg_delete(struct pkg *pkg, struct pkgdb *db, unsigned flags)
	bool		 handle_rc = false;
	const unsigned load_flags = PKG_LOAD_RDEPS|PKG_LOAD_FILES|PKG_LOAD_DIRS|
					PKG_LOAD_SCRIPTS|PKG_LOAD_ANNOTATIONS|PKG_LOAD_LUA_SCRIPTS;
-
	bool		head = true;

	assert(pkg != NULL);
	assert(db != NULL);
@@ -122,7 +121,6 @@ pkg_delete(struct pkg *pkg, struct pkgdb *db, unsigned flags)
					message = xstring_new();
					pkg_fprintf(message->fp, "Message from "
					    "%n-%v:\n", pkg, pkg);
-
					head = false;
				}
				fprintf(message->fp, "%s\n", msg->str);
			}
modified libpkg/pkg_manifest.c
@@ -878,7 +878,7 @@ pkg_parse_manifest_fileat(int dfd, struct pkg *pkg, const char *file,

	errno = 0;

-
	if ((rc = file_to_bufferat(dfd, file, &data, &sz)) != EPKG_OK)
+
	if (file_to_bufferat(dfd, file, &data, &sz) != EPKG_OK)
		return (EPKG_FATAL);

	p = ucl_parser_new(UCL_PARSER_NO_FILEVARS);
modified libpkg/pkg_repo_create.c
@@ -596,7 +596,7 @@ pkg_create_repo(char *path, const char *output_dir, bool filelist,
	char repodb[MAXPATHLEN];
	FILE *mandigests = NULL;

-
	outputdir_fd = mfd = ffd = -1;
+
	mfd = ffd = -1;

	if (!is_dir(path)) {
		pkg_emit_error("%s is not a directory", path);
@@ -796,7 +796,6 @@ pkg_create_repo(char *path, const char *output_dir, bool filelist,
	}

	pkg_emit_progress_tick(len, len);
-
	retcode = EPKG_OK;

	/* Now sort all digests */
	if (meta->version == 1)
modified libpkg/pkgdb_iterator.c
@@ -293,7 +293,7 @@ pkgdb_load_deps(sqlite3 *sqlite, struct pkg *pkg)
					/* Fetch matching packages */
					chain = NULL;

-
					while ((ret = sqlite3_step(stmt)) == SQLITE_ROW) {
+
					while (sqlite3_step(stmt) == SQLITE_ROW) {
						/*
						 * Load options for a package and check
						 * if they are compatible
@@ -311,8 +311,7 @@ pkgdb_load_deps(sqlite3 *sqlite, struct pkg *pkg)
							sqlite3_bind_int64(opt_stmt, 1,
									sqlite3_column_int64(stmt, 0));

-
							while ((ret = sqlite3_step(opt_stmt))
-
									== SQLITE_ROW) {
+
							while (sqlite3_step(opt_stmt) == SQLITE_ROW) {
								DL_FOREACH(fit->options, optit) {
									if(strcmp(optit->opt,
											sqlite3_column_text(opt_stmt, 0))
@@ -438,7 +437,7 @@ pkgdb_load_files(sqlite3 *sqlite, struct pkg *pkg)
	sqlite3_bind_int64(stmt, 1, pkg->id);
	pkg_debug(4, "Pkgdb: running '%s'", sqlite3_expanded_sql(stmt));

-
	while ((ret = sqlite3_step(stmt)) == SQLITE_ROW) {
+
	while (sqlite3_step(stmt) == SQLITE_ROW) {
		pkg_addfile(pkg, sqlite3_column_text(stmt, 0),
		    sqlite3_column_text(stmt, 1), false);
	}
modified src/stats.c
@@ -88,7 +88,7 @@ exec_stats(int argc, char **argv)
			return (EXIT_FAILURE);
		}
	}
-
	argv += optind;
+
	//argv += optind;

	/* default is to show everything we have */
	if (opt == 0)
modified src/triggers.c
@@ -59,7 +59,7 @@ exec_triggers(int argc, char **argv)
			return (EXIT_FAILURE);
		}
	}
-
	argv += optind;
+
	// argv += optind;

	pkg_execute_deferred_triggers();

modified src/which.c
@@ -74,7 +74,7 @@ exec_which(int argc, char **argv)
	struct pkg_file *file = NULL;
	char		 pathabs[MAXPATHLEN];
	char		*p, *path, *match, *savedpath;
-
	int		 ret = EPKG_OK, retcode = EXIT_FAILURE;
+
	int		 retcode = EXIT_FAILURE;
	int		 ch, res, pathlen = 0;
	size_t		 i;
	bool		 orig = false;
@@ -212,7 +212,7 @@ exec_which(int argc, char **argv)
			}

			pkg = NULL;
-
			while ((ret = pkgdb_it_next(it, &pkg, PKG_LOAD_FILES)) == EPKG_OK) {
+
			while (pkgdb_it_next(it, &pkg, PKG_LOAD_FILES) == EPKG_OK) {
				retcode = EXIT_SUCCESS;
				if (quiet && orig && !show_match)
					pkg_printf("%o\n", pkg);