Remove unnecessary variable assignments reported by cppcheck.

This commit is contained in:
Juan RP 2012-11-06 09:28:34 +01:00
parent c7402a9176
commit 310e619ea3
6 changed files with 5 additions and 7 deletions

View File

@ -98,7 +98,7 @@ main(int argc, char **argv)
rootdir = cachedir = conffile = defrepo = props = NULL;
flags = rv = c = 0;
list_pkgs = list_repos = orphans = search = own = false;
list_manual = show_prop = show_files = search = false;
list_manual = show_prop = show_files = false;
show = show_deps = show_rdeps = false;
repo_mode = opmode = false;

View File

@ -43,7 +43,7 @@
int
xbps_register_pkg(struct xbps_handle *xhp, prop_dictionary_t pkgrd, bool flush)
{
prop_dictionary_t pkgd = NULL;
prop_dictionary_t pkgd;
prop_array_t provides, reqby;
char outstr[64];
time_t t;

View File

@ -271,7 +271,7 @@ xbps_remove_pkg(struct xbps_handle *xhp,
bool soft_replace)
{
prop_dictionary_t pkgd = NULL;
char *tmpname = NULL, *buf = NULL, *pkgver = NULL;
char *tmpname, *buf, *pkgver = NULL;
const char *tmpver = NULL;
int rv = 0;
bool rmfile_exists = false;

View File

@ -691,7 +691,7 @@ xbps_unpack_binary_pkg(struct xbps_handle *xhp, prop_dictionary_t pkg_repod)
{
struct archive *ar = NULL;
const char *pkgname, *version, *repoloc, *pkgver, *fname;
char *bpkg = NULL;
char *bpkg;
int rv = 0;
assert(prop_object_type(pkg_repod) == PROP_TYPE_DICTIONARY);

View File

@ -122,7 +122,7 @@ xbps_dictionary_from_archive_entry(struct archive *ar,
struct archive_entry *entry)
{
prop_dictionary_t d = NULL;
size_t buflen = 0;
size_t buflen;
ssize_t nbytes = -1;
char *buf, *uncomp_buf;

View File

@ -149,8 +149,6 @@ xbps_file_hash_dictionary(prop_dictionary_t d,
assert(key != NULL);
assert(file != NULL);
curfile = sha256 = NULL;
iter = xbps_array_iter_from_dict(d, key);
if (iter == NULL) {
errno = ENOENT;