ziptool: Remove unused arguments
diff --git a/regress/ziptool_regress.c b/regress/ziptool_regress.c
index ee440d2..6b853b8 100644
--- a/regress/ziptool_regress.c
+++ b/regress/ziptool_regress.c
@@ -11,11 +11,11 @@
source_type_t source_type = SOURCE_TYPE_NONE;
zip_uint64_t fragment_size = 0;
-static int add_nul(int argc, char *argv[]);
-static int cancel(int argc, char *argv[]);
-static int unchange_one(int argc, char *argv[]);
-static int unchange_all(int argc, char *argv[]);
-static int zin_close(int argc, char *argv[]);
+static int add_nul(char *argv[]);
+static int cancel(char *argv[]);
+static int unchange_one(char *argv[]);
+static int unchange_all(char *argv[]);
+static int zin_close(char *argv[]);
#define OPTIONS_REGRESS "F:Hm"
@@ -59,7 +59,7 @@
static int
-add_nul(int argc, char *argv[]) {
+add_nul(char *argv[]) {
zip_source_t *zs;
zip_uint64_t length = strtoull(argv[1], NULL, 10);
@@ -77,7 +77,7 @@
}
static int
-unchange_all(int argc, char *argv[]) {
+unchange_all(char *argv[]) {
if (zip_unchange_all(za) < 0) {
fprintf(stderr, "can't revert changes to archive: %s\n", zip_strerror(za));
return -1;
@@ -87,7 +87,7 @@
static int
-unchange_one(int argc, char *argv[]) {
+unchange_one(char *argv[]) {
zip_uint64_t idx;
idx = strtoull(argv[0], NULL, 10);
@@ -110,7 +110,7 @@
}
static int
-cancel(int argc, char *argv[]) {
+cancel(char *argv[]) {
zip_int64_t percent;
percent = strtoll(argv[0], NULL, 10);
if (percent > 100 || percent < 0) {
@@ -122,12 +122,12 @@
zip_register_cancel_callback_with_state(za, cancel_callback, NULL, NULL);
/* needs the percentage updates from print_progress */
- print_progress(argc, argv);
+ print_progress(argv);
return 0;
}
static int
-zin_close(int argc, char *argv[]) {
+zin_close(char *argv[]) {
zip_uint64_t idx;
idx = strtoull(argv[0], NULL, 10);
diff --git a/src/ziptool.c b/src/ziptool.c
index 149381b..db6f3e3 100644
--- a/src/ziptool.c
+++ b/src/ziptool.c
@@ -62,7 +62,7 @@
int argument_count;
const char *arg_names;
const char *description;
- int (*function)(int argc, char *argv[]);
+ int (*function)(char *argv[]);
} dispatch_table_t;
static zip_flags_t get_flags(const char *arg);
@@ -81,7 +81,7 @@
zip_flags_t stat_flags;
static int
-add(int argc, char *argv[]) {
+add(char *argv[]) {
zip_source_t *zs;
if ((zs = zip_source_buffer(za, argv[1], strlen(argv[1]), 0)) == NULL) {
@@ -98,7 +98,7 @@
}
static int
-add_dir(int argc, char *argv[]) {
+add_dir(char *argv[]) {
/* add directory */
if (zip_add_dir(za, argv[0]) < 0) {
fprintf(stderr, "can't add directory '%s': %s\n", argv[0], zip_strerror(za));
@@ -108,7 +108,7 @@
}
static int
-add_file(int argc, char *argv[]) {
+add_file(char *argv[]) {
zip_source_t *zs;
zip_uint64_t start = strtoull(argv[2], NULL, 10);
zip_int64_t len = strtoll(argv[3], NULL, 10);
@@ -135,7 +135,7 @@
}
static int
-add_from_zip(int argc, char *argv[]) {
+add_from_zip(char *argv[]) {
zip_uint64_t idx, start;
zip_int64_t len;
int err;
@@ -167,7 +167,7 @@
}
static int
-cat(int argc, char *argv[]) {
+cat(char *argv[]) {
/* output file contents to stdout */
zip_uint64_t idx;
zip_int64_t n;
@@ -208,7 +208,7 @@
}
static int
-count_extra(int argc, char *argv[]) {
+count_extra(char *argv[]) {
zip_int16_t count;
zip_uint64_t idx;
zip_flags_t ceflags = 0;
@@ -225,7 +225,7 @@
}
static int
-count_extra_by_id(int argc, char *argv[]) {
+count_extra_by_id(char *argv[]) {
zip_int16_t count;
zip_uint16_t eid;
zip_flags_t ceflags = 0;
@@ -243,7 +243,7 @@
return 0;
}
-static int delete (int argc, char *argv[]) {
+static int delete (char *argv[]) {
zip_uint64_t idx;
idx = strtoull(argv[0], NULL, 10);
if (zip_delete(za, idx) < 0) {
@@ -254,7 +254,7 @@
}
static int
-delete_extra(int argc, char *argv[]) {
+delete_extra(char *argv[]) {
zip_flags_t geflags;
zip_uint16_t eid;
zip_uint64_t idx;
@@ -269,7 +269,7 @@
}
static int
-delete_extra_by_id(int argc, char *argv[]) {
+delete_extra_by_id(char *argv[]) {
zip_flags_t geflags;
zip_uint16_t eid, eidx;
zip_uint64_t idx;
@@ -285,7 +285,7 @@
}
static int
-get_archive_comment(int argc, char *argv[]) {
+get_archive_comment(char *argv[]) {
const char *comment;
int len;
/* get archive comment */
@@ -297,7 +297,7 @@
}
static int
-get_extra(int argc, char *argv[]) {
+get_extra(char *argv[]) {
zip_flags_t geflags;
zip_uint16_t id, eidx, eflen;
const zip_uint8_t *efdata;
@@ -320,7 +320,7 @@
}
static int
-get_extra_by_id(int argc, char *argv[]) {
+get_extra_by_id(char *argv[]) {
zip_flags_t geflags;
zip_uint16_t eid, eidx, eflen;
const zip_uint8_t *efdata;
@@ -343,7 +343,7 @@
}
static int
-get_file_comment(int argc, char *argv[]) {
+get_file_comment(char *argv[]) {
const char *comment;
int len;
zip_uint64_t idx;
@@ -361,7 +361,7 @@
}
static int
-get_num_entries(int argc, char *argv[]) {
+get_num_entries(char *argv[]) {
zip_int64_t count;
zip_flags_t flags;
/* get number of entries in archive */
@@ -372,7 +372,7 @@
}
static int
-name_locate(int argc, char *argv[]) {
+name_locate(char *argv[]) {
zip_flags_t flags;
zip_int64_t idx;
flags = get_flags(argv[1]);
@@ -401,13 +401,13 @@
}
static int
-print_progress(int argc, char *argv[]) {
+print_progress(char *argv[]) {
zip_register_progress_callback_with_state(za, 0.001, progress_callback, NULL, NULL);
return 0;
}
static int
-zrename(int argc, char *argv[]) {
+zrename(char *argv[]) {
zip_uint64_t idx;
idx = strtoull(argv[0], NULL, 10);
if (zip_rename(za, idx, argv[1]) < 0) {
@@ -418,7 +418,7 @@
}
static int
-replace_file_contents(int argc, char *argv[]) {
+replace_file_contents(char *argv[]) {
/* replace file contents with data from command line */
const char *content;
zip_source_t *s;
@@ -434,7 +434,7 @@
}
static int
-set_extra(int argc, char *argv[]) {
+set_extra(char *argv[]) {
zip_flags_t geflags;
zip_uint16_t eid, eidx;
const zip_uint8_t *efdata;
@@ -452,7 +452,7 @@
}
static int
-set_archive_comment(int argc, char *argv[]) {
+set_archive_comment(char *argv[]) {
if (zip_set_archive_comment(za, argv[0], (zip_uint16_t)strlen(argv[0])) < 0) {
fprintf(stderr, "can't set archive comment to '%s': %s\n", argv[0], zip_strerror(za));
return -1;
@@ -461,7 +461,7 @@
}
static int
-set_file_comment(int argc, char *argv[]) {
+set_file_comment(char *argv[]) {
zip_uint64_t idx;
idx = strtoull(argv[0], NULL, 10);
if (zip_file_set_comment(za, idx, argv[1], (zip_uint16_t)strlen(argv[1]), 0) < 0) {
@@ -472,7 +472,7 @@
}
static int
-set_file_compression(int argc, char *argv[]) {
+set_file_compression(char *argv[]) {
zip_int32_t method;
zip_uint32_t flags;
zip_uint64_t idx;
@@ -487,7 +487,7 @@
}
static int
-set_file_encryption(int argc, char *argv[]) {
+set_file_encryption(char *argv[]) {
zip_uint16_t method;
zip_uint64_t idx;
char *password;
@@ -505,7 +505,7 @@
}
static int
-set_file_dostime(int argc, char *argv[]) {
+set_file_dostime(char *argv[]) {
/* set file last modification time (mtime) directly */
zip_uint16_t dostime, dosdate;
zip_uint64_t idx;
@@ -520,7 +520,7 @@
}
static int
-set_file_mtime(int argc, char *argv[]) {
+set_file_mtime(char *argv[]) {
/* set file last modification time (mtime) */
time_t mtime;
zip_uint64_t idx;
@@ -534,7 +534,7 @@
}
static int
-set_file_mtime_all(int argc, char *argv[]) {
+set_file_mtime_all(char *argv[]) {
/* set last modification time (mtime) for all files */
time_t mtime;
zip_int64_t num_entries;
@@ -555,7 +555,7 @@
}
static int
-set_password(int argc, char *argv[]) {
+set_password(char *argv[]) {
/* set default password */
if (zip_set_default_password(za, argv[0]) < 0) {
fprintf(stderr, "can't set default password to '%s'\n", argv[0]);
@@ -565,7 +565,7 @@
}
static int
-zstat(int argc, char *argv[]) {
+zstat(char *argv[]) {
zip_uint64_t idx;
char buf[100];
struct zip_stat sb;
@@ -691,8 +691,6 @@
for (i = 0; i < len; i++)
printf("%02x", data[i]);
-
- return;
}
@@ -775,7 +773,7 @@
fprintf(stderr, "not enough arguments for command '%s': %d available, %d needed\n", dispatch_table[i].cmdline_name, argc, dispatch_table[i].argument_count);
return -1;
}
- if (dispatch_table[i].function(argc, argv) == 0)
+ if (dispatch_table[i].function(argv) == 0)
return 1 + dispatch_table[i].argument_count;
return -1;
}