|
8 | 8 | */
|
9 | 9 |
|
10 | 10 | #define USE_THE_REPOSITORY_VARIABLE
|
11 |
| -#define DISABLE_SIGN_COMPARE_WARNINGS |
12 | 11 |
|
13 | 12 | #include "git-compat-util.h"
|
14 | 13 | #include "bulk-checkin.h"
|
@@ -44,8 +43,7 @@ static int get_conv_flags(unsigned flags)
|
44 | 43 |
|
45 | 44 | static void fill_loose_path(struct strbuf *buf, const struct object_id *oid)
|
46 | 45 | {
|
47 |
| - int i; |
48 |
| - for (i = 0; i < the_hash_algo->rawsz; i++) { |
| 46 | + for (size_t i = 0; i < the_hash_algo->rawsz; i++) { |
49 | 47 | static char hex[] = "0123456789abcdef";
|
50 | 48 | unsigned int val = oid->hash[i];
|
51 | 49 | strbuf_addch(buf, hex[val >> 4]);
|
@@ -327,9 +325,8 @@ static void *unpack_loose_rest(git_zstream *stream,
|
327 | 325 | void *buffer, unsigned long size,
|
328 | 326 | const struct object_id *oid)
|
329 | 327 | {
|
330 |
| - int bytes = strlen(buffer) + 1; |
| 328 | + size_t bytes = strlen(buffer) + 1, n; |
331 | 329 | unsigned char *buf = xmallocz(size);
|
332 |
| - unsigned long n; |
333 | 330 | int status = Z_OK;
|
334 | 331 |
|
335 | 332 | n = stream->total_out - bytes;
|
@@ -596,7 +593,7 @@ static int check_collision(const char *source, const char *dest)
|
596 | 593 | goto out;
|
597 | 594 | }
|
598 | 595 |
|
599 |
| - if (sz_a < sizeof(buf_source)) |
| 596 | + if ((size_t) sz_a < sizeof(buf_source)) |
600 | 597 | break;
|
601 | 598 | }
|
602 | 599 |
|
@@ -1240,7 +1237,7 @@ static int index_core(struct index_state *istate,
|
1240 | 1237 | if (read_result < 0)
|
1241 | 1238 | ret = error_errno(_("read error while indexing %s"),
|
1242 | 1239 | path ? path : "<unknown>");
|
1243 |
| - else if (read_result != size) |
| 1240 | + else if ((size_t) read_result != size) |
1244 | 1241 | ret = error(_("short read while indexing %s"),
|
1245 | 1242 | path ? path : "<unknown>");
|
1246 | 1243 | else
|
@@ -1268,7 +1265,7 @@ int index_fd(struct index_state *istate, struct object_id *oid,
|
1268 | 1265 | ret = index_stream_convert_blob(istate, oid, fd, path, flags);
|
1269 | 1266 | else if (!S_ISREG(st->st_mode))
|
1270 | 1267 | ret = index_pipe(istate, oid, fd, type, path, flags);
|
1271 |
| - else if (st->st_size <= repo_settings_get_big_file_threshold(the_repository) || |
| 1268 | + else if ((st->st_size >= 0 && (size_t) st->st_size <= repo_settings_get_big_file_threshold(the_repository)) || |
1272 | 1269 | type != OBJ_BLOB ||
|
1273 | 1270 | (path && would_convert_to_git(istate, path)))
|
1274 | 1271 | ret = index_core(istate, oid, fd, xsize_t(st->st_size),
|
@@ -1472,7 +1469,7 @@ struct oidtree *odb_loose_cache(struct odb_source *source,
|
1472 | 1469 | uint32_t *bitmap;
|
1473 | 1470 |
|
1474 | 1471 | if (subdir_nr < 0 ||
|
1475 |
| - subdir_nr >= bitsizeof(source->loose_objects_subdir_seen)) |
| 1472 | + (size_t) subdir_nr >= bitsizeof(source->loose_objects_subdir_seen)) |
1476 | 1473 | BUG("subdir_nr out of range");
|
1477 | 1474 |
|
1478 | 1475 | bitmap = &source->loose_objects_subdir_seen[word_index];
|
|
0 commit comments