Fix warnings detected by LTO.

This commit is contained in:
Juan RP 2020-04-23 08:32:54 +02:00
parent e7c1f411ec
commit 530e79c7ee
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368
5 changed files with 8 additions and 6 deletions

View File

@ -428,7 +428,7 @@ create_dot_graph(struct xbps_handle *xhp,
{ {
xbps_dictionary_t sub_confd; xbps_dictionary_t sub_confd;
xbps_array_t allkeys, rdeps; xbps_array_t allkeys, rdeps;
const char *pkgver, *cfprop; const char *pkgver = NULL, *cfprop;
xbps_dictionary_get_cstring_nocopy(plistd, "pkgver", &pkgver); xbps_dictionary_get_cstring_nocopy(plistd, "pkgver", &pkgver);

View File

@ -539,14 +539,16 @@ pkgdb_get_pkgs_cb(struct xbps_handle *xhp UNUSED,
void *arg, bool *done UNUSED) void *arg, bool *done UNUSED)
{ {
xbps_array_t *array = arg; xbps_array_t *array = arg;
const char *pkgname; const char *pkgname = NULL;
bool automatic = false; bool automatic = false;
xbps_dictionary_get_bool(obj, "automatic-install", &automatic); xbps_dictionary_get_bool(obj, "automatic-install", &automatic);
if (automatic) if (automatic)
return 0; return 0;
xbps_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname); if (!xbps_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname))
return EINVAL;
xbps_array_add_cstring_nocopy(*array, pkgname); xbps_array_add_cstring_nocopy(*array, pkgname);
return 0; return 0;
} }

View File

@ -494,7 +494,7 @@ remove_obsoletes(struct xbps_handle *xhp, const char *pkgname, const char *pkgve
for (unsigned int i = 0; i < xbps_array_count(allkeys); i++) { for (unsigned int i = 0; i < xbps_array_count(allkeys); i++) {
xbps_array_t array, array2, array_repo; xbps_array_t array, array2, array_repo;
xbps_object_t keysym; xbps_object_t keysym;
const char *keyname, *first; const char *keyname, *first = NULL;
keysym = xbps_array_get(allkeys, i); keysym = xbps_array_get(allkeys, i);
array = xbps_dictionary_get_keysym(pkgd_alts, keysym); array = xbps_dictionary_get_keysym(pkgd_alts, keysym);

View File

@ -114,7 +114,7 @@ xbps_find_pkg_orphans(struct xbps_handle *xhp, xbps_array_t orphans_user)
} }
/* verify all revdeps are seen */ /* verify all revdeps are seen */
for (unsigned int i = 0; i < revdepscnt; i++) { for (unsigned int i = 0; i < revdepscnt; i++) {
const char *revdepver; const char *revdepver = NULL;
xbps_array_get_cstring_nocopy(revdeps, i, &revdepver); xbps_array_get_cstring_nocopy(revdeps, i, &revdepver);
if (xbps_find_pkg_in_array(array, revdepver, 0)) if (xbps_find_pkg_in_array(array, revdepver, 0))

View File

@ -215,7 +215,7 @@ xbps_transaction_check_revdeps(struct xbps_handle *xhp, xbps_array_t pkgs)
} }
for (unsigned int j = 0; j < xbps_array_count(rundeps); j++) { for (unsigned int j = 0; j < xbps_array_count(rundeps); j++) {
const char *curdep; const char *curdep = NULL;
xbps_array_get_cstring_nocopy(rundeps, j, &curdep); xbps_array_get_cstring_nocopy(rundeps, j, &curdep);
if ((!xbps_pkgpattern_name(curdepname, sizeof(curdepname), curdep)) && if ((!xbps_pkgpattern_name(curdepname, sizeof(curdepname), curdep)) &&