[vbox-dev] [PATCH 0/2] Cleanup non-variadic macro usage of RT_NOREF*
Michael Thayer
michael.thayer at oracle.com
Mon Jan 8 16:18:00 UTC 2018
Hello Florian,
And a Happy New Year! I took a look at your patch, and it seems to be
missing quite a lot of instances of RT_NOREF<n>. This is probably due
to coccinelle (I installed it and re-ran it locally to see) not liking
C++ constructs, probably including code inside of class methods. Of
course, it could probably be done using sed, but I would actually prefer
not to make this change whole-sale, but rather to fix RT_NOREF<n>
instances only when we touch affected code, as it would create a lot of
churn and make back-ports of fixes to older supported versions harder.
Thanks!
Regards
Michael
25.12.2017 00:50, Florian Klink wrote:
> Merry Christmas :-)
>
> This patchset adds a coccinelle semantic patch replacing the
> non-variadic variants of RT_NOREF (RT_NOREF1…RT_NOREF22) with their
> variadic counterpart, and what happens when you run this against the
> source repo (latest SVN checkout)
>
> Keep in mind that
>
>> spatch --sp-file tools/coccinelle/rt_noref_variadic.cocci --in-place --dir .
>
> won't patch .cpp files (only .c ones), as cocinelle (strictly speaking)
> doesn't have a cpp parser.
>
> I manually invoked it on each .cpp file too using something like this:
>
>> for f in **/*.cpp;do echo $f;spatch --sp-file tools/coccinelle/rt_noref_variadic.cocci --in-place $f;done
>
> and it seemed to work too :-)
>
> I did not touch header files, as (from my understanding) those should
> still support compilers not supporting variadic macros.
>
> Regards,
> Florian
>
> Florian Klink (2):
> add rt_noref_variadic.cocci
> tree-wide: use RT_NOREF instead of the non-variadic variants
>
> .../Additions/common/VBoxGuest/VBoxGuest-win.cpp | 14 +--
> src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp | 16 +--
> .../VBoxGuest/lib/VBoxGuestR0LibHGCMInternal.cpp | 8 +-
> .../common/VBoxGuest/lib/VBoxGuestR3Lib.cpp | 2 +-
> .../common/VBoxService/VBoxService-win.cpp | 4 +-
> .../VBoxService/VBoxServiceControlProcess.cpp | 6 +-
> .../VBoxService/VBoxServiceControlSession.cpp | 4 +-
> .../common/VBoxService/VBoxServicePropCache.cpp | 4 +-
> src/VBox/Additions/common/pam/pam_vbox.cpp | 8 +-
> src/VBox/Additions/x11/VBoxClient/clipboard.cpp | 8 +-
> src/VBox/Additions/x11/VBoxClient/display.cpp | 2 +-
> src/VBox/Additions/x11/VBoxClient/draganddrop.cpp | 2 +-
> src/VBox/Additions/x11/VBoxClient/main.cpp | 2 +-
> src/VBox/Additions/x11/VBoxClient/seamless.cpp | 4 +-
> .../VBoxClient/testcase/tstSeamlessX11-auto.cpp | 14 +--
> src/VBox/Debugger/DBGCBuiltInSymbols.cpp | 2 +-
> src/VBox/Debugger/DBGCCommands.cpp | 8 +-
> src/VBox/Debugger/DBGCEmulateCodeView.cpp | 4 +-
> src/VBox/Debugger/DBGCEval.cpp | 4 +-
> src/VBox/Debugger/DBGPlugInDarwin.cpp | 2 +-
> src/VBox/Debugger/DBGPlugInLinux.cpp | 4 +-
> src/VBox/Debugger/DBGPlugInSolaris.cpp | 4 +-
> src/VBox/Devices/EFI/DevSmc.cpp | 36 +++----
> src/VBox/Devices/Graphics/DevVGA-SVGA3d-info.cpp | 2 +-
> src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp | 2 +-
> src/VBox/Devices/Graphics/DevVGA.cpp | 4 +-
> src/VBox/Devices/Input/PS2K.cpp | 6 +-
> src/VBox/Devices/Input/PS2M.cpp | 6 +-
> src/VBox/Devices/Input/UsbKbd.cpp | 2 +-
> src/VBox/Devices/Network/DevE1000.cpp | 6 +-
> src/VBox/Devices/Network/DevE1000Phy.cpp | 2 +-
> src/VBox/Devices/Network/DevPCNet.cpp | 2 +-
> src/VBox/Devices/Network/SrvIntNetR0.cpp | 4 +-
> src/VBox/Devices/Network/slirp/ip_icmpwin.c | 2 +-
> src/VBox/Devices/PC/ACPI/VBoxAcpi.cpp | 4 +-
> src/VBox/Devices/PC/DevFwCommon.cpp | 2 +-
> src/VBox/Devices/PC/DevLPC.cpp | 4 +-
> src/VBox/Devices/PC/DevPcBios.cpp | 2 +-
> src/VBox/Devices/Storage/DevAHCI.cpp | 82 +++++++--------
> src/VBox/Devices/Storage/DevATA.cpp | 20 ++--
> src/VBox/Devices/Storage/DrvSCSI.cpp | 2 +-
> src/VBox/Devices/Storage/UsbMsd.cpp | 2 +-
> src/VBox/Devices/Storage/VSCSI/VSCSILunMmc.cpp | 2 +-
> src/VBox/Devices/USB/DevOHCI.cpp | 88 ++++++++--------
> src/VBox/Devices/VMMDev/VMMDev.cpp | 2 +-
> src/VBox/Disassembler/testcase/tstDisasm-1.cpp | 2 +-
> src/VBox/Disassembler/testcase/tstDisasm-2.cpp | 2 +-
> .../ExtPacks/VBoxDTrace/onnv/cmd/dtrace/dtrace.c | 20 ++--
> .../VBoxDTrace/onnv/common/ctf/ctf_create.c | 2 +-
> .../VBoxDTrace/onnv/lib/libctf/common/ctf_lib.c | 2 +-
> .../VBoxDTrace/onnv/lib/libctf/common/ctf_subr.c | 2 +-
> .../onnv/lib/libdtrace/common/dt_aggregate.c | 10 +-
> .../VBoxDTrace/onnv/lib/libdtrace/common/dt_as.c | 4 +-
> .../VBoxDTrace/onnv/lib/libdtrace/common/dt_cc.c | 16 +--
> .../onnv/lib/libdtrace/common/dt_consume.c | 6 +-
> .../VBoxDTrace/onnv/lib/libdtrace/common/dt_decl.c | 2 +-
> .../VBoxDTrace/onnv/lib/libdtrace/common/dt_dis.c | 22 ++--
> .../onnv/lib/libdtrace/common/dt_error.c | 2 +-
> .../onnv/lib/libdtrace/common/dt_ident.c | 8 +-
> .../onnv/lib/libdtrace/common/dt_module.c | 6 +-
> .../onnv/lib/libdtrace/common/dt_options.c | 50 +++++-----
> .../onnv/lib/libdtrace/common/dt_parser.c | 14 +--
> .../onnv/lib/libdtrace/common/dt_pragma.c | 4 +-
> .../onnv/lib/libdtrace/common/dt_printf.c | 76 +++++++-------
> .../onnv/lib/libdtrace/common/dt_program.c | 4 +-
> .../onnv/lib/libdtrace/common/dt_provider.c | 4 +-
> .../VBoxDTrace/onnv/lib/libdtrace/common/dt_subr.c | 4 +-
> .../onnv/lib/libdtrace/common/dt_xlator.c | 2 +-
> src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp | 4 +-
> src/VBox/GuestHost/DragAndDrop/DnDPath.cpp | 6 +-
> .../GuestHost/OpenGL/packer/pack_visibleregion.c | 2 +-
> src/VBox/GuestHost/OpenGL/util/mem.c | 4 +-
> .../GuestHost/SharedClipboard/x11-clipboard.cpp | 44 ++++----
> src/VBox/HostDrivers/Support/SUPDrv.cpp | 6 +-
> src/VBox/HostDrivers/Support/SUPDrvGip.cpp | 6 +-
> src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp | 2 +-
> .../HostDrivers/Support/SUPR3HardenedVerify.cpp | 12 +--
> .../HostDrivers/Support/linux/SUPLib-linux.cpp | 2 +-
> src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp | 24 ++---
> .../Support/win/SUPHardenedVerifyImage-win.cpp | 10 +-
> .../Support/win/SUPHardenedVerifyProcess-win.cpp | 4 +-
> src/VBox/HostDrivers/Support/win/SUPLib-win.cpp | 4 +-
> .../HostDrivers/VBoxNetFlt/win/cfg/VBoxNetCfg.cpp | 4 +-
> .../VBoxNetFlt/win/drv/VBoxNetFltM-win.cpp | 7 +-
> .../VBoxNetFlt/win/drv/VBoxNetFltP-win.cpp | 8 +-
> .../VBoxNetFlt/win/drv/VBoxNetFltRt-win.cpp | 18 ++--
> .../VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp | 24 ++---
> .../VBoxNetFlt/win/nobj/VBoxNetFltNobj.cpp | 4 +-
> .../VBoxNetFlt/win/tools/VBoxNetAdpUninstall.cpp | 2 +-
> .../VBoxNetFlt/win/tools/VBoxNetFltInstall.cpp | 2 +-
> .../VBoxNetFlt/win/tools/VBoxNetFltUninstall.cpp | 2 +-
> .../VBoxNetFlt/win/tools/VBoxNetLwfInstall.cpp | 2 +-
> .../VBoxNetFlt/win/tools/VBoxNetLwfUninstall.cpp | 2 +-
> src/VBox/HostDrivers/VBoxUSB/USBFilter.cpp | 2 +-
> .../VBoxUSB/win/Install/USBUninstall.cpp | 2 +-
> .../HostDrivers/VBoxUSB/win/cmn/VBoxDrvTool.cpp | 2 +-
> .../HostDrivers/VBoxUSB/win/dev/VBoxUsbDev.cpp | 4 +-
> .../HostDrivers/VBoxUSB/win/dev/VBoxUsbPwr.cpp | 6 +-
> src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbRt.cpp | 2 +-
> .../HostDrivers/VBoxUSB/win/lib/VBoxUsbLib-win.cpp | 4 +-
> .../HostDrivers/VBoxUSB/win/mon/VBoxUsbFlt.cpp | 4 +-
> .../HostDrivers/VBoxUSB/win/mon/VBoxUsbHook.cpp | 2 +-
> .../HostDrivers/VBoxUSB/win/mon/VBoxUsbMon.cpp | 10 +-
> .../HostDrivers/VBoxUSB/win/testcase/USBTest.cpp | 2 +-
> src/VBox/HostServices/GuestControl/service.cpp | 8 +-
> src/VBox/HostServices/GuestProperties/service.cpp | 2 +-
> .../GuestProperties/testcase/tstGuestPropSvc.cpp | 2 +-
> src/VBox/HostServices/HostChannel/HostChannel.cpp | 4 +-
> .../SharedClipboard/VBoxClipboard-win.cpp | 2 +-
> .../HostServices/SharedClipboard/x11-clipboard.cpp | 8 +-
> src/VBox/HostServices/SharedFolders/mappings.cpp | 8 +-
> .../testcase/tstSharedFolderService.cpp | 98 +++++++++---------
> .../SharedFolders/testcase/tstShflCase.cpp | 8 +-
> src/VBox/HostServices/SharedFolders/vbsf.cpp | 12 +--
> .../win/InstallHelper/VBoxInstallHelper.cpp | 8 +-
> .../Main/src-helper-apps/VBoxExtPackHelperApp.cpp | 8 +-
> src/VBox/Runtime/r0drv/nt/memobj-r0drv-nt.cpp | 2 +-
> src/VBox/Runtime/r0drv/nt/mp-r0drv-nt.cpp | 4 +-
> src/VBox/Runtime/r3/win/krnlmod-win.cpp | 2 +-
> src/VBox/Runtime/testcase/tstRTVfs.cpp | 2 +-
> src/VBox/Runtime/tools/RTDbgSymCache.cpp | 4 +-
> src/VBox/Runtime/tools/RTGzip.cpp | 4 +-
> src/VBox/Storage/CUE.cpp | 2 +-
> src/VBox/Storage/ISCSI.cpp | 2 +-
> src/VBox/Storage/Parallels.cpp | 2 +-
> src/VBox/Storage/QCOW.cpp | 4 +-
> src/VBox/Storage/QED.cpp | 4 +-
> src/VBox/Storage/RAW.cpp | 2 +-
> src/VBox/Storage/VCICache.cpp | 2 +-
> src/VBox/Storage/VD.cpp | 4 +-
> src/VBox/Storage/VHD.cpp | 4 +-
> src/VBox/Storage/VMDK.cpp | 6 +-
> src/VBox/Storage/testcase/VDMemDisk.cpp | 2 +-
> src/VBox/Storage/testcase/VDScript.cpp | 4 +-
> src/VBox/Storage/testcase/VDScriptInterp.cpp | 2 +-
> src/VBox/Storage/testcase/tstVD.cpp | 2 +-
> src/VBox/Storage/testcase/tstVDSnap.cpp | 4 +-
> src/VBox/VMM/VMMR3/PDM.cpp | 2 +-
> src/VBox/VMM/VMMR3/VM.cpp | 2 +-
> src/VBox/VMM/tools/VBoxCpuReport.cpp | 2 +-
> src/VBox/ValidationKit/utils/nt/nttimesources.cpp | 2 +-
> .../utils/usb/UsbTestServiceGadgetHostUsbIp.cpp | 2 +-
> src/bldprogs/scm.cpp | 2 +-
> src/bldprogs/scmrw.cpp | 16 +--
> tools/coccinelle/rt_noref_variadic.cocci | 111 +++++++++++++++++++++
> 145 files changed, 702 insertions(+), 588 deletions(-)
> create mode 100644 tools/coccinelle/rt_noref_variadic.cocci
>
--
Michael Thayer | VirtualBox engineer
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt
ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603
Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister
der Handelskammer Midden-Nederland, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher
More information about the vbox-dev
mailing list