Re: [PATCH 00/35] Use more of GLib's macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/14/19 3:15 PM, Ján Tomko wrote:
We do not need to define MIN and MAX if we include glib.h
and it also provides some macros for __attribute__'s

Ján Tomko (35):
   util: remove MIN and MAX macros
   apibuild: ignore GLib macros too
   use G_GNUC_NORETURN instead of ATTRIBUTE_NORETURN
   use G_GNUC_NULL_TERMINATED instead of ATTRIBUTE_SENTINEL
   Use G_GNUC_WARN_UNUSED_RESULT instead of ATTRIBUTE_RETURN_CHECK
   examples: use G_GNUC_UNUSED
   access: use G_GNUC_UNUSED
   admin: use G_GNUC_UNUSED
   bhyve: use G_GNUC_UNUSED
   conf: use G_GNUC_UNUSED
   cpu: use G_GNUC_UNUSED
   esx: use G_GNUC_UNUSED
   libxl: use G_GNUC_UNUSED
   locking: use G_GNUC_UNUSED
   logging: use G_GNUC_UNUSED
   lxc: use G_GNUC_UNUSED
   network: use G_GNUC_UNUSED
   node_device: use G_GNUC_UNUSED
   nwfilter: use G_GNUC_UNUSED
   openvz: use G_GNUC_UNUSED
   qemu: use G_GNUC_UNUSED
   remote: use G_GNUC_UNUSED
   rpc: use G_GNUC_UNUSED
   security: use G_GNUC_UNUSED
   storage: use G_GNUC_UNUSED
   test: use G_GNUC_UNUSED
   tests: use G_GNUC_UNUSED
   tools: use G_GNUC_UNUSED
   util: use G_GNUC_UNUSED
   vbox: use G_GNUC_UNUSED
   vz: use G_GNUC_UNUSED
   Use G_GNUC_UNUSED everywhere
   syntax-check: check for G_GNUC_UNUSED instead of ATTRIBUTE_UNUSED
   gendispatch: generate G_GNUC_UNUSED instead of ATTRIBUTE_UNUSED
   internal: remove no longer used ATTRIBUTE macros

  build-aux/syntax-check.mk                 |  12 +-
  docs/apibuild.py                          |   4 +-
  examples/c/misc/event-test.c              | 140 +++----
  src/access/viraccessdrivernop.c           |  90 ++---
  src/access/viraccessdriverpolkit.c        |   4 +-
  src/admin/admin_remote.c                  |   4 +-
  src/admin/admin_server_dispatch.c         |  62 +--
  src/bhyve/bhyve_command.c                 |   6 +-
  src/bhyve/bhyve_device.c                  |   4 +-
  src/bhyve/bhyve_domain.c                  |  26 +-
  src/bhyve/bhyve_driver.c                  |  16 +-
  src/bhyve/bhyve_monitor.c                 |   2 +-
  src/bhyve/bhyve_parse_command.c           |   8 +-
  src/bhyve/bhyve_process.c                 |   2 +-
  src/conf/capabilities.c                   |   6 +-
  src/conf/device_conf.h                    |   2 +-
  src/conf/domain_addr.c                    |  22 +-
  src/conf/domain_audit.c                   |   2 +-
  src/conf/domain_capabilities.c            |   2 +-
  src/conf/domain_conf.c                    |  30 +-
  src/conf/domain_conf.h                    |  38 +-
  src/conf/domain_event.c                   |   2 +-
  src/conf/netdev_bandwidth_conf.h          |   2 +-
  src/conf/network_conf.c                   |  80 ++--
  src/conf/node_device_conf.c               |  10 +-
  src/conf/nwfilter_conf.c                  |  50 +--
  src/conf/nwfilter_params.c                |   2 +-
  src/conf/object_event.c                   |   2 +-
  src/conf/virchrdev.c                      |  10 +-
  src/conf/virdomaincheckpointobjlist.c     |   2 +-
  src/conf/virdomainmomentobjlist.c         |   6 +-
  src/conf/virdomainobjlist.c               |  12 +-
  src/conf/virinterfaceobj.c                |  10 +-
  src/conf/virnetworkobj.c                  |  18 +-
  src/conf/virnetworkobj.h                  |   2 +-
  src/conf/virnodedeviceobj.c               |  16 +-
  src/conf/virnwfilterbindingobjlist.c      |   4 +-
  src/conf/virsecretobj.c                   |   8 +-
  src/conf/virstorageobj.c                  |  22 +-
  src/cpu/cpu_arm.c                         |  14 +-
  src/cpu/cpu_ppc64.c                       |  10 +-
  src/cpu/cpu_s390.c                        |   6 +-
  src/cpu/cpu_x86.c                         |   4 +-
  src/driver.h                              |  18 +-
  src/esx/esx_driver.c                      |  32 +-
  src/esx/esx_interface_driver.c            |  10 +-
  src/esx/esx_network_driver.c              |  16 +-
  src/esx/esx_storage_backend_iscsi.c       |  16 +-
  src/esx/esx_storage_driver.c              |  16 +-
  src/esx/esx_vi.c                          |  20 +-
  src/esx/esx_vi_types.c                    |   4 +-
  src/hyperv/hyperv_driver.c                |  12 +-
  src/hyperv/hyperv_wmi.c                   |   2 +-
  src/interface/interface_backend_netcf.c   |  16 +-
  src/interface/interface_backend_udev.c    |  26 +-
  src/internal.h                            |  31 --
  src/libvirt.c                             |   8 +-
  src/libxl/libxl_conf.h                    |   2 +-
  src/libxl/libxl_domain.c                  |  26 +-
  src/libxl/libxl_domain.h                  |   4 +-
  src/libxl/libxl_driver.c                  |  70 ++--
  src/libxl/libxl_logger.c                  |  14 +-
  src/libxl/libxl_migration.c               |  12 +-
  src/locking/lock_daemon.c                 |  20 +-
  src/locking/lock_daemon_config.c          |   2 +-
  src/locking/lock_daemon_dispatch.c        |  32 +-
  src/locking/lock_driver_lockd.c           |   8 +-
  src/locking/lock_driver_nop.c             |  48 +--
  src/locking/lock_driver_sanlock.c         |  10 +-
  src/locking/lock_manager.c                |  10 +-
  src/locking/sanlock_helper.c              |   6 +-
  src/logging/log_daemon.c                  |  18 +-
  src/logging/log_daemon_config.c           |   2 +-
  src/logging/log_daemon_dispatch.c         |  22 +-
  src/logging/log_handler.c                 |   6 +-
  src/lxc/lxc_cgroup.c                      |   4 +-
  src/lxc/lxc_container.c                   |  12 +-
  src/lxc/lxc_controller.c                  |   4 +-
  src/lxc/lxc_domain.c                      |  26 +-
  src/lxc/lxc_domain.h                      |   2 +-
  src/lxc/lxc_driver.c                      |  18 +-
  src/lxc/lxc_fuse.c                        |  26 +-
  src/lxc/lxc_monitor.c                     |  12 +-
  src/lxc/lxc_process.c                     |   4 +-
  src/network/bridge_driver.c               |  26 +-
  src/network/bridge_driver_linux.c         |   2 +-
  src/network/bridge_driver_nop.c           |  12 +-
  src/network/leaseshelper.c                |   2 +-
  src/node_device/node_device_driver.c      |  14 +-
  src/node_device/node_device_hal.c         |  18 +-
  src/node_device/node_device_udev.c        |  20 +-
  src/nwfilter/nwfilter_dhcpsnoop.c         |  20 +-
  src/nwfilter/nwfilter_driver.c            |  22 +-
  src/nwfilter/nwfilter_ebiptables_driver.c |  12 +-
  src/nwfilter/nwfilter_gentech_driver.c    |   2 +-
  src/nwfilter/nwfilter_learnipaddr.c       |  12 +-
  src/nwfilter/nwfilter_learnipaddr.h       |   2 +-
  src/openvz/openvz_driver.c                |  92 ++---
  src/phyp/phyp_driver.c                    |  34 +-
  src/qemu/qemu_agent.c                     |   2 +-
  src/qemu/qemu_block.c                     |   6 +-
  src/qemu/qemu_block.h                     |   4 +-
  src/qemu/qemu_blockjob.c                  |   4 +-
  src/qemu/qemu_blockjob.h                  |   2 +-
  src/qemu/qemu_capabilities.c              |   4 +-
  src/qemu/qemu_cgroup.c                    |   2 +-
  src/qemu/qemu_cgroup.h                    |   4 +-
  src/qemu/qemu_checkpoint.c                |   2 +-
  src/qemu/qemu_command.c                   |   8 +-
  src/qemu/qemu_conf.c                      |   4 +-
  src/qemu/qemu_domain.c                    |  94 ++---
  src/qemu/qemu_domain.h                    |  24 +-
  src/qemu/qemu_domain_address.c            |  30 +-
  src/qemu/qemu_driver.c                    |  64 ++--
  src/qemu/qemu_extdevice.h                 |   8 +-
  src/qemu/qemu_hotplug.c                   |   4 +-
  src/qemu/qemu_migration.c                 |   6 +-
  src/qemu/qemu_migration.h                 |   2 +-
  src/qemu/qemu_migration_cookie.c          |   2 +-
  src/qemu/qemu_monitor.c                   |   4 +-
  src/qemu/qemu_monitor_json.c              |  20 +-
  src/qemu/qemu_process.c                   |  84 ++--
  src/qemu/qemu_qapi.c                      |   2 +-
  src/qemu/qemu_tpm.h                       |   8 +-
  src/qemu/qemu_vhost_user_gpu.h            |   6 +-
  src/remote/remote_daemon.c                |  20 +-
  src/remote/remote_daemon_config.c         |   2 +-
  src/remote/remote_daemon_dispatch.c       | 444 +++++++++++-----------
  src/remote/remote_daemon_stream.c         |   2 +-
  src/remote/remote_driver.c                | 270 ++++++-------
  src/rpc/gendispatch.pl                    |   8 +-
  src/rpc/virkeepalive.c                    |   2 +-
  src/rpc/virnetclientprogram.c             |   4 +-
  src/rpc/virnetclientstream.c              |   4 +-
  src/rpc/virnetdaemon.c                    |  22 +-
  src/rpc/virnetlibsshsession.c             |   2 +-
  src/rpc/virnetmessage.h                   |  14 +-
  src/rpc/virnetsaslcontext.c               |   6 +-
  src/rpc/virnetserverprogram.c             |   2 +-
  src/rpc/virnetserverservice.c             |   2 +-
  src/rpc/virnetsocket.c                    |  90 ++---
  src/rpc/virnetsshsession.c                |   8 +-
  src/rpc/virnettlscontext.c                |   4 +-
  src/secret/secret_driver.c                |  16 +-
  src/secret/secret_util.h                  |   2 +-
  src/security/security_apparmor.c          |  88 ++---
  src/security/security_dac.c               | 114 +++---
  src/security/security_manager.c           |   6 +-
  src/security/security_nop.c               | 174 ++++-----
  src/security/security_selinux.c           |  54 +--
  src/security/security_stack.c             |   8 +-
  src/security/security_util.c              |   6 +-
  src/security/virt-aa-helper.c             |   4 +-
  src/storage/storage_backend.c             |   2 +-
  src/storage/storage_backend_disk.c        |   6 +-
  src/storage/storage_backend_fs.c          |   4 +-
  src/storage/storage_backend_logical.c     |   4 +-
  src/storage/storage_backend_mpath.c       |   2 +-
  src/storage/storage_backend_rbd.c         |  22 +-
  src/storage/storage_backend_zfs.c         |   4 +-
  src/storage/storage_driver.c              |  22 +-
  src/storage/storage_driver.h              |   2 +-
  src/storage/storage_util.c                |  36 +-
  src/storage/storage_util.h                |   2 +-
  src/test/test_driver.c                    |  80 ++--
  src/util/iohelper.c                       |   2 +-
  src/util/viralloc.h                       |  14 +-
  src/util/viraudit.c                       |   8 +-
  src/util/virbitmap.h                      |  22 +-
  src/util/virbuffer.h                      |   2 +-
  src/util/vircgroup.c                      | 398 +++++++++----------
  src/util/vircgroupv1.c                    |   2 +-
  src/util/vircgroupv2.c                    |  14 +-
  src/util/vircommand.c                     |  48 +--
  src/util/vircommand.h                     |  22 +-
  src/util/vircrypto.h                      |   6 +-
  src/util/virdbus.c                        |  76 ++--
  src/util/virdevmapper.c                   |  14 +-
  src/util/virdnsmasq.c                     |   2 +-
  src/util/vireventpoll.c                   |   6 +-
  src/util/virfcp.c                         |   8 +-
  src/util/virfdstream.c                    |  10 +-
  src/util/virfile.c                        | 150 ++++----
  src/util/virfile.h                        |  72 ++--
  src/util/virfirewall.h                    |   4 +-
  src/util/virhash.c                        |   8 +-
  src/util/virhostcpu.c                     |  26 +-
  src/util/virhostmem.c                     |  16 +-
  src/util/virinitctl.c                     |   4 +-
  src/util/viriptables.h                    |  20 +-
  src/util/viriscsi.h                       |  12 +-
  src/util/virjson.c                        |  10 +-
  src/util/virjson.h                        |   6 +-
  src/util/virkeyfile.c                     |   2 +-
  src/util/virkeyfile.h                     |   4 +-
  src/util/virlockspace.c                   |   6 +-
  src/util/virlog.c                         |  38 +-
  src/util/virlog.h                         |   4 +-
  src/util/virmacaddr.h                     |   4 +-
  src/util/virmacmap.c                      |   4 +-
  src/util/virmdev.c                        |   4 +-
  src/util/virmodule.c                      |   2 +-
  src/util/virnetdev.c                      | 134 +++----
  src/util/virnetdev.h                      |  80 ++--
  src/util/virnetdevbandwidth.h             |  12 +-
  src/util/virnetdevbridge.c                |  58 +--
  src/util/virnetdevbridge.h                |  32 +-
  src/util/virnetdevip.c                    |  12 +-
  src/util/virnetdevip.h                    |   8 +-
  src/util/virnetdevmacvlan.c               | 100 ++---
  src/util/virnetdevmacvlan.h               |  18 +-
  src/util/virnetdevmidonet.h               |   4 +-
  src/util/virnetdevopenvswitch.c           |   2 +-
  src/util/virnetdevopenvswitch.h           |  20 +-
  src/util/virnetdevtap.c                   |  30 +-
  src/util/virnetdevtap.h                   |  16 +-
  src/util/virnetdevveth.h                  |   4 +-
  src/util/virnetdevvportprofile.c          |  28 +-
  src/util/virnetdevvportprofile.h          |   4 +-
  src/util/virnetlink.c                     |  92 ++---
  src/util/virnetlink.h                     |   2 +-
  src/util/virnodesuspend.c                 |   4 +-
  src/util/virnuma.c                        |  42 +-
  src/util/virobject.c                      |   2 +-
  src/util/virpci.c                         |  50 +--
  src/util/virpci.h                         |   2 +-
  src/util/virperf.c                        |  20 +-
  src/util/virpidfile.c                     |   2 +-
  src/util/virpidfile.h                     |  16 +-
  src/util/virpolkit.c                      |  14 +-
  src/util/virprocess.c                     |  40 +-
  src/util/virprocess.h                     |   4 +-
  src/util/virrandom.h                      |   2 +-
  src/util/virscsihost.c                    |  24 +-
  src/util/virsocketaddr.c                  |   2 +-
  src/util/virstoragefile.c                 |  26 +-
  src/util/virstring.c                      |   6 +-
  src/util/virstring.h                      |  40 +-
  src/util/virthread.h                      |  20 +-
  src/util/virthreadpool.h                  |   2 +-
  src/util/virtime.h                        |  14 +-
  src/util/virtypedparam.h                  |  20 +-
  src/util/virutil.c                        |  54 +--
  src/util/virutil.h                        |  25 +-
  src/util/viruuid.h                        |   2 +-
  src/util/virvhba.c                        |  34 +-
  src/util/virvsock.c                       |   4 +-
  src/util/virxml.c                         |   6 +-
  src/util/virxml.h                         |   4 +-
  src/vbox/vbox_MSCOMGlue.c                 | 100 ++---
  src/vbox/vbox_common.c                    |  38 +-
  src/vbox/vbox_driver.c                    |   4 +-
  src/vbox/vbox_storage.c                   |   4 +-
  src/vbox/vbox_tmpl.c                      |  92 ++---
  src/vmware/vmware_conf.c                  |   2 +-
  src/vmware/vmware_driver.c                |  32 +-
  src/vmx/vmx.c                             |  24 +-
  src/vz/vz_driver.c                        |  60 +--
  src/vz/vz_sdk.c                           |   8 +-
  src/vz/vz_utils.c                         |   2 +-
  src/vz/vz_utils.h                         |   2 +-
  tests/bhyvexml2argvmock.c                 |  36 +-
  tests/commandtest.c                       |  58 +--
  tests/domaincapstest.c                    |   2 +-
  tests/esxutilstest.c                      |   8 +-
  tests/eventtest.c                         |   2 +-
  tests/fchosttest.c                        |  12 +-
  tests/networkxml2firewalltest.c           |   8 +-
  tests/nsslinktest.c                       |   4 +-
  tests/nwfilterebiptablestest.c            |  14 +-
  tests/objecteventtest.c                   |  30 +-
  tests/openvzutilstest.c                   |   8 +-
  tests/qemuagenttest.c                     |   6 +-
  tests/qemucapsprobe.c                     |   2 +-
  tests/qemucpumock.c                       |   4 +-
  tests/qemufirmwaretest.c                  |   2 +-
  tests/qemumonitortestutils.c              |  22 +-
  tests/qemumonitortestutils.h              |   2 +-
  tests/qemusecuritymock.c                  |  18 +-
  tests/qemuvhostusertest.c                 |   2 +-
  tests/qemuxml2argvmock.c                  |  46 +--
  tests/qemuxml2argvtest.c                  |  10 +-
  tests/scsihosttest.c                      |   4 +-
  tests/securityselinuxtest.c               |   2 +-
  tests/shunloadhelper.c                    |   4 +-
  tests/shunloadtest.c                      |   2 +-
  tests/testutils.c                         |  24 +-
  tests/testutils.h                         |   4 +-
  tests/testutilsqemuschema.c               |   6 +-
  tests/utiltest.c                          |  12 +-
  tests/viralloctest.c                      |  14 +-
  tests/viratomictest.c                     |   4 +-
  tests/virbitmaptest.c                     |  24 +-
  tests/virbuftest.c                        |  16 +-
  tests/vircapstest.c                       |  10 +-
  tests/vircgrouptest.c                     |  32 +-
  tests/virconftest.c                       |  10 +-
  tests/virdbustest.c                       |  20 +-
  tests/virdeterministichashmock.c          |   2 +-
  tests/virendiantest.c                     |   4 +-
  tests/virerrortest.c                      |   2 +-
  tests/virfilecachemock.c                  |   2 +-
  tests/virfilecachetest.c                  |  10 +-
  tests/virfiletest.c                       |   6 +-
  tests/virfirewalltest.c                   |  36 +-
  tests/virhashtest.c                       |  30 +-
  tests/virhostdevtest.c                    |  10 +-
  tests/viridentitytest.c                   |   6 +-
  tests/viriscsitest.c                      |   6 +-
  tests/virjsontest.c                       |   4 +-
  tests/virkeycodetest.c                    |   4 +-
  tests/virkeyfiletest.c                    |   2 +-
  tests/virkmodtest.c                       |   2 +-
  tests/virlockspacetest.c                  |  14 +-
  tests/virmock.h                           |   2 +-
  tests/virnetdaemontest.c                  |   8 +-
  tests/virnetmessagetest.c                 |  10 +-
  tests/virnetserverclientmock.c            |  16 +-
  tests/virnetserverclienttest.c            |   6 +-
  tests/virnetsockettest.c                  |   8 +-
  tests/virnumamock.c                       |   2 +-
  tests/virpcimock.c                        |   2 +-
  tests/virpcitest.c                        |   8 +-
  tests/virpolkittest.c                     |  12 +-
  tests/virportallocatormock.c              |   4 +-
  tests/virportallocatortest.c              |   4 +-
  tests/virprocessmock.c                    |   2 +-
  tests/virrandommock.c                     |   2 +-
  tests/virrotatingfiletest.c               |  26 +-
  tests/virscsitest.c                       |   4 +-
  tests/virshtest.c                         |  32 +-
  tests/virstoragetest.c                    |   2 +-
  tests/virstringtest.c                     |  10 +-
  tests/virsystemdtest.c                    |  24 +-
  tests/virtestmock.c                       |   2 +-
  tests/virtypedparamtest.c                 |   6 +-
  tests/virusbtest.c                        |   4 +-
  tests/vmx2xmltest.c                       |   2 +-
  tests/vshtabletest.c                      |  18 +-
  tests/xml2vmxtest.c                       |   6 +-
  tools/virsh-completer-domain.c            |   6 +-
  tools/virsh-completer-host.c              |   4 +-
  tools/virsh-completer-interface.c         |   2 +-
  tools/virsh-completer-network.c           |   8 +-
  tools/virsh-completer-nodedev.c           |   6 +-
  tools/virsh-completer-nwfilter.c          |   4 +-
  tools/virsh-completer-pool.c              |   6 +-
  tools/virsh-completer-secret.c            |   6 +-
  tools/virsh-console.c                     |   8 +-
  tools/virsh-domain-monitor.c              |   4 +-
  tools/virsh-domain-monitor.h              |   2 +-
  tools/virsh-domain.c                      |  62 +--
  tools/virsh-host.c                        |  14 +-
  tools/virsh-interface.c                   |   8 +-
  tools/virsh-network.c                     |   6 +-
  tools/virsh-nodedev.c                     |   8 +-
  tools/virsh-nwfilter.c                    |   4 +-
  tools/virsh-pool.c                        |  14 +-
  tools/virsh-secret.c                      |   8 +-
  tools/virsh-util.c                        |  10 +-
  tools/virsh-util.h                        |   4 +-
  tools/virsh-volume.c                      |   2 +-
  tools/virsh.c                             |   4 +-
  tools/virt-admin-completer.c              |   2 +-
  tools/virt-admin.c                        |  12 +-
  tools/virt-host-validate-common.c         |   4 +-
  tools/virt-login-shell-helper.c           |   4 +-
  tools/vsh.c                               |  56 +--
  tools/vsh.h                               |  22 +-
  tools/wireshark/src/packet-libvirt.c      |   6 +-
  370 files changed, 3672 insertions(+), 3710 deletions(-)


Reviewed-by: Michal Privoznik <mprivozn@xxxxxxxxxx>

I've identified other macros of ours that might be worth converting too:

  ATTRIBUTE_FALLTHROUGH
  ATTRIBUTE_FMT_PRINTF
  ATTRIBUTE_FORMAT
  ATTRIBUTE_NOINLINE
  ATTRIBUTE_NONNULL
  ATTRIBUTE_PACKED
  ATTRIBUTE_RETURN_CHECK
  ATTRIBUTE_SENTINEL
  ATTRIBUTE_UNUSED

Michal

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux