summaryrefslogtreecommitdiffstats
path: root/src/generator.ml
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-08-11 11:56:33 +0200
committerJim Meyering <meyering@redhat.com>2009-08-13 14:45:34 +0200
commit752147a1da4b1c2381ecba301627427c82b8d8a4 (patch)
treeb72075743d6b872f9e0eec4689c8144b46565ea1 /src/generator.ml
parenta4d2e6df0bbbd7dc9e5bf400e4e35efec0a18ff0 (diff)
downloadlibguestfs-752147a1da4b1c2381ecba301627427c82b8d8a4.tar.gz
libguestfs-752147a1da4b1c2381ecba301627427c82b8d8a4.tar.xz
libguestfs-752147a1da4b1c2381ecba301627427c82b8d8a4.zip
generator.ml: emit "const char *" for Device and String params
* src/generator.ml: Emit "const char *", not "char *" for Device and String params, now that the non-const code is hoisted into the calling code in stubs.c.
Diffstat (limited to 'src/generator.ml')
-rwxr-xr-xsrc/generator.ml12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/generator.ml b/src/generator.ml
index e3453a3a..e27d011f 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -4725,11 +4725,9 @@ and generate_daemon_actions () =
pr " struct guestfs_%s_args args;\n" name;
List.iter (
function
- (* Note we allow the string to be writable, in order to
- * allow device name translation. This is safe because
- * we can modify the string (passed from RPC).
- *)
- | Device n | String n
+ (* FIXME: eventually, make String "const", too *)
+ | Device n -> pr " const char *%s;\n" n
+ | String n
| OptString n -> pr " char *%s;\n" n
| StringList n -> pr " char **%s;\n" n
| Bool n -> pr " int %s;\n" n
@@ -6278,8 +6276,7 @@ and generate_prototype ?(extern = true) ?(static = false) ?(semicolon = true)
| String n
| OptString n ->
next ();
- if not in_daemon then pr "const char *%s" n
- else pr "char *%s" n
+ pr "const char *%s" n
| StringList n ->
next ();
if not in_daemon then pr "char * const* const %s" n
@@ -6819,6 +6816,7 @@ DESTROY (g)
iteri (
fun i ->
function
+ (* FIXME: ? *)
| Device n | String n | FileIn n | FileOut n -> pr " char *%s;\n" n
| OptString n ->
(* http://www.perlmonks.org/?node_id=554277