From fee26ee231d22481a93176b29a9629c780b45dc3 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 14 Aug 2009 19:33:35 +0200 Subject: [PATCH] generator.ml: don't emit unused functions * src/generator.ml: Use "rstructs_used" to emit definitions only for put_TYPE_list functions that are used. --- src/generator.ml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/generator.ml b/src/generator.ml index 4fb9e4f..85344aa 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -7516,9 +7516,17 @@ py_guestfs_close (PyObject *self, PyObject *args) pr "};\n"; pr "\n"; - emit_put_list_function typ ) structs; + (* Emit a put_TYPE_list function definition only if that function is used. *) + List.iter ( + function + | typ, (RStructListOnly | RStructAndList) -> + (* generate the function for typ *) + emit_put_list_function typ + | typ, _ -> () (* empty *) + ) rstructs_used; + (* Python wrapper functions. *) List.iter ( fun (name, style, _, _, _, _, _) -> -- 1.8.3.1