mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-06 13:45:37 -04:00
Switched from C-style arrays to std::vector to fix C++17 std::size() not being available on some Linux dists to fix !1343 build failures
This commit is contained in:
@@ -6,9 +6,10 @@
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "RGBController_MSIGPU.h"
|
||||
#include <array>
|
||||
|
||||
static unsigned char brightness_values[] = { 0x14, 0x28, 0x3c, 0x50, 0x64 };
|
||||
static unsigned char speed_values[] = { 0x04, 0x02, 0x01 };
|
||||
static const std::array<unsigned char, 5> brightness_values = { 0x14, 0x28, 0x3c, 0x50, 0x64 };
|
||||
static const std::array<unsigned char, 3> speed_values = { 0x04, 0x02, 0x01 };
|
||||
|
||||
int RGBController_MSIGPU::GetDeviceMode()
|
||||
{
|
||||
@@ -30,7 +31,7 @@ int RGBController_MSIGPU::GetModeSpeed()
|
||||
{
|
||||
unsigned char mode_speed = msi_gpu->MSIGPURegisterRead(MSI_GPU_REG_SPEED);
|
||||
|
||||
for(std::size_t speed = 0; speed < std::size(speed_values); speed++)
|
||||
for(std::size_t speed = 0; speed < speed_values.size(); speed++)
|
||||
{
|
||||
if(speed_values[speed] == mode_speed)
|
||||
{
|
||||
@@ -45,7 +46,7 @@ int RGBController_MSIGPU::GetModeBrightness()
|
||||
{
|
||||
unsigned char mode_brightness = msi_gpu->MSIGPURegisterRead(MSI_GPU_REG_BRIGHTNESS);
|
||||
|
||||
for(std::size_t brightness = 0; brightness < std::size(brightness_values); brightness++)
|
||||
for(std::size_t brightness = 0; brightness < brightness_values.size(); brightness++)
|
||||
{
|
||||
if (brightness_values[brightness] == mode_brightness)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user