[libvirt PATCH] rpcgen: Pass 3 arguments to xdrproc_t calls

Andrea Bolognani posted 1 patch 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20231130100635.804286-1-abologna@redhat.com
scripts/rpcgen/tests/test_demo.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[libvirt PATCH] rpcgen: Pass 3 arguments to xdrproc_t calls
Posted by Andrea Bolognani 5 months ago
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>
---
 scripts/rpcgen/tests/test_demo.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/rpcgen/tests/test_demo.c b/scripts/rpcgen/tests/test_demo.c
index a48ceccd58..931f25f982 100644
--- a/scripts/rpcgen/tests/test_demo.c
+++ b/scripts/rpcgen/tests/test_demo.c
@@ -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);
-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [libvirt PATCH] rpcgen: Pass 3 arguments to xdrproc_t calls
Posted by Daniel P. Berrangé 4 months, 4 weeks ago
On Thu, Nov 30, 2023 at 11:06:35AM +0100, Andrea Bolognani wrote:
> 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>
> ---
>  scripts/rpcgen/tests/test_demo.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org