From c132e0f7120dd78ebdbe4cc0d358941ede1cadab Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 23 May 2008 07:59:00 +0000 Subject: [PATCH] Fix type-punning warning in remote code. * qemud/rpcgen_fix.pl: Case-insensitive string match on identifiers. * qemud/remote_protocol.c: Update this generated file. --- ChangeLog | 6 ++++++ qemud/remote_protocol.c | 3 ++- qemud/rpcgen_fix.pl | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6cdd50f3f7..dd0abb82d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri May 23 08:54:00 BST 2008 Richard W.M. Jones + + Fix type-punning warning in remote code. + * qemud/rpcgen_fix.pl: Case-insensitive string match on identifiers. + * qemud/remote_protocol.c: Update this generated file. + Thu May 22 19:47:29 EST 2008 Daniel P. Berrange * src/qparams.c: Support ; as a param separator. Misc memory diff --git a/qemud/remote_protocol.c b/qemud/remote_protocol.c index 702846f71b..e2eeaaea10 100644 --- a/qemud/remote_protocol.c +++ b/qemud/remote_protocol.c @@ -400,8 +400,9 @@ xdr_remote_node_get_cells_free_memory_args (XDR *xdrs, remote_node_get_cells_fre bool_t xdr_remote_node_get_cells_free_memory_ret (XDR *xdrs, remote_node_get_cells_free_memory_ret *objp) { + char **objp_cpp0 = (char **) (void *) &objp->freeMems.freeMems_val; - if (!xdr_array (xdrs, (char **)&objp->freeMems.freeMems_val, (u_int *) &objp->freeMems.freeMems_len, REMOTE_NODE_MAX_CELLS, + if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->freeMems.freeMems_len, REMOTE_NODE_MAX_CELLS, sizeof (quad_t), (xdrproc_t) xdr_quad_t)) return FALSE; return TRUE; diff --git a/qemud/rpcgen_fix.pl b/qemud/rpcgen_fix.pl index b94547a7ef..5b329e2ed0 100644 --- a/qemud/rpcgen_fix.pl +++ b/qemud/rpcgen_fix.pl @@ -46,7 +46,7 @@ while (<>) { my %uses = (); my $i = 0; foreach (@function) { - $uses{$1} = $i++ if m/\(char \*\*\)\&(objp->[a-z_.]+_val)/; + $uses{$1} = $i++ if m/\(char \*\*\)\&(objp->[a-z_.]+_val)/i; } if (keys %uses >= 1) { my $i = 1; @@ -59,7 +59,7 @@ while (<>) { } @function = map { s{\(char \*\*\)\&(objp->[a-z_.]+_val)} - {objp_cpp$uses{$1}}g; $_ } @function; + {objp_cpp$uses{$1}}gi; $_ } @function; } # The code uses 'IXDR_PUT_{U_,}LONG' but it's wrong in two