]> xenbits.xensource.com Git - people/aperard/libvirt.git/commitdiff
rpcgen: Pass 3 arguments to xdrproc_t calls
authorAndrea Bolognani <abologna@redhat.com>
Thu, 30 Nov 2023 10:03:10 +0000 (11:03 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Fri, 1 Dec 2023 12:50:16 +0000 (13:50 +0100)
The test_demo program currently fails to compile on macOS with

  too few arguments to function call, expected 3, have 2
      ret = !!proc(&xdr, vorig);
              ~~~~            ^

Way back in 2013, commit 9fa3a8ab6fd8 handled this situation
for the main library code. Apply the same fix here.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
scripts/rpcgen/tests/test_demo.c

index a48ceccd582c15031e3dd08d8ce248cf2b21dccf..931f25f9829d49c66e24bd63b0e0e5705555d0b7 100644 (file)
@@ -22,7 +22,7 @@ static void test_xdr(xdrproc_t proc, void *vorig, void *vnew, const char *testna
     /* Step 1:  serialize the vorig and compare to the data in test .bin files */
     xdrmem_create(&xdr, buf, buflen, XDR_ENCODE);
 
-    ret = !!proc(&xdr, vorig);
+    ret = !!proc(&xdr, vorig, 0);
     g_assert_cmpint(ret, ==, !fail);
 
     if (fail)
@@ -49,7 +49,7 @@ static void test_xdr(xdrproc_t proc, void *vorig, void *vnew, const char *testna
     /* Step 2: de-serialize the state to create a new object */
     xdrmem_create(&xdr, buf, buflen, XDR_DECODE);
 
-    ret = !!proc(&xdr, vnew);
+    ret = !!proc(&xdr, vnew, 0);
     g_assert_cmpint(ret, ==, true);
 
     actlen = xdr_getpos(&xdr);
@@ -63,7 +63,7 @@ static void test_xdr(xdrproc_t proc, void *vorig, void *vnew, const char *testna
 
     xdrmem_create(&xdr, buf, buflen, XDR_ENCODE);
 
-    ret = !!proc(&xdr, vnew);
+    ret = !!proc(&xdr, vnew, 0);
     g_assert_cmpint(ret, ==, true);
 
     actlen = xdr_getpos(&xdr);