summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2010-12-08 15:13:36 +1000
committerDan McGee <dan@archlinux.org>2011-01-07 21:15:46 -0600
commitf966f3a8344cd96bd675c79a5c470c66920b890c (patch)
treec97116b7cc0ca1dca8bed3f050ab18dc28a05585 /src
parent4bc6ed56aa48784c8caf56c3a6fb1a3c972d221c (diff)
downloadpacman-f966f3a8344cd96bd675c79a5c470c66920b890c.tar.xz
Use size_t for alpm_list sizes
There is a lot of swtiching between size_t and int for alpm_list sizes in the codebase. Start converting these to all be size_t by adjusting the return type of alpm_list_count and fixing all additional warnings given by -Wconversion that are generated by this change. Dan: a few more small changes to ensure things compile, adjusting some printf format string characters to accommodate the larger size on x86_64. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/callback.c11
-rw-r--r--src/pacman/callback.h2
2 files changed, 7 insertions, 6 deletions
diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index 60914012..79d3dc40 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -325,13 +325,14 @@ void cb_trans_conv(pmtransconv_t event, void *data1, void *data2,
/* callback to handle display of transaction progress */
void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent,
- int howmany, int remain)
+ size_t howmany, size_t current)
{
float timediff;
/* size of line to allocate for text printing (e.g. not progressbar) */
int infolen;
- int tmp, digits, textlen;
+ int digits, textlen;
+ size_t tmp;
char *opr = NULL;
/* used for wide character width determination and printing */
int len, wclen, wcwid, padwid;
@@ -402,7 +403,7 @@ void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent,
* done here to figure out the actual number of screen columns used
* by the output, and then pad it accordingly so we fill the terminal.
*/
- /* len = opr len + pkgname len (if available) + space + null */
+ /* len = opr len + pkgname len (if available) + space + null */
len = strlen(opr) + ((pkgname) ? strlen(pkgname) : 0) + 2;
wcstr = calloc(len, sizeof(wchar_t));
/* print our strings to the alloc'ed memory */
@@ -434,8 +435,8 @@ void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent,
}
- printf("(%*d/%*d) %ls%-*s", digits, remain, digits, howmany,
- wcstr, padwid, "");
+ printf("(%*ld/%*ld) %ls%-*s", digits, (unsigned long)current,
+ digits, (unsigned long)howmany, wcstr, padwid, "");
free(wcstr);
diff --git a/src/pacman/callback.h b/src/pacman/callback.h
index 670d03a6..f5bf1c1d 100644
--- a/src/pacman/callback.h
+++ b/src/pacman/callback.h
@@ -33,7 +33,7 @@ void cb_trans_conv(pmtransconv_t event, void *data1, void *data2,
/* callback to handle display of transaction progress */
void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent,
- int howmany, int remain);
+ size_t howmany, size_t remain);
/* callback to handle receipt of total download value */
void cb_dl_total(off_t total);