csessiondevice: use auto and less struct

use auto and less 'struct' this is c++
This commit is contained in:
Tom Englund 2025-07-19 23:46:12 +02:00
parent dfedd67148
commit 2f253a99b6
2 changed files with 8 additions and 8 deletions

View file

@ -29,7 +29,7 @@ namespace Aquamarine {
static Hyprutils::Memory::CSharedPointer<CSessionDevice> openIfKMS(Hyprutils::Memory::CSharedPointer<CSession> session_, const std::string& path_);
bool supportsKMS();
void resolveMatchingRenderNode(struct udev_device* cardDevice);
void resolveMatchingRenderNode(udev_device* cardDevice);
int fd = -1;
int renderNodeFd = -1;

View file

@ -161,24 +161,24 @@ bool Aquamarine::CSessionDevice::supportsKMS() {
return kms;
}
void Aquamarine::CSessionDevice::resolveMatchingRenderNode(struct udev_device* cardDevice) {
void Aquamarine::CSessionDevice::resolveMatchingRenderNode(udev_device* cardDevice) {
if (!cardDevice)
return;
auto pciParent = udev_device_get_parent_with_subsystem_devtype(cardDevice, "pci", nullptr);
const auto* pciSyspath = pciParent ? udev_device_get_syspath(pciParent) : nullptr;
auto pciParent = udev_device_get_parent_with_subsystem_devtype(cardDevice, "pci", nullptr);
const auto* pciSyspath = pciParent ? udev_device_get_syspath(pciParent) : nullptr;
struct udev_enumerate* enumerate = udev_enumerate_new(session->udevHandle);
auto* enumerate = udev_enumerate_new(session->udevHandle);
if (!enumerate)
return;
udev_enumerate_add_match_subsystem(enumerate, "drm");
udev_enumerate_scan_devices(enumerate);
struct udev_list_entry* devices = udev_enumerate_get_list_entry(enumerate);
struct udev_list_entry* entry = nullptr;
auto* devices = udev_enumerate_get_list_entry(enumerate);
udev_list_entry* entry = nullptr;
bool matched = false;
bool matched = false;
udev_list_entry_foreach(entry, devices) {
const auto* path = udev_list_entry_get_name(entry);