summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-08-17 18:47:46 +0200
committerJim Meyering <meyering@redhat.com>2009-08-18 10:06:33 +0200
commitc3be5c3297d18bfe2545914f0e07574430437ebe (patch)
treeb0fcd676011ce30d0db3367b9a3965d84e7d0cdc /src
parent5a07cdc35856adfa25b8d0924a8d641b2320aadf (diff)
downloadlibguestfs-c3be5c3297d18bfe2545914f0e07574430437ebe.tar.gz
libguestfs-c3be5c3297d18bfe2545914f0e07574430437ebe.tar.xz
libguestfs-c3be5c3297d18bfe2545914f0e07574430437ebe.zip
generator.ml: avoid warnings in generated tests.c
* src/generator.ml: Avoid warnings in generated tests.c, regarding print_strings, and in exercising any function that takes a StringList or DeviceList parameter. (print_strings): Change param type to "char *const *s". Declare fully-const initializer for each list-taking function use. Cast *List argument to "(char **)".
Diffstat (limited to 'src')
-rwxr-xr-xsrc/generator.ml8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/generator.ml b/src/generator.ml
index c357ca41..189b1fd7 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -5274,7 +5274,7 @@ static void print_error (guestfs_h *g, void *data, const char *msg)
}
/* FIXME: nearly identical code appears in fish.c */
-static void print_strings (char const *const *argv)
+static void print_strings (char *const *argv)
{
int argc;
@@ -5869,7 +5869,7 @@ and generate_test_command_call ?(expect_error = false) ?test test_name cmd =
fun i str ->
pr " const char *%s_%d = \"%s\";\n" n i (c_quote str);
) strs;
- pr " const char *%s[] = {\n" n;
+ pr " const char *const %s[] = {\n" n;
iteri (
fun i _ -> pr " %s_%d,\n" n i
) strs;
@@ -5912,7 +5912,7 @@ and generate_test_command_call ?(expect_error = false) ?test test_name cmd =
| FileIn _, arg | FileOut _, arg ->
pr ", \"%s\"" (c_quote arg)
| StringList n, _ | DeviceList n, _ ->
- pr ", %s" n
+ pr ", (char **) %s" n
| Int _, arg ->
let i =
try int_of_string arg
@@ -9019,7 +9019,7 @@ and generate_bindtests () =
#define safe_malloc guestfs_safe_malloc
static void
-print_strings (char * const* const argv)
+print_strings (char *const *argv)
{
int argc;