From e03797e40190969c2c97a4c3fb7cae6d48c72688 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Thu, 14 Feb 2008 06:29:25 +0100 Subject: [PATCH] Fixed 64-bit transfers in the applet. --- clients/gnome-trans-applet/conduit.c | 4 ++-- clients/gnome-trans-applet/conduit.h | 9 +++++---- clients/gnome-trans-applet/dolcon-trans-applet.c | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/clients/gnome-trans-applet/conduit.c b/clients/gnome-trans-applet/conduit.c index 5959a27..e667ee6 100644 --- a/clients/gnome-trans-applet/conduit.c +++ b/clients/gnome-trans-applet/conduit.c @@ -28,13 +28,13 @@ struct transfer *findtransferbytag(struct conduit *conduit, char *tag) return(transfer); } -void transfersetsize(struct transfer *transfer, int size) +void transfersetsize(struct transfer *transfer, intmax_t size) { transfer->size = size; cb_trsize(transfer, transfer->conduit->udata); } -void transfersetpos(struct transfer *transfer, int pos) +void transfersetpos(struct transfer *transfer, intmax_t pos) { transfer->pos = pos; cb_trpos(transfer, transfer->conduit->udata); diff --git a/clients/gnome-trans-applet/conduit.h b/clients/gnome-trans-applet/conduit.h index d38875b..0d3b15c 100644 --- a/clients/gnome-trans-applet/conduit.h +++ b/clients/gnome-trans-applet/conduit.h @@ -2,6 +2,7 @@ #define _CONDUIT_H #include +#include #define CNDS_IDLE 0 #define CNDS_SYN 1 @@ -12,9 +13,9 @@ struct transfer struct transfer *next, *prev; struct conduit *conduit; char *tag; /* UTF8 */ - int pos, size; + intmax_t pos, size; time_t cmptime, ckptime; - size_t cmpsize, ckpsize; + intmax_t cmpsize, ckpsize; int timeout; }; @@ -35,8 +36,8 @@ struct conduitiface }; struct transfer *findtransferbytag(struct conduit *conduit, char *tag); -void transfersetsize(struct transfer *transfer, int size); -void transfersetpos(struct transfer *transfer, int pos); +void transfersetsize(struct transfer *transfer, intmax_t size); +void transfersetpos(struct transfer *transfer, intmax_t pos); struct transfer *newtransfer(struct conduit *conduit, char *tag, int size, int pos); void freetransfer(struct transfer *transfer); struct conduit *newconduit(struct conduitiface *iface, void *udata); diff --git a/clients/gnome-trans-applet/dolcon-trans-applet.c b/clients/gnome-trans-applet/dolcon-trans-applet.c index 0495560..6b4a6e9 100644 --- a/clients/gnome-trans-applet/dolcon-trans-applet.c +++ b/clients/gnome-trans-applet/dolcon-trans-applet.c @@ -126,7 +126,7 @@ static void update(struct appletdata *data) } else { if((data->curdisplay->pos > 0) && (data->curdisplay->size > 0)) { - sprintf(buf, "%'i/%'i", data->curdisplay->pos, data->curdisplay->size); + sprintf(buf, "%'ji/%'ji", (intmax_t)data->curdisplay->pos, (intmax_t)data->curdisplay->size); gtk_progress_bar_set_fraction(data->pbar, (double)data->curdisplay->pos / (double)data->curdisplay->size); gtk_progress_bar_set_text(data->pbar, buf); } else { -- 2.11.0