3
3
*/
4
4
5
5
#define USE_THE_REPOSITORY_VARIABLE
6
- #define DISABLE_SIGN_COMPARE_WARNINGS
7
6
8
7
#include "git-compat-util.h"
9
8
#include "bulk-checkin.h"
@@ -56,7 +55,6 @@ static void flush_bulk_checkin_packfile(struct bulk_checkin_packfile *state)
56
55
{
57
56
unsigned char hash [GIT_MAX_RAWSZ ];
58
57
struct strbuf packname = STRBUF_INIT ;
59
- int i ;
60
58
61
59
if (!state -> f )
62
60
return ;
@@ -82,7 +80,7 @@ static void flush_bulk_checkin_packfile(struct bulk_checkin_packfile *state)
82
80
finish_tmp_packfile (& packname , state -> pack_tmp_name ,
83
81
state -> written , state -> nr_written ,
84
82
& state -> pack_idx_opts , hash );
85
- for (i = 0 ; i < state -> nr_written ; i ++ )
83
+ for (uint32_t i = 0 ; i < state -> nr_written ; i ++ )
86
84
free (state -> written [i ]);
87
85
88
86
clear_exit :
@@ -131,14 +129,12 @@ static void flush_batch_fsync(void)
131
129
132
130
static int already_written (struct bulk_checkin_packfile * state , struct object_id * oid )
133
131
{
134
- int i ;
135
-
136
132
/* The object may already exist in the repository */
137
133
if (repo_has_object_file (the_repository , oid ))
138
134
return 1 ;
139
135
140
136
/* Might want to keep the list sorted */
141
- for (i = 0 ; i < state -> nr_written ; i ++ )
137
+ for (uint32_t i = 0 ; i < state -> nr_written ; i ++ )
142
138
if (oideq (& state -> written [i ]-> oid , oid ))
143
139
return 1 ;
144
140
@@ -182,13 +178,13 @@ static int stream_blob_to_pack(struct bulk_checkin_packfile *state,
182
178
183
179
while (status != Z_STREAM_END ) {
184
180
if (size && !s .avail_in ) {
185
- ssize_t rsize = size < sizeof (ibuf ) ? size : sizeof (ibuf );
181
+ size_t rsize = size < sizeof (ibuf ) ? size : sizeof (ibuf );
186
182
ssize_t read_result = read_in_full (fd , ibuf , rsize );
187
183
if (read_result < 0 )
188
184
die_errno ("failed to read from '%s'" , path );
189
- if (read_result != rsize )
190
- die ("failed to read %d bytes from '%s'" ,
191
- (int )rsize , path );
185
+ if (( size_t ) read_result != rsize )
186
+ die ("failed to read %u bytes from '%s'" ,
187
+ (unsigned )rsize , path );
192
188
offset += rsize ;
193
189
if (* already_hashed_to < offset ) {
194
190
size_t hsize = offset - * already_hashed_to ;
0 commit comments