1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-11 14:10:34 +00:00

signed/unsigned fixes (thanks to GCC4) and a few related minor style corrections.

This commit is contained in:
Tim Kientzle 2005-09-24 21:15:00 +00:00
parent ca72f67d70
commit c4e21983bc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=150527
9 changed files with 23 additions and 15 deletions

View File

@ -258,9 +258,11 @@ void archive_read_finish(struct archive *);
/*-
* To create an archive:
* 1) Ask archive_write_new for a archive writer object.
* 2) Set any global properties. In particular, you should register
* open/write/close callbacks.
* 3) Call archive_write_open to open the file
* 2) Set any global properties. In particular, you should set
* the compression and format to use.
* 3) Call archive_write_open to open the file (most people
* will use archive_write_open_file or archive_write_open_fd,
* which provide convenient canned I/O callbacks for you).
* 4) For each entry:
* - construct an appropriate struct archive_entry structure
* - archive_write_header to write the header

View File

@ -53,7 +53,7 @@ struct archive {
ino_t skip_file_ino;
/* Utility: Pointer to a block of nulls. */
const char *nulls;
const unsigned char *nulls;
size_t null_length;
/*

View File

@ -55,7 +55,7 @@ struct archive *
archive_read_new(void)
{
struct archive *a;
char *nulls;
unsigned char *nulls;
a = malloc(sizeof(*a));
if (a == NULL) {
@ -412,7 +412,7 @@ archive_read_data_skip(struct archive *a)
{
int r;
const void *buff;
ssize_t size;
size_t size;
off_t offset;
__archive_check_magic(a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA, "archive_read_data_skip");

View File

@ -45,8 +45,8 @@ archive_read_data_into_fd(struct archive *a, int fd)
{
int r;
const void *buff;
ssize_t size, bytes_to_write;
ssize_t bytes_written, total_written;
size_t size;
ssize_t bytes_to_write, bytes_written, total_written;
off_t offset;
off_t output_offset;

View File

@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$");
#if HAVE_BZLIB_H
struct private_data {
bz_stream stream;
unsigned char *uncompressed_buffer;
char *uncompressed_buffer;
size_t uncompressed_buffer_size;
char *read_next;
int64_t total_out;

View File

@ -425,6 +425,9 @@ archive_read_format_iso9660_read_data(struct archive *a,
}
bytes_read = (a->compression_read_ahead)(a, buff, 1);
if (bytes_read == 0)
archive_set_error(a, ARCHIVE_ERRNO_MISC,
"Truncated input file");
if (bytes_read <= 0)
return (ARCHIVE_FATAL);
if (bytes_read > iso9660->entry_bytes_remaining)
@ -496,7 +499,8 @@ parse_file_info(struct iso9660 *iso9660, struct file_info *parent,
const unsigned char *rr_start, *rr_end;
rr_end = (const unsigned char *)isodirrec
+ isodirrec->length[0];
rr_start = isodirrec->name + isodirrec->name_len[0];
rr_start = (const unsigned char *)isodirrec->name
+ isodirrec->name_len[0];
if ((isodirrec->name_len[0] & 1) == 0)
rr_start++;
rr_start += iso9660->suspOffset;
@ -669,7 +673,8 @@ parse_rockridge(struct iso9660 *iso9660, struct file_info *file,
switch(flag) {
case 0x01: /* Continue */
archive_strncat(&file->symlink, data, nlen);
archive_strncat(&file->symlink,
(const char *)data, nlen);
cont = 1;
break;
case 0x02: /* Current */
@ -686,7 +691,8 @@ parse_rockridge(struct iso9660 *iso9660, struct file_info *file,
archive_strcat(&file->symlink, "hostname");
break;
case 0:
archive_strncat(&file->symlink, data, nlen);
archive_strncat(&file->symlink,
(const char *)data, nlen);
break;
default:
/* TODO: issue a warning ? */

View File

@ -1551,7 +1551,7 @@ static int64_t
tar_atol256(const char *_p, unsigned char_cnt)
{
int64_t l, upper_limit, lower_limit;
const unsigned char *p = _p;
const unsigned char *p = (const unsigned char *)_p;
upper_limit = max_int64 / 256;
lower_limit = min_int64 / 256;

View File

@ -628,7 +628,7 @@ archive_read_format_zip_read_data_skip(struct archive *a)
* to decompress all the data to find the end marker.
*/
if (zip->flags & ZIP_LENGTH_AT_END) {
ssize_t size;
size_t size;
off_t offset;
int r;
do {

View File

@ -56,7 +56,7 @@ struct archive *
archive_write_new(void)
{
struct archive *a;
char *nulls;
unsigned char *nulls;
a = malloc(sizeof(*a));
if (a == NULL)