Trivially factor out the "num_args" value, for making a subsequent patch
easier to review.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172516
Signed-off-by: Laszlo Ersek <ler...@redhat.com>
---
 generator/OCaml.ml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/generator/OCaml.ml b/generator/OCaml.ml
index c49a1f203b9c..a854afd56171 100644
--- a/generator/OCaml.ml
+++ b/generator/OCaml.ml
@@ -798,14 +798,15 @@ let
   pr "}\n";
   pr "\n";
 
-  if num_params args optargs > 5 then (
+  let num_args = num_params args optargs in
+  if num_args > 5 then (
     pr "/* Byte-code compat function because this method has > 5 
parameters.\n";
     pr " */\n";
     pr "value\n";
     pr "nbd_internal_ocaml_nbd_%s_byte (value *argv, int argn)\n" name;
     pr "{\n";
     pr "  return nbd_internal_ocaml_nbd_%s (" name;
-    for i = 0 to num_params args optargs - 1 do
+    for i = 0 to num_args - 1 do
       if i > 0 then pr ", ";
       pr "argv[%d]" i
     done;

_______________________________________________
Libguestfs mailing list
Libguestfs@redhat.com
https://listman.redhat.com/mailman/listinfo/libguestfs

Reply via email to