From cd1740912b18f748a4f9b491a32b44c1712a7478 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Thu, 19 Dec 2013 21:38:53 -0800 Subject: [PATCH] Style: Use 'int' not 'char' for status return types. Fix a const mistake. --- libarchive/archive.h | 2 +- libarchive/archive_read.c | 4 ++-- libarchive/archive_read_private.h | 4 ++-- libarchive/archive_read_support_format_7zip.c | 7 ++++--- libarchive/archive_read_support_format_rar.c | 5 +++-- libarchive/archive_read_support_format_zip.c | 4 ++-- libarchive/archive_util.c | 2 +- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/libarchive/archive.h b/libarchive/archive.h index d15cc4a8a..1b01741ff 100644 --- a/libarchive/archive.h +++ b/libarchive/archive.h @@ -521,7 +521,7 @@ __LA_DECL __LA_INT64_T archive_read_header_position(struct archive *); * function does not return the number of encrypted entries but# * just shows that there are some. */ -__LA_DECL char archive_read_has_encrypted_entries(struct archive *); +__LA_DECL int archive_read_has_encrypted_entries(struct archive *); /* * Returns a bitmask of capabilities that are supported by the archive format reader. diff --git a/libarchive/archive_read.c b/libarchive/archive_read.c index 43e1d258c..cc05588b6 100644 --- a/libarchive/archive_read.c +++ b/libarchive/archive_read.c @@ -764,7 +764,7 @@ archive_read_header_position(struct archive *_a) * function does not return the number of encrypted entries but# * just shows that there are some. */ -char +int archive_read_has_encrypted_entries(struct archive *_a) { struct archive_read *a = (struct archive_read *)_a; @@ -1149,7 +1149,7 @@ __archive_read_register_format(struct archive_read *a, int64_t (*seek_data)(struct archive_read *, int64_t, int), int (*cleanup)(struct archive_read *), int (*format_capabilities)(struct archive_read *), - char (*has_encrypted_entries)(struct archive_read *)) + int (*has_encrypted_entries)(struct archive_read *)) { int i, number_slots; diff --git a/libarchive/archive_read_private.h b/libarchive/archive_read_private.h index 5ac009b2a..6636a5968 100644 --- a/libarchive/archive_read_private.h +++ b/libarchive/archive_read_private.h @@ -208,7 +208,7 @@ struct archive_read { int64_t (*seek_data)(struct archive_read *, int64_t, int); int (*cleanup)(struct archive_read *); int (*format_capabilties)(struct archive_read *); - char (*has_encrypted_entries)(struct archive_read *); + int (*has_encrypted_entries)(struct archive_read *); } formats[16]; struct archive_format_descriptor *format; /* Active format. */ @@ -230,7 +230,7 @@ int __archive_read_register_format(struct archive_read *a, int64_t (*seek_data)(struct archive_read *, int64_t, int), int (*cleanup)(struct archive_read *), int (*format_capabilities)(struct archive_read *), - char (*has_encrypted_entries)(struct archive_read *)); + int (*has_encrypted_entries)(struct archive_read *)); int __archive_read_get_bidder(struct archive_read *a, struct archive_read_filter_bidder **bidder); diff --git a/libarchive/archive_read_support_format_7zip.c b/libarchive/archive_read_support_format_7zip.c index 13dc99af5..e94192e78 100644 --- a/libarchive/archive_read_support_format_7zip.c +++ b/libarchive/archive_read_support_format_7zip.c @@ -328,10 +328,10 @@ struct _7zip { char format_name[64]; /* Custom value that is non-zero if this archive contains encrypted entries. */ - char has_encrypted_entries; + char has_encrypted_entries; }; -static char archive_read_format_7zip_has_encrypted_entries(struct archive_read *); +static int archive_read_format_7zip_has_encrypted_entries(struct archive_read *); static int archive_read_support_format_7zip_capabilities(struct archive_read *a); static int archive_read_format_7zip_bid(struct archive_read *, int); static int archive_read_format_7zip_cleanup(struct archive_read *); @@ -444,7 +444,8 @@ archive_read_support_format_7zip_capabilities(struct archive_read * a) } -static char archive_read_format_7zip_has_encrypted_entries(struct archive_read *_a) +static int +archive_read_format_7zip_has_encrypted_entries(struct archive_read *_a) { if (_a && _a->format) { struct _7zip * zip = (struct _7zip *)_a->format->data; diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c index 03d932a1d..1ad0e06b4 100644 --- a/libarchive/archive_read_support_format_rar.c +++ b/libarchive/archive_read_support_format_rar.c @@ -312,7 +312,7 @@ struct rar }; static int archive_read_support_format_rar_capabilities(struct archive_read *); -static char archive_read_format_rar_has_encrypted_entries(struct archive_read *); +static int archive_read_format_rar_has_encrypted_entries(struct archive_read *); static int archive_read_format_rar_bid(struct archive_read *, int); static int archive_read_format_rar_options(struct archive_read *, const char *, const char *); @@ -685,7 +685,8 @@ archive_read_support_format_rar_capabilities(struct archive_read * a) | ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA); } -static char archive_read_format_rar_has_encrypted_entries(struct archive_read *_a) +static int +archive_read_format_rar_has_encrypted_entries(struct archive_read *_a) { if (_a && _a->format) { struct rar * rar = (struct rar *)_a->format->data; diff --git a/libarchive/archive_read_support_format_zip.c b/libarchive/archive_read_support_format_zip.c index 5c25281f2..a0f0c1b13 100644 --- a/libarchive/archive_read_support_format_zip.c +++ b/libarchive/archive_read_support_format_zip.c @@ -129,7 +129,7 @@ struct zip { #define ZIP_CENTRAL_DIRECTORY_ENCRYPTED (1<<13) #define ZIP_UTF8_NAME (1<<11) -static char archive_read_format_zip_has_encrypted_entries(struct archive_read *); +static int archive_read_format_zip_has_encrypted_entries(struct archive_read *); static int archive_read_support_format_zip_capabilities_seekable(struct archive_read *a); static int archive_read_support_format_zip_capabilities_streamable(struct archive_read *a); static int archive_read_format_zip_streamable_bid(struct archive_read *, @@ -263,7 +263,7 @@ archive_read_support_format_zip_capabilities_streamable(struct archive_read * a) } -static char +static int archive_read_format_zip_has_encrypted_entries(struct archive_read *_a) { if (_a && _a->format) { diff --git a/libarchive/archive_util.c b/libarchive/archive_util.c index c1e171b68..3d92566b2 100644 --- a/libarchive/archive_util.c +++ b/libarchive/archive_util.c @@ -106,7 +106,7 @@ archive_version_details(void) #ifdef HAVE_BZLIB_H { const char *p = BZ2_bzlibVersion(); - char *sep = strchr(p, ','); + const char *sep = strchr(p, ','); if (sep == NULL) sep = p + strlen(p); archive_strcat(&str, " bz2lib/"); -- 2.47.2