From: David Howells Date: Tue, 13 May 2014 16:23:37 +0000 (+0100) Subject: rxgen: Handle bulk arguments correctly X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=f5a1df4a18585e2e171608754f01ed61178b1450;p=users%2Fdhowells%2Fkafs-utils.git rxgen: Handle bulk arguments correctly Need to check for a bulk-class argument of an integer-type before testing for the integer-type otherwise the integer-type is selected. This causes the wrong argument spec to be emitted for PyArg_ParseTuple() when decoding the arguments for an RPC call to be issued. Signed-off-by: David Howells --- diff --git a/rxgen/emit_py_sync_funcs.pm b/rxgen/emit_py_sync_funcs.pm index ba2a8a0..09a87d5 100644 --- a/rxgen/emit_py_sync_funcs.pm +++ b/rxgen/emit_py_sync_funcs.pm @@ -282,6 +282,7 @@ sub emit_py_func_simple_sync_call($) foreach my $p (@{$func->{request}}) { if ($p->{dir} ne "IN") { print PYOUT "O!"; + } elsif ($p->{class} eq "bulk") { print PYOUT "O!"; } elsif ($p->{type} eq "int8_t") { print PYOUT "B"; } elsif ($p->{type} eq "int16_t") { print PYOUT "h"; } elsif ($p->{type} eq "int32_t") { print PYOUT "i"; @@ -295,8 +296,6 @@ sub emit_py_func_simple_sync_call($) print PYOUT "s*"; } elsif ($p->{class} eq "blob" && $p->{elem}->{class} eq "opaque") { print PYOUT "z*"; - } elsif ($p->{class} eq "bulk") { - print PYOUT "O!"; } else { die $p->{where}, ": No py parse for param"; }