[Pkg-libvirt-commits] [libguestfs] 211/233: gobject: Clean up some warnings about unused variables.
Hilko Bengen
bengen at moszumanska.debian.org
Wed Feb 19 21:12:25 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch experimental
in repository libguestfs.
commit e74c957a2b2a293290b54e23fb5a7b16f845917b
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Thu Feb 13 15:24:57 2014 +0000
gobject: Clean up some warnings about unused variables.
---
generator/gobject.ml | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/generator/gobject.ml b/generator/gobject.ml
index 82eb8ae..4a06e08 100644
--- a/generator/gobject.ml
+++ b/generator/gobject.ml
@@ -452,8 +452,17 @@ let generate_gobject_optargs_source filename name optargs f () =
pr "static void\nguestfs_%s_finalize (GObject *object)\n" name;
pr "{\n";
- pr " %s *self = GUESTFS_%s (object);\n" camel_name uc_name;
- pr " %sPrivate *priv = self->priv;\n\n" camel_name;
+
+ let needs_priv = List.exists (function
+ | OString _ -> true
+ | OStringList _ | OBool _ | OInt _ | OInt64 _ -> false
+ ) optargs in
+
+ if needs_priv then (
+ pr " %s *self = GUESTFS_%s (object);\n" camel_name uc_name;
+ pr " %sPrivate *priv = self->priv;\n" camel_name;
+ pr "\n";
+ );
List.iter (
function
@@ -462,7 +471,6 @@ let generate_gobject_optargs_source filename name optargs f () =
| OStringList n -> () (* XXX *)
| OBool _ | OInt _ | OInt64 _ -> ()
) optargs;
- pr "\n";
pr " G_OBJECT_CLASS (guestfs_%s_parent_class)->finalize (object);\n" name;
pr "}\n\n";
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list