git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4b940d1
)
generator.ml: don't emit unused functions
author
Jim Meyering
<meyering@redhat.com>
Fri, 14 Aug 2009 17:33:35 +0000
(19:33 +0200)
committer
Jim Meyering
<meyering@redhat.com>
Fri, 14 Aug 2009 18:41:13 +0000
(20:41 +0200)
* src/generator.ml: Use "rstructs_used" to emit definitions only for
put_TYPE_list functions that are used.
src/generator.ml
patch
|
blob
|
history
diff --git
a/src/generator.ml
b/src/generator.ml
index
4fb9e4f
..
85344aa
100755
(executable)
--- 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, _, _, _, _, _) ->