From: Richard W.M. Jones Date: Sat, 30 Apr 2011 09:49:06 +0000 (-0400) Subject: internal: Use size_t instead of int for command line size. X-Git-Tag: 1.11.4~16 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=10167cea98f93a74abe63f0a54d3a662997e7489;p=libguestfs.git internal: Use size_t instead of int for command line size. --- diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h index b5a7053..9193b97 100644 --- a/src/guestfs-internal.h +++ b/src/guestfs-internal.h @@ -147,7 +147,7 @@ struct guestfs_h char *qemu_help, *qemu_version; /* Output of qemu -help, qemu -version. */ char **cmdline; /* Qemu command line. */ - int cmdline_size; + size_t cmdline_size; int verbose; int trace; @@ -346,8 +346,8 @@ extern int guestfs___match3 (guestfs_h *g, const char *str, const pcre *re, char #endif extern int guestfs___feature_available (guestfs_h *g, const char *feature); extern void guestfs___free_string_list (char **); -extern int guestfs___checkpoint_cmdline (guestfs_h *g); -extern void guestfs___rollback_cmdline (guestfs_h *g, int pos); +extern size_t guestfs___checkpoint_cmdline (guestfs_h *g); +extern void guestfs___rollback_cmdline (guestfs_h *g, size_t pos); extern void guestfs___call_callbacks_void (guestfs_h *g, uint64_t event); extern void guestfs___call_callbacks_message (guestfs_h *g, uint64_t event, const char *buf, size_t buf_len); extern void guestfs___call_callbacks_array (guestfs_h *g, uint64_t event, const uint64_t *array, size_t array_len); diff --git a/src/guestfs.c b/src/guestfs.c index b2cf553..1575d75 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -216,7 +216,7 @@ guestfs_close (guestfs_h *g) remove_tmpdir (g); if (g->cmdline) { - int i; + size_t i; for (i = 0; i < g->cmdline_size; ++i) free (g->cmdline[i]); diff --git a/src/launch.c b/src/launch.c index a60ef7b..8dfeb31 100644 --- a/src/launch.c +++ b/src/launch.c @@ -104,16 +104,16 @@ add_cmdline (guestfs_h *g, const char *str) return 0; } -int +size_t guestfs___checkpoint_cmdline (guestfs_h *g) { return g->cmdline_size; } void -guestfs___rollback_cmdline (guestfs_h *g, int pos) +guestfs___rollback_cmdline (guestfs_h *g, size_t pos) { - int i; + size_t i; assert (g->cmdline_size >= pos); @@ -127,7 +127,7 @@ guestfs___rollback_cmdline (guestfs_h *g, int pos) char ** guestfs__debug_cmdline (guestfs_h *g) { - int i; + size_t i; char **r; if (g->cmdline == NULL) { diff --git a/src/virt.c b/src/virt.c index a23ac0a..aa2c022 100644 --- a/src/virt.c +++ b/src/virt.c @@ -305,7 +305,7 @@ static int guestfs___add_libvirt_dom (guestfs_h *g, virDomainPtr dom, const struct guestfs___add_libvirt_dom_argv *optargs) { - int cmdline_pos; + size_t cmdline_pos; int r; int readonly; const char *iface;