Fill in a couple of missing casts: clarify one narrowing conversion
and correct the use of unary minus with an unsigned value. (The unary minus here is actually being used as a bitwise operation, which is unusual enough to deserve a clarifying cast.)
This commit is contained in:
parent
4f27e91611
commit
6770b130f1
@ -805,7 +805,7 @@ archive_write_pax_header(struct archive *a,
|
||||
}
|
||||
|
||||
pax->entry_bytes_remaining = archive_strlen(&(pax->pax_header));
|
||||
pax->entry_padding = 0x1ff & (- pax->entry_bytes_remaining);
|
||||
pax->entry_padding = 0x1ff & (-(int64_t)pax->entry_bytes_remaining);
|
||||
|
||||
r = (a->compression_write)(a, pax->pax_header.s,
|
||||
archive_strlen(&(pax->pax_header)));
|
||||
@ -834,7 +834,7 @@ archive_write_pax_header(struct archive *a,
|
||||
*/
|
||||
archive_entry_set_size(entry_original, archive_entry_size(entry_main));
|
||||
pax->entry_bytes_remaining = archive_entry_size(entry_main);
|
||||
pax->entry_padding = 0x1ff & (- pax->entry_bytes_remaining);
|
||||
pax->entry_padding = 0x1ff & (-(int64_t)pax->entry_bytes_remaining);
|
||||
archive_entry_free(entry_main);
|
||||
|
||||
return (ret);
|
||||
|
@ -178,7 +178,7 @@ archive_write_ustar_header(struct archive *a, struct archive_entry *entry)
|
||||
return (ret);
|
||||
|
||||
ustar->entry_bytes_remaining = archive_entry_size(entry);
|
||||
ustar->entry_padding = 0x1ff & (- ustar->entry_bytes_remaining);
|
||||
ustar->entry_padding = 0x1ff & (-(int64_t)ustar->entry_bytes_remaining);
|
||||
return (ARCHIVE_OK);
|
||||
}
|
||||
|
||||
@ -431,7 +431,7 @@ format_octal(int64_t v, char *p, int s)
|
||||
|
||||
p += s; /* Start at the end and work backwards. */
|
||||
while (s-- > 0) {
|
||||
*--p = '0' + (v & 7);
|
||||
*--p = (char)('0' + (v & 7));
|
||||
v >>= 3;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user