]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
pybind: Fix C type errors in Cython-generated Python bindings 54974/head
authorFlorian Weimer <fweimer@redhat.com>
Wed, 20 Dec 2023 13:59:19 +0000 (14:59 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 8 Jan 2024 11:04:16 +0000 (12:04 +0100)
commita49d154f4a8e493baf2296a15c7b5c56cd25e993
treeca589ba0df536522ee688f8eff781f3d1e8d4320
parentf9aea9105b6c1a8d7bff0ec0675f84f2ffb1db6f
pybind: Fix C type errors in Cython-generated Python bindings

Several Ceph APIs use bool * types, which correspond to
libcpp.bool * types in Cython.  The bint type has an incorrect
size 4 and cannot be used as a replacement.

This prevents a compilation failure with future compilers:

…-build/src/pybind/rbd/rbd.c: In function ‘__pyx_pf_3rbd_3RBD_104namespace_exists’:
…-build/src/pybind/rbd/rbd.c:42165:76: error: passing argument 3 of ‘rbd_namespace_exists’ from incompatible pointer type
42165 |         __pyx_v_ret = rbd_namespace_exists(__pyx_v__ioctx, __pyx_v__name, (&__pyx_v__exists));
      |                                                                           ~^~~~~~~~~~~~~~~~~
      |                                                                            |
      |                                                                            int *
In file included from …-build/src/pybind/rbd/rbd.c:1268:
…/src/include/rbd/librbd.h:1496:45: note: expected ‘_Bool *’ but argument is of type ‘int *’
 1496 |                                       bool *exists);
      |                                             ^

Signed-off-by: Florian Weimer <fweimer@redhat.com>
src/pybind/rbd/c_rbd.pxd
src/pybind/rbd/mock_rbd.pxi
src/pybind/rbd/rbd.pyx
src/pybind/rgw/mock_rgw.pxi
src/pybind/rgw/rgw.pyx