Jim Meyering
2009-Aug-17 18:44 UTC
[Libguestfs] [PATCH libguestfs] generator.ml: do not emit unused print_* functions
One final set: cmds.c:968:13: warning: 'print_lvm_pv' defined but not used cmds.c:1012:13: warning: 'print_lvm_vg' defined but not used cmds.c:1055:13: warning: 'print_lvm_lv' defined but not used cmds.c:1142:13: warning: 'print_dirent' defined but not used cmds.c:1196:13: warning: 'print_xattr' defined but not used cmds.c:1220:13: warning: 'print_inotify_event' defined but not used Don't generate them:>From 66e9d6832a19140c8b79b6be4c16c1fcac22207c Mon Sep 17 00:00:00 2001From: Jim Meyering <meyering at redhat.com> Date: Mon, 17 Aug 2009 20:44:01 +0200 Subject: [PATCH libguestfs] generator.ml: do not emit unused print_* functions * src/generator.ml: Do not emit functions like print_xattr, print_lvm_vg, print_inotify_event, that are not used. --- src/generator.ml | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/generator.ml b/src/generator.ml index 1e717db..9f2b8cf 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -6129,11 +6129,6 @@ and generate_fish_cmds () ) cols; pr "}\n"; pr "\n"; - pr "static void print_%s (struct guestfs_%s *%s)\n" typ typ typ; - pr "{\n"; - pr " print_%s_indent (%s, \"\");\n" typ typ; - pr "}\n"; - pr "\n"; ) structs; (* Emit a print_TYPE_list function definition only if that function is used. *) @@ -6145,6 +6140,18 @@ and generate_fish_cmds () | typ, _ -> () (* empty *) ) rstructs_used; + (* Emit a print_TYPE function definition only if that function is used. *) + List.iter ( + function + | typ, RStructOnly -> + pr "static void print_%s (struct guestfs_%s *%s)\n" typ typ typ; + pr "{\n"; + pr " print_%s_indent (%s, \"\");\n" typ typ; + pr "}\n"; + pr "\n"; + | typ, _ -> () (* empty *) + ) rstructs_used; + (* run_<action> actions *) List.iter ( fun (name, style, _, flags, _, _, _) -> -- 1.6.4.378.g88f2f
Richard W.M. Jones
2009-Aug-18 08:01 UTC
[Libguestfs] [PATCH libguestfs] generator.ml: do not emit unused print_* functions
On Mon, Aug 17, 2009 at 08:44:47PM +0200, Jim Meyering wrote:> One final set: > > cmds.c:968:13: warning: 'print_lvm_pv' defined but not used > cmds.c:1012:13: warning: 'print_lvm_vg' defined but not used > cmds.c:1055:13: warning: 'print_lvm_lv' defined but not used > cmds.c:1142:13: warning: 'print_dirent' defined but not used > cmds.c:1196:13: warning: 'print_xattr' defined but not used > cmds.c:1220:13: warning: 'print_inotify_event' defined but not used > > Don't generate them:ACK. Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 75 OCaml packages (the OPEN alternative to F#) http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora