static int xml_writer_write_attribute(struct xml_writer *ctx, const char *key,
const char *value);
static int xml_writer_write_attributef(struct xml_writer *ctx, const char *key,
- const char *format, ...);
+ const char *format, ...) __LA_PRINTF(3, 4);
static int xml_writer_write_string(struct xml_writer *ctx, const char *string);
static int xml_writer_write_base64(struct xml_writer* ctx,
const char *data, size_t start, size_t len);
return (ARCHIVE_OK);
}
-static int
+static int __LA_PRINTF(4, 5)
xmlwrite_fstring(struct archive_write *a, struct xml_writer *writer,
const char *key, const char *fmt, ...)
{
return (ARCHIVE_FATAL);
}
r = xmlwrite_fstring(a, writer, "major",
- "%d", archive_entry_rdevmajor(file->entry));
+ "%ld", (long)archive_entry_rdevmajor(file->entry));
if (r < 0)
return (ARCHIVE_FATAL);
r = xmlwrite_fstring(a, writer, "minor",
- "%d", archive_entry_rdevminor(file->entry));
+ "%ld", (long)archive_entry_rdevminor(file->entry));
if (r < 0)
return (ARCHIVE_FATAL);
r = xml_writer_end_element(writer);
return (ARCHIVE_FATAL);
if (archive_entry_dev(file->entry) != 0) {
r = xmlwrite_fstring(a, writer, "deviceno",
- "%d", archive_entry_dev(file->entry));
+ "%ld", (long)archive_entry_dev(file->entry));
if (r < 0)
return (ARCHIVE_FATAL);
}
}
static void
-validate_entry_read(struct archive *a, const char* msg, const int streaming_reader)
+validate_entry_read(struct archive *a, const int streaming_reader)
{
struct archive_entry *ae;
size_t total_read;
r = archive_read_data(a, readbuf, sizeof(readbuf));
if (r <= 0) {
if (r < 0) {
- failure(msg, (int) r, archive_error_string(a));
+ failure("archive_read_data returned %d: %s",
+ (int)r, archive_error_string(a));
assertEqualInt(r > 0, 1);
}
break;
assertEqualIntA(a, ARCHIVE_OK, archive_read_add_passphrase(a, password));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used));
- validate_entry_read(a, "archive_read_data returned %d: %s", 0);
+ validate_entry_read(a, 0);
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_add_passphrase(a, password));
assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, buff, used, 7));
- validate_entry_read(a, "seek: archive_read_data returned %d: %s", 0);
+ validate_entry_read(a, 0);
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_add_passphrase(a, password));
/* NOTE: archive_read_open2 with read callback only -> NON-seekable. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_open2(a, &stream_buffer, NULL, read_streaming_buffer, NULL, NULL));
- validate_entry_read(a, "archive_read_data returned %d: %s", 1);
+ validate_entry_read(a, 1);
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}