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. 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
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