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

@@ -740,8 +740,8 @@ void undo_last_backup (void);
int deref_stat (char const *name, struct stat *buf);
size_t blocking_read (int fd, void *buf, size_t count);
size_t blocking_write (int fd, void const *buf, size_t count);
ptrdiff_t blocking_read (int fd, void *buf, idx_t count);
idx_t blocking_write (int fd, void const *buf, idx_t count);
extern idx_t chdir_current;
extern int chdir_fd;
@@ -1031,7 +1031,7 @@ extern int warning_option;
#define WARNOPT(opt,args) \
do \
{ \
if (WARNING_ENABLED(opt)) WARN (args); \
if (WARNING_ENABLED (opt)) WARN (args); \
} \
while (0)