mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-02-05 13:28:16 +00:00
c/direct_mode: Cast display int only for comparision with size().
It is clearer to leave `int display` from settings as signed integer and cast only for the comparision with the unsigned vector size.
This commit is contained in:
parent
a449ed174a
commit
b399960f67
|
@ -352,14 +352,12 @@ comp_window_direct_init_nvidia(struct comp_window *w)
|
|||
static comp_window_direct_randr_display *
|
||||
comp_window_direct_current_randr_display(struct comp_window_direct *w)
|
||||
{
|
||||
uint32_t index = w->base.c->settings.display;
|
||||
if (index == (uint32_t)-1) {
|
||||
int index = w->base.c->settings.display;
|
||||
if (index == -1)
|
||||
index = 0;
|
||||
}
|
||||
|
||||
if (w->randr_displays.size() <= index) {
|
||||
if (w->randr_displays.size() <= (uint32_t)index)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return &w->randr_displays[index];
|
||||
}
|
||||
|
@ -367,14 +365,12 @@ comp_window_direct_current_randr_display(struct comp_window_direct *w)
|
|||
static comp_window_direct_nvidia_display *
|
||||
comp_window_direct_current_nvidia_display(struct comp_window_direct *w)
|
||||
{
|
||||
uint32_t index = w->base.c->settings.display;
|
||||
if (index == (uint32_t)-1) {
|
||||
int index = w->base.c->settings.display;
|
||||
if (index == -1)
|
||||
index = 0;
|
||||
}
|
||||
|
||||
if (w->nv_displays.size() <= index) {
|
||||
if (w->nv_displays.size() <= (uint32_t)index)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return &w->nv_displays[index];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue