From f5a1df4a18585e2e171608754f01ed61178b1450 Mon Sep 17 00:00:00 2001 From: David Howells Date: Tue, 13 May 2014 17:23:37 +0100 Subject: [PATCH] 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 --- rxgen/emit_py_sync_funcs.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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"; } -- 2.50.1