]> www.infradead.org Git - users/dhowells/kafs-utils.git/commitdiff
rxgen: Handle bulk arguments correctly
authorDavid Howells <dhowells@redhat.com>
Tue, 13 May 2014 16:23:37 +0000 (17:23 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 13 May 2014 16:36:35 +0000 (17:36 +0100)
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 <dhowells@redhat.com>
rxgen/emit_py_sync_funcs.pm

index ba2a8a00bae1b005bbabb54ebf20a0b608979d00..09a87d5b372c11cbc8f4db40b5e4db2344a02e90 100644 (file)
@@ -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";
        }