@@ -30,8 +30,8 @@ struct throughput {
30
30
31
31
struct progress {
32
32
const char * title ;
33
- int last_value ;
34
- unsigned total ;
33
+ uint64_t last_value ;
34
+ uint64_t total ;
35
35
unsigned last_percent ;
36
36
unsigned delay ;
37
37
unsigned delayed_percent_threshold ;
@@ -79,7 +79,7 @@ static int is_foreground_fd(int fd)
79
79
return tpgrp < 0 || tpgrp == getpgid (0 );
80
80
}
81
81
82
- static int display (struct progress * progress , unsigned n , const char * done )
82
+ static int display (struct progress * progress , uint64_t n , const char * done )
83
83
{
84
84
const char * eol , * tp ;
85
85
@@ -106,18 +106,19 @@ static int display(struct progress *progress, unsigned n, const char *done)
106
106
if (percent != progress -> last_percent || progress_update ) {
107
107
progress -> last_percent = percent ;
108
108
if (is_foreground_fd (fileno (stderr )) || done ) {
109
- fprintf (stderr , "%s: %3u%% (%u/%u)%s%s" ,
110
- progress -> title , percent , n ,
111
- progress -> total , tp , eol );
109
+ fprintf (stderr , "%s: %3u%% (%" PRIuMAX "/%" PRIuMAX ")%s%s" ,
110
+ progress -> title , percent ,
111
+ (uintmax_t )n , (uintmax_t )progress -> total ,
112
+ tp , eol );
112
113
fflush (stderr );
113
114
}
114
115
progress_update = 0 ;
115
116
return 1 ;
116
117
}
117
118
} else if (progress_update ) {
118
119
if (is_foreground_fd (fileno (stderr )) || done ) {
119
- fprintf (stderr , "%s: %u %s%s" ,
120
- progress -> title , n , tp , eol );
120
+ fprintf (stderr , "%s: %" PRIuMAX " %s%s" ,
121
+ progress -> title , ( uintmax_t ) n , tp , eol );
121
122
fflush (stderr );
122
123
}
123
124
progress_update = 0 ;
@@ -127,7 +128,7 @@ static int display(struct progress *progress, unsigned n, const char *done)
127
128
return 0 ;
128
129
}
129
130
130
- static void throughput_string (struct strbuf * buf , off_t total ,
131
+ static void throughput_string (struct strbuf * buf , uint64_t total ,
131
132
unsigned int rate )
132
133
{
133
134
strbuf_reset (buf );
@@ -138,7 +139,7 @@ static void throughput_string(struct strbuf *buf, off_t total,
138
139
strbuf_addstr (buf , "/s" );
139
140
}
140
141
141
- void display_throughput (struct progress * progress , off_t total )
142
+ void display_throughput (struct progress * progress , uint64_t total )
142
143
{
143
144
struct throughput * tp ;
144
145
uint64_t now_ns ;
@@ -200,12 +201,12 @@ void display_throughput(struct progress *progress, off_t total)
200
201
display (progress , progress -> last_value , NULL );
201
202
}
202
203
203
- int display_progress (struct progress * progress , unsigned n )
204
+ int display_progress (struct progress * progress , uint64_t n )
204
205
{
205
206
return progress ? display (progress , n , NULL ) : 0 ;
206
207
}
207
208
208
- static struct progress * start_progress_delay (const char * title , unsigned total ,
209
+ static struct progress * start_progress_delay (const char * title , uint64_t total ,
209
210
unsigned percent_threshold , unsigned delay )
210
211
{
211
212
struct progress * progress = malloc (sizeof (* progress ));
@@ -227,12 +228,12 @@ static struct progress *start_progress_delay(const char *title, unsigned total,
227
228
return progress ;
228
229
}
229
230
230
- struct progress * start_delayed_progress (const char * title , unsigned total )
231
+ struct progress * start_delayed_progress (const char * title , uint64_t total )
231
232
{
232
233
return start_progress_delay (title , total , 0 , 2 );
233
234
}
234
235
235
- struct progress * start_progress (const char * title , unsigned total )
236
+ struct progress * start_progress (const char * title , uint64_t total )
236
237
{
237
238
return start_progress_delay (title , total , 0 , 0 );
238
239
}
0 commit comments