[libvirt] [DRAFT PATCHv5 9/9] rpc: removes the removal of unused variable i

Hu Tao hutao at cn.fujitsu.com
Tue Dec 20 08:35:04 UTC 2011


the removal of unused variable i also removes codes like
this:

if (!xdr_int (xdrs, &objp->remote_typed_param_value_u.i))

which should not be removed.

Sorry I'm not familiar with perl and can't find a perfect way
to deal with this.

---
 src/rpc/genprotocol.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/rpc/genprotocol.pl b/src/rpc/genprotocol.pl
index 7af1b3b..cec93d8 100755
--- a/src/rpc/genprotocol.pl
+++ b/src/rpc/genprotocol.pl
@@ -72,7 +72,7 @@ while (<RPCGEN>) {
 
 	# Remove decl of i, if i isn't used in the function.
 	@uses = grep /\bi\b/, @function;
-	@function = grep !/\bi\b/, @function if @uses == 1;
+        #@function = grep !/\bi\b/, @function if @uses == 1;
 
 	# (char **)&objp->... gives:
 	# warning: dereferencing type-punned pointer will break
-- 
1.7.4.4




More information about the libvir-list mailing list