From: Richard W.M. Jones Date: Mon, 29 Jun 2009 10:18:19 +0000 (+0100) Subject: Prevent 'n' being used as a parameter name. X-Git-Tag: 1.0.54~15 X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=commitdiff_plain;h=5af058b7d02607dcbcfb8f561cc0b8fec9a7d305;ds=sidebyside Prevent 'n' being used as a parameter name. Parameters named 'n' sometimes break the Perl bindings, so check for this in the generator and prevent it. --- diff --git a/src/generator.ml b/src/generator.ml index ccd68cf..aecb152 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -2173,7 +2173,7 @@ or data on the filesystem."); This resizes (expands or shrinks) an existing LVM physical volume to match the new size of the underlying device."); - ("sfdisk_N", (RErr, [String "device"; Int "n"; + ("sfdisk_N", (RErr, [String "device"; Int "partnum"; Int "cyls"; Int "heads"; Int "sectors"; String "line"]), 99, [DangerWillRobinson], [], @@ -2780,8 +2780,8 @@ let check_functions () = failwithf "%s has a param/ret called 'value', which causes conflicts in the OCaml bindings, use something like 'val' or a more descriptive name" name; if n = "int" || n = "char" || n = "short" || n = "long" then failwithf "%s has a param/ret which conflicts with a C type (eg. 'int', 'char' etc.)" name; - if n = "i" then - failwithf "%s has a param/ret called 'i', which will cause some conflicts in the generated code" name; + if n = "i" || n = "n" then + failwithf "%s has a param/ret called 'i' or 'n', which will cause some conflicts in the generated code" name; if n = "argv" || n = "args" then failwithf "%s has a param/ret called 'argv' or 'args', which will cause some conflicts in the generated code" name in