From e4dc1d1a73f17f56e239a39f533f2b7c90129a46 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 20 Oct 2018 21:40:20 +0100 Subject: pvs-studio: silence bogus V557 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5aa740afa1143adaf4e2afa5d5e1596497de8323 Reviewed-on: https://gerrit.libreoffice.org/62112 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/opengl/win/WinDeviceInfo.cxx | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'vcl/opengl/win/WinDeviceInfo.cxx') diff --git a/vcl/opengl/win/WinDeviceInfo.cxx b/vcl/opengl/win/WinDeviceInfo.cxx index 2a36d57ce9dd..9c48651918a5 100644 --- a/vcl/opengl/win/WinDeviceInfo.cxx +++ b/vcl/opengl/win/WinDeviceInfo.cxx @@ -831,12 +831,6 @@ void WinOpenGLDeviceInfo::GetData() } } -// Macro for assigning a device vendor id to a string. -#define DECLARE_VENDOR_ID(name, deviceId) \ - case name: \ - *mpDeviceVendors[id] = deviceId; \ -break; - OUString WinOpenGLDeviceInfo::GetDeviceVendor(wgl::DeviceVendor id) { assert(id >= 0 && id < wgl::DeviceVendorMax); @@ -848,14 +842,26 @@ OUString WinOpenGLDeviceInfo::GetDeviceVendor(wgl::DeviceVendor id) switch (id) { - DECLARE_VENDOR_ID(wgl::VendorAll, ""); - DECLARE_VENDOR_ID(wgl::VendorIntel, "0x8086"); - DECLARE_VENDOR_ID(wgl::VendorNVIDIA, "0x10de"); - DECLARE_VENDOR_ID(wgl::VendorAMD, "0x1022"); - DECLARE_VENDOR_ID(wgl::VendorATI, "0x1002"); - DECLARE_VENDOR_ID(wgl::VendorMicrosoft, "0x1414"); - // Suppress a warning. - DECLARE_VENDOR_ID(wgl::DeviceVendorMax, ""); + case wgl::VendorAll: + *mpDeviceVendors[id] = ""; + break; + case wgl::VendorIntel: + *mpDeviceVendors[id] = "0x8086"; + break; + case wgl::VendorNVIDIA: + *mpDeviceVendors[id] = "0x10de"; + break; + case wgl::VendorAMD: + *mpDeviceVendors[id] = "0x1022"; + break; + case wgl::VendorATI: + *mpDeviceVendors[id] = "0x1002"; + break; + case wgl::VendorMicrosoft: + *mpDeviceVendors[id] = "0x1414"; + break; + case wgl::DeviceVendorMax: // Suppress a warning. + break; } return *mpDeviceVendors[id]; -- cgit v1.2.3