btrfs-progs/libbtrfsutil/python
Qu Wenruo 425c950cc6 libbtrfsutil: Convert to designated initialization for QgroupInherit_type
[BUG]
When compiling btrfs-progs with libbtrfsutil on a python3.8 system, we
got the following warning:

  qgroup.c:110:2: warning: initialization of ‘long int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
    110 |  NULL,     /* tp_print */
        |  ^~~~
  qgroup.c:110:2: note: (near initialization for ‘QgroupInherit_type.tp_vectorcall_offset’)

[CAUSE]
C definition of PyTypeObject changed in python 3.8.
Now at the old tp_print, we have tp_vectorcall_offset.

So we got above warning.

[FIX]
C has designated initialization, which can assign values to each named
member, without hard coding to match the offset.
And all the other uninitialized values will be set to 0, so we can save
a lot of unneeded "= 0" or "= NULL" lines.

Just use that awesome feature to avoid any future breakage.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2019-11-22 19:09:51 +01:00
..
tests libbtrfsutil: don't close fd on error in btrfs_util_subvolume_id_fd() 2019-04-26 18:23:27 +02:00
.gitignore
btrfsutilpy.h libbtrfsutil: add btrfs_util_deleted_subvolumes() 2018-03-06 11:28:37 +01:00
error.c libbtrfsutil: Convert to designated initialization for BtrfsUtilError_type 2019-11-22 19:09:51 +01:00
filesystem.c libbtrfsutil: add filesystem sync helpers 2018-02-24 01:37:17 +01:00
module.c libbtrfsutil: document qgroup_inherit parameter in Python bindings 2018-11-26 16:45:18 +01:00
qgroup.c libbtrfsutil: Convert to designated initialization for QgroupInherit_type 2019-11-22 19:09:51 +01:00
setup.py libbtrfsutil: add btrfs_util_is_subvolume() and btrfs_util_subvolume_id() 2018-03-06 11:28:36 +01:00
subvolume.c libbtrfsutil: change async parameters to async_ in Python bindings 2018-11-26 16:45:14 +01:00