diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2010-10-21 10:50:25 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2010-10-21 10:50:25 +0100 |
commit | 6391d1a7cfa10337a75465c72d49df3c9ebc65ca (patch) | |
tree | 84072813ae8e8790cc42c02fcb71cd04e2a1bc5d /fish | |
parent | fcd75e021a12fbd93c4d51fbca7844fdb4f7436f (diff) | |
download | libguestfs-6391d1a7cfa10337a75465c72d49df3c9ebc65ca.tar.gz libguestfs-6391d1a7cfa10337a75465c72d49df3c9ebc65ca.tar.xz libguestfs-6391d1a7cfa10337a75465c72d49df3c9ebc65ca.zip |
fish: Change 'int argc' to 'size_t argc' throughout.
Diffstat (limited to 'fish')
-rw-r--r-- | fish/alloc.c | 4 | ||||
-rw-r--r-- | fish/copy.c | 4 | ||||
-rw-r--r-- | fish/echo.c | 4 | ||||
-rw-r--r-- | fish/edit.c | 2 | ||||
-rw-r--r-- | fish/fish.h | 32 | ||||
-rw-r--r-- | fish/glob.c | 11 | ||||
-rw-r--r-- | fish/hexedit.c | 2 | ||||
-rw-r--r-- | fish/lcd.c | 2 | ||||
-rw-r--r-- | fish/man.c | 2 | ||||
-rw-r--r-- | fish/more.c | 2 | ||||
-rw-r--r-- | fish/rc.c | 7 | ||||
-rw-r--r-- | fish/reopen.c | 2 | ||||
-rw-r--r-- | fish/supported.c | 2 | ||||
-rw-r--r-- | fish/time.c | 2 |
14 files changed, 40 insertions, 38 deletions
diff --git a/fish/alloc.c b/fish/alloc.c index 0470d202..156fcc00 100644 --- a/fish/alloc.c +++ b/fish/alloc.c @@ -31,7 +31,7 @@ #include "fish.h" int -run_alloc (const char *cmd, int argc, char *argv[]) +run_alloc (const char *cmd, size_t argc, char *argv[]) { if (argc != 2) { fprintf (stderr, _("use 'alloc file size' to create an image\n")); @@ -45,7 +45,7 @@ run_alloc (const char *cmd, int argc, char *argv[]) } int -run_sparse (const char *cmd, int argc, char *argv[]) +run_sparse (const char *cmd, size_t argc, char *argv[]) { if (argc != 2) { fprintf (stderr, _("use 'sparse file size' to create a sparse image\n")); diff --git a/fish/copy.c b/fish/copy.c index bb6334c4..f5edad11 100644 --- a/fish/copy.c +++ b/fish/copy.c @@ -33,7 +33,7 @@ static int make_tar_output (const char *local, const char *basename); static int split_path (char *buf, size_t buf_size, const char *path, const char **dirname, const char **basename); int -run_copy_in (const char *cmd, int argc, char *argv[]) +run_copy_in (const char *cmd, size_t argc, char *argv[]) { if (argc < 2) { fprintf (stderr, @@ -176,7 +176,7 @@ tar_create (const char *dir, const char *path) } int -run_copy_out (const char *cmd, int argc, char *argv[]) +run_copy_out (const char *cmd, size_t argc, char *argv[]) { if (argc < 2) { fprintf (stderr, diff --git a/fish/echo.c b/fish/echo.c index 783c0f69..78b41601 100644 --- a/fish/echo.c +++ b/fish/echo.c @@ -25,9 +25,9 @@ #include "fish.h" int -run_echo (const char *cmd, int argc, char *argv[]) +run_echo (const char *cmd, size_t argc, char *argv[]) { - int i; + size_t i; for (i = 0; i < argc; ++i) { if (i > 0) printf (" "); diff --git a/fish/edit.c b/fish/edit.c index 58b4a598..a9539bad 100644 --- a/fish/edit.c +++ b/fish/edit.c @@ -32,7 +32,7 @@ /* guestfish edit command, suggested by Ján Ondrej, implemented by RWMJ */ int -run_edit (const char *cmd, int argc, char *argv[]) +run_edit (const char *cmd, size_t argc, char *argv[]) { TMP_TEMPLATE_ON_STACK (filename); char buf[256]; diff --git a/fish/fish.h b/fish/fish.h index 23403575..b94277de 100644 --- a/fish/fish.h +++ b/fish/fish.h @@ -83,7 +83,7 @@ extern char *read_key (const char *param); /* in cmds.c (auto-generated) */ extern void list_commands (void); extern int display_command (const char *cmd); -extern int run_action (const char *cmd, int argc, char *argv[]); +extern int run_action (const char *cmd, size_t argc, char *argv[]); /* in completion.c (auto-generated) */ extern char **do_completion (const char *text, int start, int end); @@ -93,40 +93,40 @@ extern int complete_dest_paths; extern char *complete_dest_paths_generator (const char *text, int state); /* in alloc.c */ -extern int run_alloc (const char *cmd, int argc, char *argv[]); -extern int run_sparse (const char *cmd, int argc, char *argv[]); +extern int run_alloc (const char *cmd, size_t argc, char *argv[]); +extern int run_sparse (const char *cmd, size_t argc, char *argv[]); extern int alloc_disk (const char *filename, const char *size, int add, int sparse); extern int parse_size (const char *str, off_t *size_rtn); /* in copy.c */ -extern int run_copy_in (const char *cmd, int argc, char *argv[]); -extern int run_copy_out (const char *cmd, int argc, char *argv[]); +extern int run_copy_in (const char *cmd, size_t argc, char *argv[]); +extern int run_copy_out (const char *cmd, size_t argc, char *argv[]); /* in echo.c */ -extern int run_echo (const char *cmd, int argc, char *argv[]); +extern int run_echo (const char *cmd, size_t argc, char *argv[]); /* in edit.c */ -extern int run_edit (const char *cmd, int argc, char *argv[]); +extern int run_edit (const char *cmd, size_t argc, char *argv[]); /* in hexedit.c */ -extern int run_hexedit (const char *cmd, int argc, char *argv[]); +extern int run_hexedit (const char *cmd, size_t argc, char *argv[]); /* in inspect.c */ extern void inspect_mount (void); extern void print_inspect_prompt (void); /* in lcd.c */ -extern int run_lcd (const char *cmd, int argc, char *argv[]); +extern int run_lcd (const char *cmd, size_t argc, char *argv[]); /* in glob.c */ -extern int run_glob (const char *cmd, int argc, char *argv[]); +extern int run_glob (const char *cmd, size_t argc, char *argv[]); /* in man.c */ -extern int run_man (const char *cmd, int argc, char *argv[]); +extern int run_man (const char *cmd, size_t argc, char *argv[]); /* in more.c */ -extern int run_more (const char *cmd, int argc, char *argv[]); +extern int run_more (const char *cmd, size_t argc, char *argv[]); /* in prep.c */ struct prep_data { @@ -152,17 +152,17 @@ extern void progress_callback (guestfs_h *g, void *data, int proc_nr, int serial /* in rc.c (remote control) */ extern void rc_listen (void) __attribute__((noreturn)); -extern int rc_remote (int pid, const char *cmd, int argc, char *argv[], +extern int rc_remote (int pid, const char *cmd, size_t argc, char *argv[], int exit_on_error); /* in reopen.c */ -extern int run_reopen (const char *cmd, int argc, char *argv[]); +extern int run_reopen (const char *cmd, size_t argc, char *argv[]); /* in supported.c */ -extern int run_supported (const char *cmd, int argc, char *argv[]); +extern int run_supported (const char *cmd, size_t argc, char *argv[]); /* in time.c */ -extern int run_time (const char *cmd, int argc, char *argv[]); +extern int run_time (const char *cmd, size_t argc, char *argv[]); /* in tilde.c */ extern char *try_tilde_expansion (char *path); diff --git a/fish/glob.c b/fish/glob.c index e17a9adc..509532b8 100644 --- a/fish/glob.c +++ b/fish/glob.c @@ -28,10 +28,10 @@ /* A bit tricky because in the case where there are multiple * paths we have to perform a Cartesian product. */ -static void glob_issue (char *cmd, int argc, char ***globs, int *posn, int *count, int *r); +static void glob_issue (char *cmd, size_t argc, char ***globs, int *posn, int *count, int *r); int -run_glob (const char *cmd, int argc, char *argv[]) +run_glob (const char *cmd, size_t argc, char *argv[]) { /* For 'glob cmd foo /s* /usr/s*' this could be: * @@ -46,7 +46,8 @@ run_glob (const char *cmd, int argc, char *argv[]) char **globs[argc]; int posn[argc]; int count[argc]; - int i, r = 0; + size_t i; + int r = 0; if (argc < 1) { fprintf (stderr, _("use 'glob command [args...]'\n")); @@ -129,11 +130,11 @@ run_glob (const char *cmd, int argc, char *argv[]) } static void -glob_issue (char *cmd, int argc, +glob_issue (char *cmd, size_t argc, char ***globs, int *posn, int *count, int *r) { - int i; + size_t i; char *argv[argc+1]; argv[0] = cmd; diff --git a/fish/hexedit.c b/fish/hexedit.c index bd3efc8e..885c54e3 100644 --- a/fish/hexedit.c +++ b/fish/hexedit.c @@ -35,7 +35,7 @@ static off_t get_size (const char *filename); int -run_hexedit (const char *cmd, int argc, char *argv[]) +run_hexedit (const char *cmd, size_t argc, char *argv[]) { if (argc < 1 || argc > 3) { fprintf (stderr, _("hexedit (device|filename) [max | start max]\n")); @@ -28,7 +28,7 @@ /* guestfish lcd command (similar to the lcd command in BSD ftp) */ int -run_lcd (const char *cmd, int argc, char *argv[]) +run_lcd (const char *cmd, size_t argc, char *argv[]) { if (argc != 1) { fprintf (stderr, _("use 'lcd directory' to change local directory\n")); @@ -28,7 +28,7 @@ /* guestfish man command */ int -run_man (const char *cmd, int argc, char *argv[]) +run_man (const char *cmd, size_t argc, char *argv[]) { if (argc != 0) { fprintf (stderr, _("use 'man' without parameters to open the manual\n")); diff --git a/fish/more.c b/fish/more.c index e8a6d052..2065abb4 100644 --- a/fish/more.c +++ b/fish/more.c @@ -28,7 +28,7 @@ #include "fish.h" int -run_more (const char *cmd, int argc, char *argv[]) +run_more (const char *cmd, size_t argc, char *argv[]) { TMP_TEMPLATE_ON_STACK (filename); char buf[256]; @@ -177,14 +177,15 @@ rc_listen (void) char sockpath[128]; pid_t pid; struct sockaddr_un addr; - int sock, s, i; + int sock, s; + size_t i; FILE *fp; XDR xdr, xdr2; guestfish_hello hello; guestfish_call call; guestfish_reply reply; char **argv; - int argc; + size_t argc; memset (&hello, 0, sizeof hello); memset (&call, 0, sizeof call); @@ -307,7 +308,7 @@ rc_listen (void) /* Remote control client. */ int -rc_remote (int pid, const char *cmd, int argc, char *argv[], +rc_remote (int pid, const char *cmd, size_t argc, char *argv[], int exit_on_error) { guestfish_hello hello; diff --git a/fish/reopen.c b/fish/reopen.c index 1b162c19..b0769826 100644 --- a/fish/reopen.c +++ b/fish/reopen.c @@ -26,7 +26,7 @@ #include "fish.h" int -run_reopen (const char *cmd, int argc, char *argv[]) +run_reopen (const char *cmd, size_t argc, char *argv[]) { guestfs_h *g2; int r; diff --git a/fish/supported.c b/fish/supported.c index 3a0c93c0..9502ad38 100644 --- a/fish/supported.c +++ b/fish/supported.c @@ -26,7 +26,7 @@ #include "fish.h" int -run_supported (const char *cmd, int argc, char *argv[]) +run_supported (const char *cmd, size_t argc, char *argv[]) { char **groups; diff --git a/fish/time.c b/fish/time.c index f2fa0fcf..48cf1002 100644 --- a/fish/time.c +++ b/fish/time.c @@ -26,7 +26,7 @@ #include "fish.h" int -run_time (const char *cmd, int argc, char *argv[]) +run_time (const char *cmd, size_t argc, char *argv[]) { struct timeval start_t, end_t; int64_t start_us, end_us, elapsed_us; |