docs: Indent *_va and *_argv functions correctly.
authorRichard W.M. Jones <rjones@redhat.com>
Wed, 3 Nov 2010 22:11:22 +0000 (22:11 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Fri, 5 Nov 2010 14:45:29 +0000 (14:45 +0000)
This fixes commit f661db2c393d1b7e4211c55682b7fac82a70e36d.
(cherry picked from commit 19ea54b3f488755731ffc079519d6011dade9e5c)

generator/generator_c.ml

index 6eff7a0..7f1b377 100644 (file)
@@ -84,9 +84,11 @@ let rec generate_prototype ?(extern = true) ?(static = false)
     let next () =
       if !comma then (
         if single_line then pr ", "
-        else
-          pr ",\n%s%s"
-            indent (spaces (String.length prefix + String.length name + 2))
+        else (
+          let namelen = String.length prefix + String.length name +
+                        String.length suffix + 2 in
+          pr ",\n%s%s" indent (spaces namelen)
+        )
       );
       comma := true
     in
@@ -256,16 +258,14 @@ L</KEYS AND PASSPHRASES> for more information.\n\n";
         (* Handling of optional argument variants. *)
         if optargs <> [] then (
           pr "=head2 %s_va\n\n" name;
-          pr " ";
-          generate_prototype ~extern:false ~handle:"g"
+          generate_prototype ~extern:false ~indent:" " ~handle:"g"
             ~prefix:"guestfs_" ~suffix:"_va" ~optarg_proto:VA
             shortname style;
           pr "\n\n";
           pr "This is the \"va_list variant\" of L</%s>.\n\n" name;
           pr "See L</CALLS WITH OPTIONAL ARGUMENTS>.\n\n";
           pr "=head2 %s_argv\n\n" name;
-          pr " ";
-          generate_prototype ~extern:false ~handle:"g"
+          generate_prototype ~extern:false ~indent:" " ~handle:"g"
             ~prefix:"guestfs_" ~suffix:"_argv" ~optarg_proto:Argv
             shortname style;
           pr "\n\n";