FreeBSD: Fix compilation

This commit is contained in:
Obiwac 2022-07-04 20:13:36 +00:00 committed by Adam Honse
parent 2414b41b94
commit 6def6a7772
2 changed files with 6 additions and 5 deletions

View file

@ -4,6 +4,7 @@
#include <fstream>
#include <iostream>
#include <limits.h>
#include <unistd.h>
#include <sstream>
@ -120,7 +121,7 @@ std::string AutoStart::GetExePath()
char exepath[ PATH_MAX ];
ssize_t count = readlink("/proc/self/exe", exepath, PATH_MAX);
return(std::string(exepath, (count > 0) ? count : 0));
}
@ -159,7 +160,7 @@ void AutoStart::InitAutoStart(std::string name)
std::error_code ec;
bool success = true;
if(!filesystem::exists(autostart_dir))
{
success = filesystem::create_directories(autostart_dir, ec);

View file

@ -56,7 +56,7 @@ void LenovoUSBController::setZoneLeds(uint8_t zone_num, vector<pair<uint8_t, RGB
{
for(size_t curr = 0; curr < led_colors.size();)
{
uint8_t buffer[LENOVO_HID_PACKET_SIZE] = {LENOVO_INSTRUCTION_START, LENOVO_ZONE_ID_0+zone_num, 0, 0};
uint8_t buffer[LENOVO_HID_PACKET_SIZE] = {LENOVO_INSTRUCTION_START, (uint8_t) (LENOVO_ZONE_ID_0+zone_num), 0, 0};
/*---------------------------------------------------------*\
| Set the colour bytes in the packet |
@ -87,7 +87,7 @@ void LenovoUSBController::setZoneLeds(uint8_t zone_num, vector<pair<uint8_t, RGB
void LenovoUSBController::setSingleLED(uint8_t zone_num, uint8_t led_num, RGBColor color)
{
uint8_t buffer[LENOVO_HID_PACKET_SIZE] = {LENOVO_INSTRUCTION_START, LENOVO_ZONE_ID_0+zone_num, 1, 0, led_num, RGBGetRValue(color), RGBGetGValue(color), RGBGetBValue(color)};
uint8_t buffer[LENOVO_HID_PACKET_SIZE] = {LENOVO_INSTRUCTION_START, (uint8_t) (LENOVO_ZONE_ID_0+zone_num), 1, 0, led_num, (uint8_t) (RGBGetRValue(color)), (uint8_t) (RGBGetGValue(color)), (uint8_t) (RGBGetBValue(color))};
hid_send_feature_report(dev, buffer, LENOVO_HID_PACKET_SIZE);
}
@ -115,4 +115,4 @@ void LenovoUSBController::setDeviceHardwareMode()
|reboots |
\*---------------------------------------*/
sendBasicInstruction(0xB1);
}
}