Relax memory requirements on 64bit platforms; fix two memleaks.

This commit is contained in:
Juan RP 2013-06-12 10:04:10 +02:00
parent 6a9e394a60
commit db1efb3aa6
33 changed files with 83 additions and 74 deletions

View File

@ -37,8 +37,8 @@ struct xferstat {
/* from transaction.c */ /* from transaction.c */
int install_new_pkg(struct xbps_handle *, const char *, bool); int install_new_pkg(struct xbps_handle *, const char *, bool);
int update_pkg(struct xbps_handle *, const char *); int update_pkg(struct xbps_handle *, const char *);
int dist_upgrade(struct xbps_handle *, size_t, bool, bool); int dist_upgrade(struct xbps_handle *, int, bool, bool);
int exec_transaction(struct xbps_handle *, size_t, bool, bool); int exec_transaction(struct xbps_handle *, int, bool, bool);
/* from question.c */ /* from question.c */
bool yesno(const char *, ...); bool yesno(const char *, ...);
@ -51,7 +51,7 @@ void fetch_file_progress_cb(struct xbps_fetch_cb_data *, void *);
void state_cb(struct xbps_state_cb_data *, void *); void state_cb(struct xbps_state_cb_data *, void *);
/* From util.c */ /* From util.c */
void print_package_line(const char *, size_t, bool); void print_package_line(const char *, int, bool);
size_t get_maxcols(void); int get_maxcols(void);
#endif /* !_XBPS_INSTALL_DEFS_H_ */ #endif /* !_XBPS_INSTALL_DEFS_H_ */

View File

@ -102,7 +102,7 @@ main(int argc, char **argv)
const char *rootdir, *cachedir, *conffile, *defrepo; const char *rootdir, *cachedir, *conffile, *defrepo;
int i, c, flags, rv, fflag = 0; int i, c, flags, rv, fflag = 0;
bool sync, yes, reinstall, drun, update; bool sync, yes, reinstall, drun, update;
size_t maxcols; int maxcols;
rootdir = cachedir = conffile = defrepo = NULL; rootdir = cachedir = conffile = defrepo = NULL;
flags = rv = 0; flags = rv = 0;

View File

@ -48,7 +48,7 @@ struct transaction {
static void static void
show_missing_deps(prop_array_t a) show_missing_deps(prop_array_t a)
{ {
size_t i; unsigned int i;
const char *str; const char *str;
fprintf(stderr, "Unable to locate some required packages:\n"); fprintf(stderr, "Unable to locate some required packages:\n");
@ -61,7 +61,7 @@ show_missing_deps(prop_array_t a)
static void static void
show_conflicts(prop_array_t a) show_conflicts(prop_array_t a)
{ {
size_t i; unsigned int i;
const char *str; const char *str;
fprintf(stderr, "Conflicting packages were found:\n"); fprintf(stderr, "Conflicting packages were found:\n");
@ -93,7 +93,7 @@ show_actions(prop_object_iterator_t iter)
} }
static void static void
show_package_list(prop_object_iterator_t iter, const char *match, size_t cols) show_package_list(prop_object_iterator_t iter, const char *match, int cols)
{ {
prop_object_t obj; prop_object_t obj;
const char *pkgver, *tract; const char *pkgver, *tract;
@ -110,7 +110,7 @@ show_package_list(prop_object_iterator_t iter, const char *match, size_t cols)
} }
static int static int
show_transaction_sizes(struct transaction *trans, size_t cols) show_transaction_sizes(struct transaction *trans, int cols)
{ {
uint64_t dlsize = 0, instsize = 0, rmsize = 0; uint64_t dlsize = 0, instsize = 0, rmsize = 0;
char size[8]; char size[8];
@ -186,7 +186,7 @@ show_transaction_sizes(struct transaction *trans, size_t cols)
} }
int int
dist_upgrade(struct xbps_handle *xhp, size_t cols, bool yes, bool drun) dist_upgrade(struct xbps_handle *xhp, int cols, bool yes, bool drun)
{ {
int rv = 0; int rv = 0;
@ -256,7 +256,7 @@ update_pkg(struct xbps_handle *xhp, const char *pkgname)
} }
int int
exec_transaction(struct xbps_handle *xhp, size_t maxcols, bool yes, bool drun) exec_transaction(struct xbps_handle *xhp, int maxcols, bool yes, bool drun)
{ {
prop_array_t mdeps, cflicts; prop_array_t mdeps, cflicts;
struct transaction *trans; struct transaction *trans;

View File

@ -35,7 +35,7 @@
#include <xbps_api.h> #include <xbps_api.h>
#include "defs.h" #include "defs.h"
size_t int
get_maxcols(void) get_maxcols(void)
{ {
struct winsize ws; struct winsize ws;
@ -47,9 +47,9 @@ get_maxcols(void)
} }
void void
print_package_line(const char *str, size_t maxcols, bool reset) print_package_line(const char *str, int maxcols, bool reset)
{ {
static size_t cols; static int cols;
static bool first; static bool first;
if (reset) { if (reset) {

View File

@ -49,7 +49,7 @@ check_pkg_rundeps(struct xbps_handle *xhp, const char *pkgname, void *arg)
{ {
prop_dictionary_t pkg_propsd = arg; prop_dictionary_t pkg_propsd = arg;
prop_array_t array; prop_array_t array;
size_t i; unsigned int i;
const char *reqpkg; const char *reqpkg;
bool test_broken = false; bool test_broken = false;

View File

@ -77,7 +77,7 @@ check_pkg_symlinks(struct xbps_handle *xhp, const char *pkgname, void *arg)
prop_array_t array; prop_array_t array;
prop_object_t obj; prop_object_t obj;
prop_dictionary_t filesd = arg; prop_dictionary_t filesd = arg;
size_t i; unsigned int i;
const char *file, *tgt = NULL; const char *file, *tgt = NULL;
char *path, *p, *buf, *buf2, *lnk, *dname, *tgt_path; char *path, *p, *buf, *buf2, *lnk, *dname, *tgt_path;
int rv; int rv;

View File

@ -46,7 +46,7 @@ pkgdb_format_021(struct xbps_handle *xhp, const char *plist_new)
{ {
prop_array_t array, rdeps; prop_array_t array, rdeps;
prop_dictionary_t pkgdb, pkgd; prop_dictionary_t pkgdb, pkgd;
size_t i; unsigned int i;
char *pkgname, *plist; char *pkgname, *plist;
plist = xbps_xasprintf("%s/pkgdb.plist", xhp->metadir); plist = xbps_xasprintf("%s/pkgdb.plist", xhp->metadir);

View File

@ -55,8 +55,8 @@ int ownedby(struct xbps_handle *, int, char **);
int repo_ownedby(struct xbps_handle *, int, char **); int repo_ownedby(struct xbps_handle *, int, char **);
/* From list.c */ /* From list.c */
size_t get_maxcols(void); int get_maxcols(void);
size_t find_longest_pkgver(struct xbps_handle *, prop_object_t); unsigned int find_longest_pkgver(struct xbps_handle *, prop_object_t);
int list_pkgs_in_dict(struct xbps_handle *, prop_object_t, void *, bool *); int list_pkgs_in_dict(struct xbps_handle *, prop_object_t, void *, bool *);
int list_manual_pkgs(struct xbps_handle *, prop_object_t, void *, bool *); int list_manual_pkgs(struct xbps_handle *, prop_object_t, void *, bool *);

View File

@ -34,11 +34,11 @@
#include "defs.h" #include "defs.h"
struct list_pkgver_cb { struct list_pkgver_cb {
size_t pkgver_len; int pkgver_len;
size_t maxcols; int maxcols;
}; };
size_t int
get_maxcols(void) get_maxcols(void)
{ {
struct winsize ws; struct winsize ws;
@ -58,7 +58,7 @@ list_pkgs_in_dict(struct xbps_handle *xhp,
struct list_pkgver_cb *lpc = arg; struct list_pkgver_cb *lpc = arg;
const char *pkgver, *short_desc, *state_str; const char *pkgver, *short_desc, *state_str;
char tmp[255], *out = NULL; char tmp[255], *out = NULL;
size_t i, len = 0; int i, len = 0;
pkg_state_t state; pkg_state_t state;
(void)xhp; (void)xhp;
@ -167,8 +167,8 @@ repo_list_uri_cb(struct xbps_repo *repo, void *arg, bool *done)
(void)arg; (void)arg;
(void)done; (void)done;
printf("%s (%zu packages)\n", repo->uri, printf("%s (%u packages)\n", repo->uri,
(size_t)prop_dictionary_count(repo->idx)); prop_dictionary_count(repo->idx));
return 0; return 0;
} }
@ -189,7 +189,7 @@ repo_list(struct xbps_handle *xhp)
struct fflongest { struct fflongest {
prop_dictionary_t d; prop_dictionary_t d;
size_t len; unsigned int len;
}; };
static int static int
@ -201,7 +201,7 @@ _find_longest_pkgver_cb(struct xbps_handle *xhp,
struct fflongest *ffl = arg; struct fflongest *ffl = arg;
prop_dictionary_t pkgd; prop_dictionary_t pkgd;
const char *pkgver; const char *pkgver;
size_t len; unsigned int len;
(void)xhp; (void)xhp;
(void)loop_done; (void)loop_done;
@ -219,7 +219,7 @@ _find_longest_pkgver_cb(struct xbps_handle *xhp,
return 0; return 0;
} }
size_t unsigned int
find_longest_pkgver(struct xbps_handle *xhp, prop_object_t o) find_longest_pkgver(struct xbps_handle *xhp, prop_object_t o)
{ {
struct fflongest ffl; struct fflongest ffl;

View File

@ -128,7 +128,7 @@ repo_match_files_by_pattern(prop_array_t files,
struct ffdata *ffd) struct ffdata *ffd)
{ {
const char *filestr; const char *filestr;
size_t i; unsigned int i;
int x; int x;
for (i = 0; i < prop_array_count(files); i++) { for (i = 0; i < prop_array_count(files); i++) {

View File

@ -47,7 +47,7 @@
struct search_data { struct search_data {
int npatterns; int npatterns;
char **patterns; char **patterns;
size_t maxcols; int maxcols;
prop_array_t results; prop_array_t results;
}; };
@ -56,7 +56,7 @@ print_results(struct xbps_handle *xhp, struct search_data *sd)
{ {
const char *pkgver, *desc, *inststr; const char *pkgver, *desc, *inststr;
char tmp[256], *out; char tmp[256], *out;
size_t i, j, tlen = 0, len = 0; unsigned int i, j, tlen = 0, len = 0;
/* Iterate over results array and find out largest pkgver string */ /* Iterate over results array and find out largest pkgver string */
for (i = 0; i < prop_array_count(sd->results); i++) { for (i = 0; i < prop_array_count(sd->results); i++) {
@ -80,7 +80,7 @@ print_results(struct xbps_handle *xhp, struct search_data *sd)
inststr = "[-]"; inststr = "[-]";
len = strlen(inststr) + strlen(tmp) + strlen(desc) + 3; len = strlen(inststr) + strlen(tmp) + strlen(desc) + 3;
if (len > sd->maxcols) { if ((int)len > sd->maxcols) {
out = malloc(sd->maxcols+1); out = malloc(sd->maxcols+1);
assert(out); assert(out);
snprintf(out, sd->maxcols-3, "%s %s %s", snprintf(out, sd->maxcols-3, "%s %s %s",
@ -103,7 +103,7 @@ search_pkgs_cb(struct xbps_repo *repo, void *arg, bool *done)
prop_dictionary_keysym_t ksym; prop_dictionary_keysym_t ksym;
struct search_data *sd = arg; struct search_data *sd = arg;
const char *pkgver, *desc; const char *pkgver, *desc;
size_t i; unsigned int i;
int x; int x;
(void)done; (void)done;
@ -120,7 +120,7 @@ search_pkgs_cb(struct xbps_repo *repo, void *arg, bool *done)
provides = prop_dictionary_get(pkgd, "provides"); provides = prop_dictionary_get(pkgd, "provides");
for (x = 0; x < sd->npatterns; x++) { for (x = 0; x < sd->npatterns; x++) {
size_t j; unsigned int j;
bool vpkgfound = false; bool vpkgfound = false;
for (j = 0; j < prop_array_count(provides); j++) { for (j = 0; j < prop_array_count(provides); j++) {

View File

@ -40,7 +40,7 @@ print_rdeps(struct xbps_handle *xhp, prop_array_t rdeps,
prop_array_t currdeps; prop_array_t currdeps;
prop_dictionary_t pkgd; prop_dictionary_t pkgd;
const char *pkgdep; const char *pkgdep;
size_t i; unsigned int i;
int j; int j;
if (!origin) if (!origin)
@ -98,7 +98,7 @@ show_pkg_revdeps(struct xbps_handle *xhp, const char *pkg)
{ {
prop_array_t reqby; prop_array_t reqby;
const char *pkgdep; const char *pkgdep;
size_t i; unsigned int i;
if ((reqby = xbps_pkgdb_get_pkg_revdeps(xhp, pkg)) != NULL) { if ((reqby = xbps_pkgdb_get_pkg_revdeps(xhp, pkg)) != NULL) {
for (i = 0; i < prop_array_count(reqby); i++) { for (i = 0; i < prop_array_count(reqby); i++) {

View File

@ -43,7 +43,7 @@ print_value_obj(const char *keyname, prop_object_t obj,
prop_array_t allkeys; prop_array_t allkeys;
prop_object_t obj2, keysym; prop_object_t obj2, keysym;
const char *ksymname, *value; const char *ksymname, *value;
size_t i; unsigned int i;
char size[8]; char size[8];
if (indent == NULL) if (indent == NULL)
@ -151,7 +151,7 @@ static void
print_srcrevs(const char *keyname, prop_string_t obj) print_srcrevs(const char *keyname, prop_string_t obj)
{ {
const char *str = prop_string_cstring_nocopy(obj); const char *str = prop_string_cstring_nocopy(obj);
size_t i; unsigned int i;
/* parse string appending a \t after EOL */ /* parse string appending a \t after EOL */
printf("%s:\n ", keyname); printf("%s:\n ", keyname);
@ -170,7 +170,7 @@ show_pkg_info(prop_dictionary_t dict)
prop_array_t all_keys; prop_array_t all_keys;
prop_object_t obj, keysym; prop_object_t obj, keysym;
const char *keyname; const char *keyname;
size_t i; unsigned int i;
all_keys = prop_dictionary_all_keys(dict); all_keys = prop_dictionary_all_keys(dict);
for (i = 0; i < prop_array_count(all_keys); i++) { for (i = 0; i < prop_array_count(all_keys); i++) {
@ -201,7 +201,7 @@ show_pkg_files(prop_dictionary_t filesd)
prop_object_t obj; prop_object_t obj;
prop_dictionary_keysym_t ksym; prop_dictionary_keysym_t ksym;
const char *keyname, *file; const char *keyname, *file;
size_t i, x; unsigned int i, x;
if (prop_object_type(filesd) != PROP_TYPE_DICTIONARY) if (prop_object_type(filesd) != PROP_TYPE_DICTIONARY)
return EINVAL; return EINVAL;

View File

@ -183,12 +183,12 @@ cachedir_clean(struct xbps_handle *xhp)
} }
static int static int
remove_pkg(struct xbps_handle *xhp, const char *pkgname, size_t cols, remove_pkg(struct xbps_handle *xhp, const char *pkgname, int cols,
bool recursive) bool recursive)
{ {
prop_array_t reqby; prop_array_t reqby;
const char *pkgver; const char *pkgver;
size_t x; unsigned int x;
int rv; int rv;
rv = xbps_transaction_remove_pkg(xhp, pkgname, recursive); rv = xbps_transaction_remove_pkg(xhp, pkgname, recursive);
@ -243,7 +243,7 @@ main(int argc, char **argv)
int i, c, flags, rv; int i, c, flags, rv;
bool yes, drun, recursive, ignore_revdeps, clean_cache; bool yes, drun, recursive, ignore_revdeps, clean_cache;
bool orphans, reqby_force; bool orphans, reqby_force;
size_t maxcols; int maxcols;
rootdir = cachedir = conffile = NULL; rootdir = cachedir = conffile = NULL;
flags = rv = 0; flags = rv = 0;

View File

@ -54,7 +54,7 @@ index_add(struct xbps_handle *xhp, int argc, char **argv, bool force)
const char *oldpkgver, *arch, *oldarch; const char *oldpkgver, *arch, *oldarch;
char *pkgver, *pkgname, *sha256, *repodir, *buf; char *pkgver, *pkgname, *sha256, *repodir, *buf;
char *tmprepodir; char *tmprepodir;
size_t x; unsigned int x;
int i, rv, ret = 0; int i, rv, ret = 0;
bool flush = false, found = false; bool flush = false, found = false;

View File

@ -143,7 +143,7 @@ index_clean(struct xbps_handle *xhp, const char *repodir)
prop_dictionary_t idx, idxfiles; prop_dictionary_t idx, idxfiles;
const char *keyname; const char *keyname;
char *pkgname; char *pkgname;
size_t x, pkgcount, slicecount; unsigned int x, pkgcount, slicecount;
int i, maxthreads, rv = 0; int i, maxthreads, rv = 0;
bool flush = false; bool flush = false;

View File

@ -138,7 +138,7 @@ remove_obsoletes(struct xbps_handle *xhp, const char *repodir)
struct dirent *dp; struct dirent *dp;
char *ext; char *ext;
int i, maxthreads, rv = 0; int i, maxthreads, rv = 0;
size_t slicecount, pkgcount; unsigned int slicecount, pkgcount;
repo = xbps_repo_open(xhp, repodir); repo = xbps_repo_open(xhp, repodir);
if (repo == NULL) { if (repo == NULL) {

View File

@ -39,7 +39,7 @@ xbps_entry_is_a_conf_file(prop_dictionary_t propsd,
{ {
prop_array_t array; prop_array_t array;
const char *cffile; const char *cffile;
size_t i; unsigned int i;
assert(prop_object_type(propsd) == PROP_TYPE_DICTIONARY); assert(prop_object_type(propsd) == PROP_TYPE_DICTIONARY);
assert(entry_pname != NULL); assert(entry_pname != NULL);

View File

@ -37,7 +37,7 @@ merge_filelist(prop_dictionary_t d)
{ {
prop_array_t a, result; prop_array_t a, result;
prop_dictionary_t filed; prop_dictionary_t filed;
size_t i; unsigned int i;
result = prop_array_create(); result = prop_array_create();
assert(result); assert(result);
@ -78,7 +78,7 @@ xbps_find_pkg_obsoletes(struct xbps_handle *xhp,
prop_array_t instfiles, newfiles, obsoletes; prop_array_t instfiles, newfiles, obsoletes;
prop_object_t obj, obj2; prop_object_t obj, obj2;
prop_string_t oldstr, newstr; prop_string_t oldstr, newstr;
size_t i, x; unsigned int i, x;
const char *oldhash; const char *oldhash;
char *file; char *file;
int rv = 0; int rv = 0;

View File

@ -68,7 +68,7 @@ xbps_find_pkg_orphans(struct xbps_handle *xhp, prop_array_t orphans_user)
prop_object_iterator_t iter; prop_object_iterator_t iter;
const char *curpkgver, *deppkgver, *reqbydep; const char *curpkgver, *deppkgver, *reqbydep;
bool automatic = false; bool automatic = false;
size_t i, x, j, cnt, reqbycnt; unsigned int i, x, j, cnt, reqbycnt;
(void)orphans_user; (void)orphans_user;

View File

@ -115,7 +115,10 @@ xbps_pkg_exec_script(struct xbps_handle *xhp,
bool update) bool update)
{ {
prop_data_t data; prop_data_t data;
void *buf;
size_t buflen;
const char *pkgver; const char *pkgver;
int rv;
assert(xhp); assert(xhp);
assert(d); assert(d);
@ -128,6 +131,10 @@ xbps_pkg_exec_script(struct xbps_handle *xhp,
prop_dictionary_get_cstring_nocopy(d, "pkgver", &pkgver); prop_dictionary_get_cstring_nocopy(d, "pkgver", &pkgver);
return xbps_pkg_exec_buffer(xhp, prop_data_data(data), buf = prop_data_data(data);
prop_data_size(data), pkgver, action, update); buflen = prop_data_size(data);
rv = xbps_pkg_exec_buffer(xhp, buf, buflen, pkgver, action, update);
free(buf);
return rv;
} }

View File

@ -166,6 +166,7 @@ xbps_set_pkg_state_installed(struct xbps_handle *xhp,
return EINVAL; return EINVAL;
} }
free(pkgname); free(pkgname);
prop_object_release(pkgd);
} else { } else {
if ((rv = set_new_state(pkgd, state)) != 0) if ((rv = set_new_state(pkgd, state)) != 0)
return rv; return rv;

View File

@ -57,7 +57,7 @@ find_pkg_symlink_target(prop_dictionary_t d, const char *file)
{ {
prop_array_t links; prop_array_t links;
prop_object_t obj; prop_object_t obj;
size_t i; unsigned int i;
const char *pkgfile, *tgt = NULL; const char *pkgfile, *tgt = NULL;
char *rfile; char *rfile;
@ -147,6 +147,7 @@ create_pkg_metaplist(struct xbps_handle *xhp, const char *pkgname, const char *p
pkgver, buf, strerror(errno)); pkgver, buf, strerror(errno));
} }
free(buf); free(buf);
prop_object_release(pkg_metad);
return rv; return rv;
} }

View File

@ -143,7 +143,7 @@ xbps_pkgdb_foreach_reverse_cb(struct xbps_handle *xhp,
prop_array_t allkeys; prop_array_t allkeys;
prop_object_t obj; prop_object_t obj;
prop_dictionary_t pkgd; prop_dictionary_t pkgd;
size_t i; unsigned int i;
int rv; int rv;
bool done = false; bool done = false;

View File

@ -110,7 +110,7 @@ xbps_callback_array_iter_in_dict(struct xbps_handle *xhp,
{ {
prop_object_t obj; prop_object_t obj;
prop_array_t array; prop_array_t array;
size_t i; unsigned int i;
int rv = 0; int rv = 0;
bool cbloop_done = false; bool cbloop_done = false;
@ -212,7 +212,7 @@ array_replace_dict(prop_array_t array,
bool bypattern) bool bypattern)
{ {
prop_object_t obj; prop_object_t obj;
size_t i; unsigned int i;
const char *curpkgver; const char *curpkgver;
char *curpkgname; char *curpkgname;

View File

@ -183,7 +183,7 @@ vpkg_user_conf(struct xbps_handle *xhp,
{ {
const char *vpkgver, *pkg = NULL; const char *vpkgver, *pkg = NULL;
char *vpkgname = NULL, *tmp; char *vpkgname = NULL, *tmp;
size_t i, j, cnt; unsigned int i, j, cnt;
if (xhp->cfg == NULL) if (xhp->cfg == NULL)
return NULL; return NULL;

View File

@ -38,7 +38,7 @@ remove_obj_from_array(prop_array_t array, const char *str, int mode)
prop_object_t obj; prop_object_t obj;
const char *curname, *pkgdep; const char *curname, *pkgdep;
char *curpkgname; char *curpkgname;
size_t idx = 0; unsigned int idx = 0;
bool found = false; bool found = false;
assert(prop_object_type(array) == PROP_TYPE_ARRAY); assert(prop_object_type(array) == PROP_TYPE_ARRAY);

View File

@ -64,7 +64,7 @@ add_missing_reqdep(struct xbps_handle *xhp, const char *reqpkg)
prop_string_t reqpkg_str; prop_string_t reqpkg_str;
prop_object_iterator_t iter = NULL; prop_object_iterator_t iter = NULL;
prop_object_t obj; prop_object_t obj;
size_t idx = 0; unsigned int idx = 0;
bool add_pkgdep, pkgfound, update_pkgdep; bool add_pkgdep, pkgfound, update_pkgdep;
int rv = 0; int rv = 0;
@ -150,14 +150,14 @@ find_repo_deps(struct xbps_handle *xhp,
prop_array_t unsorted, /* array of unsorted deps */ prop_array_t unsorted, /* array of unsorted deps */
prop_array_t pkg_rdeps_array, /* current pkg rundeps array */ prop_array_t pkg_rdeps_array, /* current pkg rundeps array */
const char *curpkg, /* current pkgver */ const char *curpkg, /* current pkgver */
size_t *depth) /* max recursion depth */ unsigned short *depth) /* max recursion depth */
{ {
prop_dictionary_t curpkgd, tmpd; prop_dictionary_t curpkgd, tmpd;
prop_object_t obj; prop_object_t obj;
prop_object_iterator_t iter; prop_object_iterator_t iter;
prop_array_t curpkgrdeps; prop_array_t curpkgrdeps;
pkg_state_t state; pkg_state_t state;
size_t x; unsigned int x;
const char *reqpkg, *pkgver_q, *reason = NULL; const char *reqpkg, *pkgver_q, *reason = NULL;
char *pkgname, *reqpkgname; char *pkgname, *reqpkgname;
int rv = 0; int rv = 0;
@ -389,7 +389,7 @@ xbps_repository_find_deps(struct xbps_handle *xhp,
{ {
prop_array_t pkg_rdeps; prop_array_t pkg_rdeps;
const char *pkgver; const char *pkgver;
size_t depth = 0; unsigned short depth = 0;
pkg_rdeps = prop_dictionary_get(repo_pkgd, "run_depends"); pkg_rdeps = prop_dictionary_get(repo_pkgd, "run_depends");
if (prop_object_type(pkg_rdeps) != PROP_TYPE_ARRAY) if (prop_object_type(pkg_rdeps) != PROP_TYPE_ARRAY)

View File

@ -119,7 +119,7 @@ int
xbps_rpool_sync(struct xbps_handle *xhp, const char *uri) xbps_rpool_sync(struct xbps_handle *xhp, const char *uri)
{ {
const char *repouri; const char *repouri;
size_t i; unsigned int i;
if (xhp->cfg == NULL) if (xhp->cfg == NULL)
return ENOTSUP; return ENOTSUP;

View File

@ -193,7 +193,7 @@ xbps_transaction_update_packages(struct xbps_handle *xhp)
char *pkgname; char *pkgname;
bool foundhold = false, newpkg_found = false; bool foundhold = false, newpkg_found = false;
int rv = 0; int rv = 0;
size_t x; unsigned int x;
if ((rv = xbps_pkgdb_init(xhp)) != 0) if ((rv = xbps_pkgdb_init(xhp)) != 0)
return rv; return rv;
@ -273,7 +273,7 @@ xbps_transaction_remove_pkg(struct xbps_handle *xhp,
prop_array_t unsorted, orphans, orphans_pkg, reqby; prop_array_t unsorted, orphans, orphans_pkg, reqby;
prop_object_t obj; prop_object_t obj;
const char *pkgver; const char *pkgver;
size_t count; unsigned int count;
int rv = 0; int rv = 0;
assert(pkgname != NULL); assert(pkgname != NULL);
@ -351,7 +351,7 @@ xbps_transaction_autoremove_pkgs(struct xbps_handle *xhp)
prop_array_t orphans, unsorted; prop_array_t orphans, unsorted;
prop_object_t obj; prop_object_t obj;
const char *pkgver; const char *pkgver;
size_t count; unsigned int count;
int rv = 0; int rv = 0;
orphans = xbps_find_pkg_orphans(xhp, NULL); orphans = xbps_find_pkg_orphans(xhp, NULL);

View File

@ -43,7 +43,7 @@ xbps_transaction_package_replace(struct xbps_handle *xhp)
const char *pattern, *pkgver, *curpkgver; const char *pattern, *pkgver, *curpkgver;
char *buf, *pkgname, *curpkgname; char *buf, *pkgname, *curpkgname;
bool instd_auto, sr; bool instd_auto, sr;
size_t i; unsigned int i;
unsorted = prop_dictionary_get(xhp->transd, "unsorted_deps"); unsorted = prop_dictionary_get(xhp->transd, "unsorted_deps");

View File

@ -87,11 +87,11 @@ pkgdep_find(const char *pkg)
return NULL; return NULL;
} }
static ssize_t static int32_t
pkgdep_find_idx(const char *pkg) pkgdep_find_idx(const char *pkg)
{ {
struct pkgdep *pd, *pd_new; struct pkgdep *pd, *pd_new;
ssize_t idx = 0; int32_t idx = 0;
const char *pkgver, *tract; const char *pkgver, *tract;
TAILQ_FOREACH_SAFE(pd, &pkgdep_list, pkgdep_entries, pd_new) { TAILQ_FOREACH_SAFE(pd, &pkgdep_list, pkgdep_entries, pd_new) {
@ -167,8 +167,8 @@ sort_pkg_rundeps(struct xbps_handle *xhp,
prop_dictionary_t curpkgd; prop_dictionary_t curpkgd;
struct pkgdep *lpd, *pdn; struct pkgdep *lpd, *pdn;
const char *str, *tract; const char *str, *tract;
ssize_t pkgdepidx, curpkgidx; int32_t pkgdepidx, curpkgidx;
size_t i, idx = 0; uint32_t i, idx = 0;
int rv = 0; int rv = 0;
xbps_dbg_printf_append(xhp, "\n"); xbps_dbg_printf_append(xhp, "\n");
@ -258,7 +258,7 @@ xbps_transaction_sort(struct xbps_handle *xhp)
prop_array_t provides, sorted, unsorted, rundeps; prop_array_t provides, sorted, unsorted, rundeps;
prop_object_t obj; prop_object_t obj;
struct pkgdep *pd; struct pkgdep *pd;
size_t i, j, ndeps = 0, cnt = 0; unsigned int i, j, ndeps = 0, cnt = 0;
const char *pkgname, *pkgver, *tract, *vpkgdep; const char *pkgname, *pkgver, *tract, *vpkgdep;
int rv = 0; int rv = 0;
bool vpkg_found; bool vpkg_found;

View File

@ -121,7 +121,7 @@ xbps_pkg_name(const char *pkg)
{ {
const char *p; const char *p;
char *buf; char *buf;
size_t len; unsigned int len;
if ((p = strrchr(pkg, '-')) == NULL) if ((p = strrchr(pkg, '-')) == NULL)
return NULL; return NULL;
@ -143,7 +143,7 @@ char *
xbps_pkgpattern_name(const char *pkg) xbps_pkgpattern_name(const char *pkg)
{ {
char *res, *pkgname; char *res, *pkgname;
size_t len; unsigned int len;
assert(pkg != NULL); assert(pkg != NULL);