bin: use unsigned int rather than size_t.
unsigned int is a 32-bit value both on 32/64-bit targets.
This commit is contained in:
parent
c031ee6945
commit
bc9fab5ee8
@ -48,8 +48,8 @@ struct transaction {
|
|||||||
/* 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 *, unsigned int, bool, bool);
|
||||||
int exec_transaction(struct xbps_handle *, size_t, bool, bool);
|
int exec_transaction(struct xbps_handle *, unsigned int, bool, bool);
|
||||||
|
|
||||||
/* from question.c */
|
/* from question.c */
|
||||||
bool yesno(const char *, ...);
|
bool yesno(const char *, ...);
|
||||||
@ -62,8 +62,8 @@ void fetch_file_progress_cb(const struct xbps_fetch_cb_data *, void *);
|
|||||||
int state_cb(const struct xbps_state_cb_data *, void *);
|
int state_cb(const 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 *, unsigned int, bool);
|
||||||
bool print_trans_colmode(struct transaction *, size_t);
|
bool print_trans_colmode(struct transaction *, unsigned int);
|
||||||
int get_maxcols(void);
|
int get_maxcols(void);
|
||||||
|
|
||||||
#endif /* !_XBPS_INSTALL_DEFS_H_ */
|
#endif /* !_XBPS_INSTALL_DEFS_H_ */
|
||||||
|
@ -108,7 +108,7 @@ show_actions(xbps_object_iterator_t iter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
show_package_list(struct transaction *trans, xbps_trans_type_t ttype, size_t cols)
|
show_package_list(struct transaction *trans, xbps_trans_type_t ttype, unsigned int cols)
|
||||||
{
|
{
|
||||||
xbps_dictionary_t ipkgd;
|
xbps_dictionary_t ipkgd;
|
||||||
xbps_object_t obj;
|
xbps_object_t obj;
|
||||||
@ -264,7 +264,7 @@ all_pkgs_on_hold(struct transaction *trans)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
dist_upgrade(struct xbps_handle *xhp, size_t cols, bool yes, bool drun)
|
dist_upgrade(struct xbps_handle *xhp, unsigned int cols, bool yes, bool drun)
|
||||||
{
|
{
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
|
|
||||||
@ -341,7 +341,7 @@ update_pkg(struct xbps_handle *xhp, const char *pkg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
exec_transaction(struct xbps_handle *xhp, size_t maxcols, bool yes, bool drun)
|
exec_transaction(struct xbps_handle *xhp, unsigned int maxcols, bool yes, bool drun)
|
||||||
{
|
{
|
||||||
xbps_array_t array;
|
xbps_array_t array;
|
||||||
struct transaction *trans;
|
struct transaction *trans;
|
||||||
|
@ -54,9 +54,9 @@ get_maxcols(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
print_package_line(const char *str, size_t maxcols, bool reset)
|
print_package_line(const char *str, unsigned int maxcols, bool reset)
|
||||||
{
|
{
|
||||||
static size_t cols;
|
static unsigned int cols;
|
||||||
static bool first;
|
static bool first;
|
||||||
|
|
||||||
if (reset) {
|
if (reset) {
|
||||||
@ -82,7 +82,7 @@ find_longest_pkgname(struct transaction *trans)
|
|||||||
{
|
{
|
||||||
xbps_object_t obj;
|
xbps_object_t obj;
|
||||||
const char *pkgname;
|
const char *pkgname;
|
||||||
size_t len = 0, max = 0;
|
unsigned int len = 0, max = 0;
|
||||||
|
|
||||||
while ((obj = xbps_object_iterator_next(trans->iter)) != NULL) {
|
while ((obj = xbps_object_iterator_next(trans->iter)) != NULL) {
|
||||||
if (!xbps_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname))
|
if (!xbps_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname))
|
||||||
@ -96,7 +96,7 @@ find_longest_pkgname(struct transaction *trans)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
print_trans_colmode(struct transaction *trans, size_t cols)
|
print_trans_colmode(struct transaction *trans, unsigned int cols)
|
||||||
{
|
{
|
||||||
xbps_dictionary_t ipkgd;
|
xbps_dictionary_t ipkgd;
|
||||||
xbps_object_t obj;
|
xbps_object_t obj;
|
||||||
@ -104,7 +104,7 @@ print_trans_colmode(struct transaction *trans, size_t cols)
|
|||||||
const char *pkgver, *pkgname, *ipkgver, *ver, *iver, *tract;
|
const char *pkgver, *pkgname, *ipkgver, *ver, *iver, *tract;
|
||||||
char size[8];
|
char size[8];
|
||||||
uint64_t dlsize = 0;
|
uint64_t dlsize = 0;
|
||||||
size_t x, blen, pnamelen, hdrlen;
|
unsigned int x, blen, pnamelen, hdrlen;
|
||||||
|
|
||||||
pnamelen = find_longest_pkgname(trans);
|
pnamelen = find_longest_pkgname(trans);
|
||||||
/* header length */
|
/* header length */
|
||||||
|
@ -33,8 +33,8 @@
|
|||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
|
|
||||||
struct list_pkgver_cb {
|
struct list_pkgver_cb {
|
||||||
size_t pkgver_len;
|
unsigned int pkgver_len;
|
||||||
size_t maxcols;
|
unsigned int maxcols;
|
||||||
};
|
};
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -47,7 +47,7 @@ list_pkgs_in_dict(struct xbps_handle *xhp UNUSED,
|
|||||||
struct list_pkgver_cb *lpc = arg;
|
struct list_pkgver_cb *lpc = arg;
|
||||||
const char *pkgver = NULL, *short_desc = NULL, *state_str = NULL;
|
const char *pkgver = NULL, *short_desc = NULL, *state_str = NULL;
|
||||||
char tmp[255], *out = NULL;
|
char tmp[255], *out = NULL;
|
||||||
size_t i, len = 0;
|
unsigned int i, len = 0;
|
||||||
pkg_state_t state;
|
pkg_state_t state;
|
||||||
|
|
||||||
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
||||||
@ -227,7 +227,7 @@ _find_longest_pkgver_cb(struct xbps_handle *xhp UNUSED,
|
|||||||
{
|
{
|
||||||
struct fflongest *ffl = arg;
|
struct fflongest *ffl = arg;
|
||||||
const char *pkgver = NULL;
|
const char *pkgver = NULL;
|
||||||
size_t len;
|
unsigned int len;
|
||||||
|
|
||||||
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
xbps_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
|
||||||
len = strlen(pkgver);
|
len = strlen(pkgver);
|
||||||
|
Loading…
Reference in New Issue
Block a user