Added LTO support and fix warnings (maybe-uninitialized).
This commit is contained in:
@@ -45,7 +45,7 @@ list_pkgs_in_dict(struct xbps_handle *xhp UNUSED,
|
||||
bool *loop_done UNUSED)
|
||||
{
|
||||
struct list_pkgver_cb *lpc = arg;
|
||||
const char *pkgver, *short_desc, *state_str;
|
||||
const char *pkgver = NULL, *short_desc = NULL, *state_str = NULL;
|
||||
char tmp[255], *out = NULL;
|
||||
int i, len = 0;
|
||||
pkg_state_t state;
|
||||
@@ -94,7 +94,7 @@ list_manual_pkgs(struct xbps_handle *xhp UNUSED,
|
||||
void *arg UNUSED,
|
||||
bool *loop_done UNUSED)
|
||||
{
|
||||
const char *pkgver;
|
||||
const char *pkgver = NULL;
|
||||
bool automatic = false;
|
||||
|
||||
xbps_dictionary_get_bool(obj, "automatic-install", &automatic);
|
||||
@@ -113,7 +113,7 @@ list_hold_pkgs(struct xbps_handle *xhp UNUSED,
|
||||
void *arg UNUSED,
|
||||
bool *loop_done UNUSED)
|
||||
{
|
||||
const char *pkgver;
|
||||
const char *pkgver = NULL;
|
||||
|
||||
if (xbps_dictionary_get(obj, "hold")) {
|
||||
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
||||
@@ -130,7 +130,7 @@ list_repolock_pkgs(struct xbps_handle *xhp UNUSED,
|
||||
void *arg UNUSED,
|
||||
bool *loop_done UNUSED)
|
||||
{
|
||||
const char *pkgver;
|
||||
const char *pkgver = NULL;
|
||||
|
||||
if (xbps_dictionary_get(obj, "repolock")) {
|
||||
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
||||
@@ -144,7 +144,7 @@ int
|
||||
list_orphans(struct xbps_handle *xhp)
|
||||
{
|
||||
xbps_array_t orphans;
|
||||
const char *pkgver;
|
||||
const char *pkgver = NULL;
|
||||
|
||||
orphans = xbps_find_pkg_orphans(xhp, NULL);
|
||||
if (orphans == NULL)
|
||||
@@ -226,7 +226,7 @@ _find_longest_pkgver_cb(struct xbps_handle *xhp UNUSED,
|
||||
bool *loop_done UNUSED)
|
||||
{
|
||||
struct fflongest *ffl = arg;
|
||||
const char *pkgver;
|
||||
const char *pkgver = NULL;
|
||||
unsigned int len;
|
||||
|
||||
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
||||
|
@@ -51,7 +51,7 @@ match_files_by_pattern(xbps_dictionary_t pkg_filesd,
|
||||
const char *pkgver)
|
||||
{
|
||||
xbps_array_t array;
|
||||
const char *keyname, *typestr;
|
||||
const char *keyname = NULL, *typestr = NULL;
|
||||
|
||||
keyname = xbps_dictionary_keysym_cstring_nocopy(key);
|
||||
|
||||
@@ -104,7 +104,7 @@ ownedby_pkgdb_cb(struct xbps_handle *xhp,
|
||||
xbps_dictionary_t pkgmetad;
|
||||
xbps_array_t files_keys;
|
||||
struct ffdata *ffd = arg;
|
||||
const char *pkgver;
|
||||
const char *pkgver = NULL;
|
||||
|
||||
(void)obj_key;
|
||||
(void)done;
|
||||
@@ -136,7 +136,7 @@ repo_match_cb(struct xbps_handle *xhp,
|
||||
xbps_dictionary_t filesd;
|
||||
xbps_array_t files_keys;
|
||||
struct ffdata *ffd = arg;
|
||||
const char *pkgver;
|
||||
const char *pkgver = NULL;
|
||||
char *bfile;
|
||||
|
||||
xbps_dictionary_set_cstring_nocopy(obj, "repository", ffd->repouri);
|
||||
|
@@ -54,7 +54,7 @@ struct search_data {
|
||||
static void
|
||||
print_results(struct xbps_handle *xhp, struct search_data *sd)
|
||||
{
|
||||
const char *pkgver, *desc, *inststr;
|
||||
const char *pkgver = NULL, *desc = NULL, *inststr = NULL;
|
||||
char tmp[256], *out;
|
||||
unsigned int j, tlen = 0, len = 0;
|
||||
|
||||
@@ -102,7 +102,7 @@ search_array_cb(struct xbps_handle *xhp UNUSED,
|
||||
{
|
||||
xbps_object_t obj2;
|
||||
struct search_data *sd = arg;
|
||||
const char *pkgver = NULL, *desc, *str;
|
||||
const char *pkgver = NULL, *desc = NULL, *str = NULL;
|
||||
|
||||
if (!xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver))
|
||||
return 0;
|
||||
|
@@ -59,7 +59,7 @@ show_pkg_deps(struct xbps_handle *xhp, const char *pkgname, bool repomode, bool
|
||||
rdeps = xbps_dictionary_get(pkgd, "run_depends");
|
||||
}
|
||||
for (unsigned int i = 0; i < xbps_array_count(rdeps); i++) {
|
||||
const char *pkgdep;
|
||||
const char *pkgdep = NULL;
|
||||
xbps_array_get_cstring_nocopy(rdeps, i, &pkgdep);
|
||||
printf("%s\n", pkgdep);
|
||||
}
|
||||
@@ -70,7 +70,7 @@ int
|
||||
show_pkg_revdeps(struct xbps_handle *xhp, const char *pkg, bool repomode)
|
||||
{
|
||||
xbps_array_t revdeps;
|
||||
const char *pkgdep;
|
||||
const char *pkgdep = NULL;
|
||||
|
||||
if (repomode)
|
||||
revdeps = xbps_rpool_get_pkg_revdeps(xhp, pkg);
|
||||
|
@@ -209,7 +209,7 @@ show_pkg_files(xbps_dictionary_t filesd)
|
||||
xbps_array_t array, allkeys;
|
||||
xbps_object_t obj;
|
||||
xbps_dictionary_keysym_t ksym;
|
||||
const char *keyname, *file;
|
||||
const char *keyname = NULL, *file = NULL;
|
||||
|
||||
if (xbps_object_type(filesd) != XBPS_TYPE_DICTIONARY)
|
||||
return EINVAL;
|
||||
|
Reference in New Issue
Block a user