Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pacman/callback.c9
-rw-r--r--src/pacman/callback.h4
-rw-r--r--src/pacman/util.c2
3 files changed, 9 insertions, 6 deletions
diff --git a/src/pacman/callback.c b/src/pacman/callback.c
index 4c415e1a..1942aefd 100644
--- a/src/pacman/callback.c
+++ b/src/pacman/callback.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
+#include <sys/types.h> /* off_t */
#include <unistd.h>
#include <dirent.h>
#include <wchar.h>
@@ -36,7 +37,7 @@
/* download progress bar */
static float rate_last;
-static int xfered_last;
+static off_t xfered_last;
static struct timeval initial_time;
/* transaction progress bar */
@@ -410,7 +411,7 @@ void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent,
}
/* callback to handle display of download progress */
-void cb_dl_progress(const char *filename, int xfered, int total)
+void cb_dl_progress(const char *filename, off_t xfered, off_t total)
{
const int infolen = 50;
const int filenamelen = infolen - 27;
@@ -428,12 +429,12 @@ void cb_dl_progress(const char *filename, int xfered, int total)
return;
}
- /* this is basically a switch on file_xferred: 0, file_total, and
+ /* this is basically a switch on xfered: 0, total, and
* anything else */
if(xfered == 0) {
/* set default starting values */
gettimeofday(&initial_time, NULL);
- xfered_last = 0;
+ xfered_last = (off_t)0;
rate_last = 0.0;
timediff = get_update_timediff(1);
} else if(xfered == total) {
diff --git a/src/pacman/callback.h b/src/pacman/callback.h
index 39d59d8b..28d396e8 100644
--- a/src/pacman/callback.h
+++ b/src/pacman/callback.h
@@ -19,6 +19,8 @@
#ifndef _PM_CALLBACK_H
#define _PM_CALLBACK_H
+#include <sys/types.h> /* off_t */
+
#include <alpm.h>
/* callback to handle messages/notifications from libalpm transactions */
@@ -33,7 +35,7 @@ void cb_trans_progress(pmtransprog_t event, const char *pkgname, int percent,
int howmany, int remain);
/* callback to handle display of download progress */
-void cb_dl_progress(const char *filename, int file_xfered, int file_total);
+void cb_dl_progress(const char *filename, off_t file_xfered, off_t file_total);
/* callback to handle messages/notifications from pacman library */
void cb_log(pmloglevel_t level, char *fmt, va_list args);
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 2e4ee86e..e702886b 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -493,7 +493,7 @@ void display_targets(const alpm_list_t *syncpkgs, pmdb_t *db_local)
const alpm_list_t *i, *j;
alpm_list_t *targets = NULL, *to_remove = NULL;
/* TODO these are some messy variable names */
- unsigned long isize = 0, rsize = 0, dispsize = 0, dlsize = 0;
+ off_t isize = 0, rsize = 0, dispsize = 0, dlsize = 0;
double mbisize = 0.0, mbrsize = 0.0, mbdispsize = 0.0, mbdlsize = 0.0;
for(i = syncpkgs; i; i = alpm_list_next(i)) {