Prefer signed types in blocking_read etc

* src/compare.c (process_noop, process_rawdata):
Return bool, not int.
* src/compare.c (process_noop, process_rawdata):
* src/create.c (dump_regular_file):
* src/extract.c (extract_file):
* src/misc.c (blocking_read, blocking_write):
* src/sparse.c (sparse_scan_file_raw, sparse_extract_region):
Prefer signed types like idx_t to unsigned ones like size_t.
(sparse_scan_file_raw): Diagnose read errors.
This commit is contained in:
Paul Eggert
2024-08-09 00:22:53 -07:00
parent 88c2aa1616
commit b3992e4ef8
6 changed files with 62 additions and 57 deletions

View File

@@ -1281,7 +1281,6 @@ extract_file (char *file_name, int typeflag)
off_t size;
union block *data_block;
int status;
size_t count;
size_t written;
bool interdir_made = false;
mode_t mode = (current_stat_info.stat.st_mode & MODE_RWX
@@ -1351,7 +1350,7 @@ extract_file (char *file_name, int typeflag)
if (written > size)
written = size;
errno = 0;
count = blocking_write (fd, data_block->buffer, written);
idx_t count = blocking_write (fd, data_block->buffer, written);
size -= written;
set_next_block_after ((union block *)